Symlink not working with Karmic translations

Bug #441401 reported by Milo Casagrande
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Translations
Fix Released
Undecided
Unassigned
cdbs (Ubuntu)
Triaged
High
Unassigned
ubuntu-docs (Ubuntu)
Fix Released
High
Matthew East

Bug Description

Binary package hint: ubuntu-docs

Copying the email text as reference:

If we do an `ls -la` of /usr/share/gnome/help/internet/LANG/ the file faq.xml is pointing to `../am/faq.xml`, which does not exists. That file should point to /usr/share/gnome/help-langpack/internet/LANG/faq.xml. We've tested it with the "it", "es" and "ja" LANG.

Matthew East (mdke)
Changed in ubuntu-docs (Ubuntu):
importance: Undecided → High
milestone: none → ubuntu-9.10
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

Changed in ubuntu-docs (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Matthew East (mdke) wrote :

Confirming as I can reproduce this on karmic.

The problem is that the file symlinks to ../am/faq.xml which is not installed because that file is only included in the -am langpack. I don't see any solution to this except for removing the fdupes script in ubuntu-docs.

Changed in ubuntu-docs (Ubuntu):
status: New → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

I think dropping the fdupes script is fine for now, until we have a better solution for moving the gnome help files (the symlinking is just an utter hack, but in GNOME 3.0 there's some architecture to make that more flexible).

Revision history for this message
Matthew East (mdke) wrote :
Download full text (5.5 KiB)

Opening a cdbs task and assigning to pitti as discussed on irc.

The problem here is that the following script which is run by cdbs is causing a conflict with the pkgstriptranslations script:

# symlink identical Gnome help files within packages
if [ -z "$CDBS_NO_GNOME_HELP_SYMLINKING" ] && [ -d debian/ubuntu-docs/usr/share/gnome/help ]; then \
            cd debian/ubuntu-docs && LC_ALL=C fdupes -r1nq usr/share/gnome/help | while read s; do \
                set -- $(echo $s | tr ' ' '\n' | sort); \
                f=$1; shift; \
                for d; do \
                    echo "symlinking duplicate Gnome help file $d to $f"; \
                    rm $d; ln -s /$f $d; \
                done; \
            done; \
 fi

The conflict is because that script symlinks various identical xml files to one base xml file, like this:

symlinking duplicate Gnome help file usr/share/gnome/help/windows/be/migratingdata.xml to usr/share/gnome/help/windows/am/migratingdata.xml
symlinking duplicate Gnome help file usr/share/gnome/help/windows/bn/migratingdata.xml to usr/share/gnome/help/windows/am/migratingdata.xml
symlinking duplicate Gnome help file usr/share/gnome/help/windows/ceb/migratingdata.xml to usr/share/gnome/help/windows/am/migratingdata.xml
symlinking duplicate Gnome help file usr/share/gnome/help/windows/da/migratingdata.xml to usr/share/gnome/help/windows/am/migratingdata.xml
symlinking duplicate Gnome help file usr/share/gnome/help/windows/en_AU/migratingdata.xml to usr/share/gnome/help/windows/am/migratingdata.xml
symlinking duplicate Gnome help file usr/share/gnome/help/windows/en_CA/migratingdata.xml to usr/share/gnome/help/windows/am/migratingdata.xml
symlinking duplicate Gnome help file usr/share/gnome/help/windows/eo/migratingdata.xml to usr/share/gnome/help/windows/am/migratingdata.xml
symlinking duplicate Gnome help file usr/share/gnome/help/windows/et/migratingdata.xml to usr/share/gnome/help/windows/am/migratingdata.xml
symlinking duplicate Gnome help file usr/share/gnome/help/windows/fa/migratingdata.xml to usr/share/gnome/help/windows/am/migratingdata.xml
symlinking duplicate Gnome help file usr/share/gnome/help/windows/he/migratingdata.xml to usr/share/gnome/help/windows/am/migratingdata.xml
symlinking duplicate Gnome help file usr/share/gnome/help/windows/hr/migratingdata.xml to usr/share/gnome/help/windows/am/migratingdata.xml
symlinking duplicate Gnome help file usr/share/gnome/help/windows/id/migratingdata.xml to usr/share/gnome/help/windows/am/migratingdata.xml
symlinking duplicate Gnome help file usr/share/gnome/help/windows/jv/migratingdata.xml to usr/share/gnome/help/windows/am/migratingdata.xml
symlinking duplicate Gnome help file usr/share/gnome/help/windows/ka/migratingdata.xml to usr/share/gnome/help/windows/am/migratingdata.xml
symlinking duplicate Gnome help file usr/share/gnome/help/windows/kk/migratingdata.xml to usr/share/gnome/help/windows/am/migratingdata.xml
symlinking duplicate Gnome help file usr/share/gnome/help/windows/kn/migratingdata.xml to usr/share/gnome/help/windows/am/migratingdata.xml
symlinking duplicate Gnome help file usr/share/gnome/help/windows/ku/migratingd...

Read more...

Changed in ubuntu-docs (Ubuntu):
assignee: Martin Pitt (pitti) → Matthew East (mdke)
status: Confirmed → In Progress
Changed in cdbs (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-docs - 9.10.10

---------------
ubuntu-docs (9.10.10) karmic; urgency=low

  * Remove draft watermark from html pages
  * Drop fdupes script as it clashes with current pkgbinarymangler (LP: #441401)
    - also need to set CDBS_NO_GNOME_HELP_SYMLINKING=1 to stop fdupes script
  * Update version number in offline browser startpage to 9.10

 -- Matthew East <email address hidden> Mon, 12 Oct 2009 22:09:57 +0100

Changed in ubuntu-docs (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Matthew East (mdke) wrote :

NB - I think that in order for the ubuntu-docs fix to be available, a langpack rebuild will be necessary. I'll retest after the next langpacks.

Revision history for this message
Martin Pitt (pitti) wrote :

> NB - I think that in order for the ubuntu-docs fix to be available, a langpack rebuild will be necessary. I'll retest after the next langpacks.

Confirmed, at least to pick up the new translations.

Changed in cdbs (Ubuntu):
status: New → Triaged
importance: Undecided → High
David Planella (dpm)
Changed in ubuntu-translations:
status: New → Fix Released
Martin Pitt (pitti)
Changed in cdbs (Ubuntu):
assignee: Martin Pitt (pitti) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.