assistance with ubuntu-docs bug

Max Bowsher maxb at f2s.com
Wed Apr 1 23:47:28 BST 2009


Steve Langasek wrote:
> On Mon, Mar 30, 2009 at 10:32:54AM +0300, Lars Wirzenius wrote:
>> ma, 2009-03-30 kello 08:10 +0100, Matthew East kirjoitti:
>>> So we need something in the package maintainer scripts which will
>>> remove the symlink and permit the package to install the relevant
>>> files in its place. The relevant commands have been posted in comment
>>> 15 on the bug, but I don't know how to include these in the package.
>>> Is someone able to help?
> 
>> Let's see if I remember all this correctly, it's been a while since I
>> did anything substantial with maintainer scripts.
> 
>> You need a preinst script to remove /usr/share/gnome/help/libs, if it is
>> a symlink, and the package is being upgraded. Create
>> debian/ubuntu-docs.preinst, with something like the following content:
> 
> The problem is the opposite in this case; it was a directory before, now
> it's a symlink.  The principle is the same, but in that case you would
> ideally do the removal in the postinst because it preserves certain unwind
> scenarios (Debian policy 6.6).
> 
> postinst:
> 
> ---- 8< ----
> #!/bin/sh
> 
> set -e
> 
> link=/usr/share/gnome/help/libs
> if [ -d "$link" ] && ! [ -L "$link" ] && [ "$1" = configure ] \
>    && dpkg --compare-versions "$2" lt-nl <version-which-fixes-this>
> then
> 	rmdir "$link"
> 	ln -s ../../ubuntu-docs/libs "$link"
> fi
> 
> #DEBHELPER#
> 
> ---- 8< ----
> 
> Another benefit of doing this in the postinst is that if something else has
> added files under /usr/share/gnome/help/libs without talking to you, the
> maintainer script will abort instead of silently rm -r'ing the files.

I understand the general purpose of using dpkg --compare-versions for
selectively applying broken-version fixups.

However, as a point of interest, in this specific case, is there any
reason to use a version comparison?

If the package shipping the postinst ships a symlink, and is being
configured, would it ever be undesired to replace an existing empty
directory with the shipped symlink?

For that matter, would it make sense to suggest to upstream dpkg to
adopt this behaviour in the general case?

Thanks,
Max.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/ubuntu-devel/attachments/20090401/608963ad/attachment.pgp 


More information about the ubuntu-devel mailing list