[libreoffice] 01/02: dedup stuff in -common/java-common. remove obsolete fdupes stuff.

Rene Engelhard rene at moszumanska.debian.org
Thu Feb 16 20:55:56 UTC 2017


This is an automated email from the git hooks/post-receive script.

rene pushed a commit to branch debian-experimental-5.3
in repository libreoffice.

commit 8ff011d4067b76b52a949863e15a50fcbdfca99c
Author: Rene Engelhard <rene at debian.org>
Date:   Thu Feb 16 18:54:17 2017 +0100

    dedup stuff in -common/java-common. remove obsolete fdupes stuff.
---
 changelog          |   6 ++
 control            |   4 +-
 control.in         |   2 +-
 rules              |  16 ++---
 scripts/cleandupes | 186 -----------------------------------------------------
 tests/control      |   2 +-
 6 files changed, 16 insertions(+), 200 deletions(-)

diff --git a/changelog b/changelog
index 03c1168..5a34bc7 100644
--- a/changelog
+++ b/changelog
@@ -13,6 +13,12 @@ libreoffice (1:5.3.0-2) UNRELEASED; urgency=medium
     - allow build with gold (maybe for LTO?)
     - ignore "libreoffice" for --link-doc
     - fix dh_installdocs calls to install copyright for "libreoffice"
+    - symlink /usr/share/libreoffice/program/classes/unoil.jar to
+      /usr/share/java/unoil.jar to "dedup" it
+    - run rdfind to get duplicated /usr/share/icons/gnome symlinked to
+      hicolor if identical (closes: #835515)
+  * debian/control.in, debian/rules, debian/scripts/cleandupes: remove unused
+    fdupes B-D-I and commented-out usage
 
  -- Rene Engelhard <rene at debian.org>  Thu, 02 Feb 2017 09:04:43 +0100
 
diff --git a/control b/control
index cbdaa03..089bd39 100644
--- a/control
+++ b/control
@@ -150,7 +150,6 @@ Build-Depends: ant (>= 1.7.0) [!hppa !ia64 !mips64 !s390 !sparc],
                zip,
                zlib1g-dev
 Build-Depends-Indep: doxygen (>= 1.8.4) <!nodoc>,
-                     fdupes,
                      g++-mingw-w64-i686,
                      libbase-java [!hppa !ia64 !mips64 !s390 !sparc],
                      libbsh-java,
@@ -164,7 +163,8 @@ Build-Depends-Indep: doxygen (>= 1.8.4) <!nodoc>,
                      librepository-java (>= 1.1.6) [!hppa !ia64 !mips64 !s390 !sparc],
                      libsac-java [!hppa !ia64 !mips64 !s390 !sparc],
                      libserializer-java (>= 1.1.6) [!hppa !ia64 !mips64 !s390 !sparc],
-                     libxml-java (>= 1.1.6) [!hppa !ia64 !mips64 !s390 !sparc]
+                     libxml-java (>= 1.1.6) [!hppa !ia64 !mips64 !s390 !sparc],
+                     rdfind
 Build-Conflicts: amd-libopencl1,
                  flex (= 2.5.34-1) [amd64],
                  g++-4.6 (= 4.6.1-10),
diff --git a/control.in b/control.in
index ac26808..b66142a 100644
--- a/control.in
+++ b/control.in
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Debian LibreOffice Maintainers <debian-openoffice at lists.debian.org>
 Uploaders: Rene Engelhard <rene at debian.org>, Chris Halls <halls at debian.org>
 Build-Depends: %BUILD_DEPS%,
-Build-Depends-Indep: fdupes, %BUILD_DEPS_INDEP%
+Build-Depends-Indep: %BUILD_DEPS_INDEP%
 Build-Conflicts: flex (= 2.5.34-1) [amd64],
                  g++-4.6 (= 4.6.1-10),
                  g++-4.6 (= 4.6.1-11),
diff --git a/rules b/rules
index 9bef90d..dfe3d03 100755
--- a/rules
+++ b/rules
@@ -113,6 +113,7 @@ BUILD_DEPS=\
     zip,\
     zlib1g-dev\
 
+BUILD_DEPS_INDEP += rdfind
 
 CHECKTARGET:=check
 # These are components which can be built from internal copies, or used from the
@@ -1588,7 +1589,6 @@ clean-debdir:
 	rm -f debian/*.bug-script
 	rm -f debian/scripts/aotcompile.py*
 
-	rm -f l10n.fdupes
 	rm -f debian/shlibs.local
 	rm -f debian/*.templates
 
@@ -2486,15 +2486,6 @@ $(STAMP_DIR)/langpacks: $(STAMP_DIR)/build-indep $(STAMP_DIR)/install-indep $(SO
 			$(PKGDIR)-$$pkg/$(OODIR)/share/wordbook/$$iso/technical.dic; \
 	done
 
-	# FIXME!
-#	# replace duplicate files in the langpacks with symlinks
-#	TMP=`mktemp -q`; \
-#		fdupes --quiet --recurse --sameline --size \
-#		debian/libreoffice-common/$(OODIR) \
-#		$(foreach d,$(shell echo $(filter-out en-US ca-valencia,$(LANGPACKISOS)) | tr A-Z a-z),debian/libreoffice-l10n-$(d)/$(OODIR)) \
-#		> $$TMP && \
-#	debian/scripts/cleandupes --base=libreoffice --prefix=debian < $$TMP && rm -f $$TMP
-
 ifeq "$(DEB_VENDOR)" "Debian"
 	# install Debian presentation template
 	otps=`cd debian/templates; echo *.otp`; \
@@ -3062,6 +3053,10 @@ endif
 	ln -s /$(shell echo $(OODIR) | sed -e s/usr/var/)/share/prereg/bundled \
 		$(PKGDIR)-common/$(OODIR)/share/prereg/bundled
 
+	# dedup
+	cd $(PKGDIR)-common/usr/share/icons && \
+		rdfind -outputname /dev/null -makesymlinks true hicolor gnome
+
 	for i in $(ARCH_INDEP_PACKAGES); do \
 		if [ -e debian/$$i.bug-script.in ]; then \
 			cat debian/$$i.bug-script.in \
@@ -3141,6 +3136,7 @@ ifeq "$(ENABLE_JAVA)" "y"
 		< $(SOURCE_TREE)/unoil/pom.unoil.xml > debian/pom.unoil.xml
 	mh_installpoms -plibreoffice-java-common
 	mh_installjar -plibreoffice-java-common -l debian/pom.unoil.xml instdir/program/classes/unoil.jar
+	ln -sf $(PKGDIR)-java-common/usr/share/java/unoil.jar $(PKGDIR)-java-common/usr/share/libreoffice/program/classes/unoil.jar
 endif
 
 	touch $@
diff --git a/scripts/cleandupes b/scripts/cleandupes
deleted file mode 100755
index 8843c92..0000000
--- a/scripts/cleandupes
+++ /dev/null
@@ -1,186 +0,0 @@
-#! /usr/bin/python
-
-# read file input from stdin, which has the output of the command
-# fdupes --reverse --sameline --size <directory> ...
-
-import os, re, sys, fileinput, getopt
-
-class Duplicate:
-    def __init__(self, prefix, base, paths, size=-1):
-        self.size = size
-        self.files = {'common': [], 'l10n-en-us': []}
-        for path in paths:
-            match = re.match(prefix + '/' + base + r'-([^/]+)(.*)', path)
-            pkg, fn = match.groups()[:2]
-            self.files.setdefault(pkg, []).append(fn)
-
-        # one name to identify the duplicate
-        if len(self.files['common']):
-            self.id = self.files['common'][0]
-        elif len(self.files['l10n-en-us']):
-            self.id = self.files['l10n-en-us'][0]
-        else:
-            other_files = [files for pkg, files in self.files.items()
-                           if not pkg in ('common', 'l10n-en-us')]
-            self.id = other_files[0][0]
-
-    def is_candidate(self):
-        """do we want to replace that one ..."""
-        if len(self.files['common']) > 1 or len(self.files['l10n-en-us']) > 1:
-            # inter-package symlinks in -common or -l10n-en-us
-            if len(self.files) == 2:
-                # not references by any other package
-                return False
-        if len(self.files['common']) < 1 and len(self.files['l10n-en-us']) < 1:
-            # nothing to link to
-            return False
-        # see if we have duplicates in other packages
-        return len(self.files) > 2
-
-    def get_filenames(self, replace_only=False):
-        names = []
-        for pkg, files in self.files.items():
-            if replace_only and pkg in ('common', 'l10n-en-us'):
-                continue
-            names.extend(files)
-        return names
-
-    def get_target(self):
-        if len(self.files['common']):
-            return 'common', self.files['common'][0]
-        if len(self.files['l10n-en-us']):
-            return 'common', self.files['l10n-en-us'][0]
-        raise Exception, "no target file"
-
-    def statistics(self, verbose=False):
-        num_in_common = len(self.files['common']) + len(self.files['l10n-en-us'])
-        num_in_others = len(self.get_filenames(replace_only=True))
-        pkgs = ' '.join(self.files.keys()).replace('l10n-', '')
-        print "common: %2d, others: %2d, size: %d" % (num_in_common, num_in_others, self.size)
-        if not verbose:
-            print "    %s" % self.id
-        print "    %s" % pkgs
-        if verbose:
-            print '\t' + '\n\t'.join(self.get_filenames())
-
-def calc_savings(duplicates):
-    savings = {}
-    for dup in duplicates:
-        if not dup.is_candidate():
-            continue
-        for pkg, files in dup.files.items():
-            if pkg in ('common', 'l10n-en-us'):
-                continue
-            sizes = dup.size * len(files)
-            total = savings.get(pkg, 0) + sizes
-            savings[pkg] = total
-    return savings
-
-def calc_target_link(src_path, dst_path):
-    assert dst_path[0] == '/' and src_path[0] == '/'
-    src_dirs = src_path[1:].split('/')
-    dst_dirs = dst_path[1:].split('/')
-    common_idx = 0
-    while src_dirs[common_idx] == dst_dirs[common_idx]:
-        common_idx += 1
-    if common_idx == 0:
-        new_dirs = [''] + src_dirs
-    else:
-        updir_count = len(dst_dirs) - common_idx - 1
-        new_dirs = ['..' for i in range(updir_count)] + src_dirs[common_idx:]
-    return '/'.join(new_dirs)
-
-def remove_and_symlink(duplicates, prefix, base, dryrun=False, verbose=False):
-    for dup in duplicates:
-        if not dup.is_candidate():
-            continue
-        for pkg, files in dup.files.items():
-            if pkg in ('common', 'l10n-en-us'):
-                continue
-            target_pkg, target_name = dup.get_target()
-            for f in files:
-                target_link = calc_target_link(target_name, f)
-                pth = prefix + '/' + base + "-%s%s" % (pkg, f)
-                if verbose:
-                    print "DO: rm -f %s" % pth
-                if not dryrun:
-                    os.unlink(pth)
-                if verbose:
-                    print "DO: ln -s %s %s" % (target_link, pth)
-                if not dryrun:
-                    os.symlink(target_link, pth)
-    pass
-
-def main():
-    prog = os.path.basename(sys.argv[0])
-    try:
-        opts, args = getopt.getopt(sys.argv[1:], "b:np:v",
-                                   ["base=", "dry-run", "prefix=", "verbose"])
-    except getopt.GetoptError:
-        # print help information and exit:
-        print "usage: %s -p <prefix>|--prefix=<prefix> -b <base>|--base=<base> [-v|--verbose] [-n|--dry-run]" % prog
-        sys.exit(2)
-    verbose = False
-    dryrun = False
-    prefix = base = None
-    for o, a in opts:
-        if o in ("-v", "--verbose"):
-            verbose = True
-        if o in ("-n", "--dry-run"):
-            dryrun = True
-        if o in ("-b", "--base"):
-            base = a
-        if o in ("-p", "--prefix"):
-            prefix = a
-    if not prefix:
-        print "%s: Missing --prefix option" % prog
-        sys.exit(2)
-    if not base:
-        print "%s: Missing --base option" % prog
-        sys.exit(2)
-    if not os.path.isdir(prefix):
-        print "%s: Not a directory: %s" % (prog, prefix)
-        sys.exit(2)
-    del sys.argv[1:]
-    
-    size = -1
-    duplicates = []
-    for line in fileinput.input():
-        line = line[:-1]
-        m = re.match(r'(\d+) bytes each', line)
-        if m:
-            size = int(m.group(1))
-            continue
-        dup = Duplicate(prefix, base, line.split(), size)
-        duplicates.append(dup)
-        size = -1
-
-    if verbose:
-        print "========= Skip duplicates ========="
-        for dup in duplicates:
-            if not dup.is_candidate():
-                dup.statistics(verbose=True)
-        print
-    if verbose:
-        print "========= Replace duplicates ========="
-        for dup in duplicates:
-            if dup.is_candidate():
-                dup.statistics()
-        print
-
-    print "========= Savings per package ========="
-    saved_bytes = calc_savings(duplicates)
-    grand_total = 0
-    for pkg, total in saved_bytes.items():
-        print "%-10s: %9d" % (pkg, total)
-        grand_total = grand_total + total
-    print "===================="
-    print "%-10s: %9d" % ('TOTAL', grand_total)
-
-    if verbose:
-        print
-        print "========= Go! ========="
-    remove_and_symlink(duplicates, prefix, base, dryrun=dryrun, verbose=verbose)
-
-if __name__ == '__main__':
-    main()
diff --git a/tests/control b/tests/control
index 14e9ed2..7967a9c 100644
--- a/tests/control
+++ b/tests/control
@@ -1,5 +1,5 @@
 Tests: junit-subsequentcheck
-Depends: libreoffice, libreoffice-subsequentcheckbase, libreoffice-sdbc-hsqldb, autoconf, automake, bc, bison, bzip2, fastjar, flex (>= 2.3.35), gperf, libcups2-dev, libfontconfig1-dev, libfreetype6-dev (>= 2.2.0), libgl1-mesa-dev, libice-dev, libsm-dev, libx11-dev, libxaw7-dev, libxext-dev, libxinerama-dev, libxkbfile-dev, libxrender-dev, libxt-dev, libxtst-dev, pkg-config, unzip, x11proto-render-dev, xsltproc, zip, zlib1g-dev , libgltf-dev (>= 0.1.0) , opencollada-dev (>= 0.1.0~2014070 [...]
+Depends: libreoffice, libreoffice-subsequentcheckbase, libreoffice-sdbc-hsqldb, autoconf, automake, bc, bison, bzip2, fastjar, flex (>= 2.3.35), gperf, libcups2-dev, libfontconfig1-dev, libfreetype6-dev (>= 2.2.0), libgl1-mesa-dev, libice-dev, libsm-dev, libx11-dev, libxaw7-dev, libxext-dev, libxinerama-dev, libxkbfile-dev, libxrender-dev, libxt-dev, libxtst-dev, pkg-config, unzip, x11proto-render-dev, xsltproc, zip, zlib1g-dev , libgltf-dev (>= 0.1.0) , opencollada-dev (>= 0.1.0~2014070 [...]
 
 Tests: pyuno-import
 Depends: python3-uno

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openoffice/libreoffice.git



More information about the Pkg-openoffice-commits mailing list