pkgstripfiles: md5sum incorrect when doc dir is a symlink

Bug #923430 reported by Felix Geyer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pkgbinarymangler (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

pkgstripfiles doesn't update the md5sum if /usr/share/doc/$pkg is a symlink to another dir inside the same pacakge.

For example in perl-base contains the following files:
-rw-r--r-- root/root 163 2011-11-28 20:05 ./usr/share/doc/perl/Documentation
-rw-r--r-- root/root 1483 2011-11-28 20:05 ./usr/share/doc/perl/README.Debian
-rw-r--r-- root/root 87099 2011-11-28 20:05 ./usr/share/doc/perl/copyright
-rw-r--r-- root/root 19009 2011-09-26 09:44 ./usr/share/doc/perl/AUTHORS.gz
-rw-r--r-- root/root 3329 2011-12-16 12:38 ./usr/share/doc/perl/changelog.Debian.gz
lrwxrwxrwx root/root 0 2011-12-16 12:38 ./usr/share/doc/perl-base -> perl

pkgstripfiles reports:
> pkgstripfiles: Truncating usr/share/doc/perl-base/changelog.Debian.gz to topmost ten records

So it modifies usr/share/doc/perl-base/changelog.Debian.gz which really is usr/share/doc/perl/changelog.Debian.gz and thus tries to update the wrong file in md5sums.

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

I have some really hard trouble reproducing this in a small test case, or even understanding how this could possibly hit with perl. The doc/perl-base -> perl symlink wouldn't even be valid in a debian/perl-base/ build tree, as it cannot be resolved. pkgstripfiles just ignores invalid symlinks.

But I'm fairly convinced that this specific instance is a perl specific problem. It does some really nasty manual shell hacks to install documentation (no debhelper at all), and I added a test case with a similar scenario which it handles just fine.

Changed in pkgbinarymangler (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

I finally know why -- perl-base actually *does* ship /usr/share/doc/perl/ bits!

Changed in pkgbinarymangler (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
status: Triaged → In Progress
Martin Pitt (pitti)
Changed in pkgbinarymangler (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pkgbinarymangler - 114

---------------
pkgbinarymangler (114) precise; urgency=low

  [ Felix Geyer ]
  * pkgstripfiles, symlink_doc(): Don't create symlinks that would point to
    the same package. (LP: #923343)
  * test/run: Add test_doc_symlink_dependency_cycle() to make sure that
    pkgstripfiles works correctly when there is a dependency cycle inside
    a source package.

  [ Martin Pitt ]
  * pkgstripfiles: Always update md5sum even if advpng fails. Also call advpng
    if optipng fails, to at least get some optimization. Thanks Felix Geyer!
    (LP: #923407)
  * pkgstripfiles: Do not truncate changelogs when they are in a different
    directory pointed to a symlink. Add corresponding test case which mimics
    the perl hack that it applies to its doc files. (LP: #923430)
 -- Martin Pitt <email address hidden> Fri, 03 Feb 2012 06:36:35 +0100

Changed in pkgbinarymangler (Ubuntu):
status: Fix Committed → Fix Released
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.