On 2012-10-10 17:55, Peter Samuelson wrote:
> 
> [Andreas Beckmann]
>> A test with piuparts revealed that your package misses the copyright
>> file after an upgrade from squeeze to wheezy, which is a violation of
>> Policy 12.5 :
> 
> Thanks - yeah, looks like a dpkg bug: during the upgrade, the old
> /usr/share/doc/$pkg directory disappears, but dpkg forgets to remove it
> before unpacking the new package, where /usr/share/doc/$pkg is a
> symlink; therefore it fails to add the symlink.

I don't think it works that way. The old package is not removed before
the new package gets unpacked, so the filesystem object at
/usr/share/doc/$pkg never disappears.
http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#s-unpackphase

> Of course dpkg should be careful when replacing symlinks with
> directories, because it's possible for a local admin to replace a
> directory with a symlink for filesystem layout reasons.  But this is
> the opposite case, and dpkg certainly has enough information to know it
> is safe.

No, dpkg has not enough information about what was a symlink or
directory in the package. This will probably change with 1.17.x as
Guillem plans to extend the metadata stored in the dpkg database.

> I'm guessing this dpkg bug hits a lot more packages than just mine.
> Do you know if it is expected to be fixed soon, or do I need to work
> around it?

This is not an easy fix. And your package needs to be processable with
old versions of dpkg (unless you add a pre-depends on a future dpkg
version, which would stop backportability).

This has hit a lot of packages:
http://piuparts.debian.org/squeeze2wheezy/unknown_failures.html
Nearly everything in in "bugged" state with a bug number of #68[78]xxx
should be such a problem (and that does no longer include the already
fixed ones). There was also some discussion on debian-devel@ in September

So for going from directory to a link you will need to add a postinst
script that does something like this

if [ "$1" = configure ]; then
if dpkg --compare-versions "$2" -lt FIXEDVERSION~ ; then
if [ ! -l /u/s/d/$pkg ] && [ -d /u/s/d/$pkg ]; then
rmdir /u/s/d/$pkg  # bombs if not empty
ln -s $target /u/s/d/$pkg
fi
fi
fi

But this way is much easier to solve than recovering from a improper
link-to-dir switch where you install files over an existing symlink and
overwrite files from another package, not noticed by dpkg.

Even if subversion 1.7 is not going into wheezy (is it?), this would
become a problem for wheezy->jessie upgrades.


Andreas


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to