Comment 1 for bug 441401

Revision history for this message
Matthew East (mdke) wrote :

This looks to be an issue caused by the combination of the symlink-dupes script in ubuntu-docs which uses symlinks for files which are identical (in this case, faq.xml in several languages is identical because it is untranslated and appears in English) and the pkgbinarymangler work that Martin Pitt did to move documentation translations into the langpacks. Possibly because Martin's work uses symlinks too, there seems to be some kind of conflict.

I think the answer is probably simply to stop using the symlink-dupes script as follows, because Martin's work already removes any excess size in the package by splitting out translated xml into separate packages. However I'd like to get Martin's thoughts on that, so I'm subscribing him.

=== modified file 'debian/control'
--- debian/control 2009-04-19 19:24:49 +0000
+++ debian/control 2009-10-11 21:03:44 +0000
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Ubuntu Documentation Team <email address hidden>
 Build-Depends: debhelper (>= 5.0.0), cdbs
-Build-Depends-Indep: xsltproc, docbook-xsl, perl, perl-modules, gnome-doc-utils, docbook-xml, fdupes, bc
+Build-Depends-Indep: xsltproc, docbook-xsl, perl, perl-modules, gnome-doc-utils, docbook-xml, bc
 Standards-Version: 3.8.1
 Homepage: https://launchpad.net/ubuntu-doc

=== modified file 'debian/rules'
--- debian/rules 2009-09-23 06:36:07 +0000
+++ debian/rules 2009-10-11 21:03:20 +0000
@@ -68,5 +68,3 @@
  cp -R build/serverguide/* debian/ubuntu-serverguide/usr/share/ubuntu-serverguide/html/
  cp -R build/libs/C/contributors.html debian/ubuntu-serverguide/usr/share/ubuntu-serverguide/libs/C/

-binary-fixup/ubuntu-docs::
- (cd debian/ubuntu-docs; ../../scripts/symlink-dupes)

=== removed file 'scripts/symlink-dupes'
--- scripts/symlink-dupes 2008-04-03 21:36:44 +0000
+++ scripts/symlink-dupes 1970-01-01 00:00:00 +0000
@@ -1,33 +0,0 @@
-#!/usr/bin/python
-
-import os, subprocess
-
-def pathsplit(p, rest=[]):
- (h,t) = os.path.split(p)
- if len(h) < 1: return [t]+rest
- if len(t) < 1: return [h]+rest
- return pathsplit(h,[t]+rest)
-
-def commonpath(l1, l2, common=[]):
- if len(l1) < 1: return (common, l1, l2)
- if len(l2) < 1: return (common, l1, l2)
- if l1[0] != l2[0]: return (common, l1, l2)
- return commonpath(l1[1:], l2[1:], common+[l1[0]])
-
-def relpath(p1, p2):
- (common,l1,l2) = commonpath(pathsplit(p1), pathsplit(p2))
- p = []
- if len(l1) > 0:
- p = [ '../' * len(l1) ]
- p = p + l2
- return os.path.join( *p )
-
-fdupes = subprocess.Popen(['fdupes', '-r', '--sameline', '.'], stdout=subprocess.PIPE)
-for l in fdupes.stdout:
- files = l.split()
- master = files.pop(0)
- for dup in files:
- target = relpath(os.path.dirname(dup), master)
- os.unlink(dup)
- os.symlink(target, dup)
- print dup, '->', target