Add xz-lzma back, using update-alternatives
commit578df4d0936eb5bc6770be60f57ac6cd295b654b
authorJonathan Nieder <jrnieder@gmail.com>
Thu, 27 Aug 2009 07:12:00 +0000 (27 02:12 -0500)
committerJonathan Nieder <jrnieder@gmail.com>
Thu, 27 Aug 2009 07:26:21 +0000 (27 02:26 -0500)
tree7d82049c90967477bf64a57fa7d695d48ddf701a
parent6b1669263de94291e63734a028937bf53c8e24a4
Add xz-lzma back, using update-alternatives

With update-alternatives, xz-lzma and lzma can be installed at
the same time, and switching between them in the presence of
dpkg’s lzma pre-dependency is no longer a problem.

xz-lzma is considered a “worse” alternative than lzma to provide
the lzma, unlzma, and lzcat commands, since if a user has the
lzma package installed, it is for the sake of those commands.

Consider what happens when installing xz-lzma with lzma already
installed:

1. “dpkg --unpack xz-utils” makes the xz command available in
   /usr/bin.  The lzmp binary and lzma symlink from the lzma
   package are untouched.
2. “dpkg --install libc6” upgrades libc to satisfy xz-lzma’s
   pre-dependency.
3. “dpkg --unpack xz-lzma” makes various lzma-related commands
   available in /usr/bin, but the lzma symlink is untouched.
4. “dpkg --configure xz-utils” does nothing of interest.
5. “dpkg --configure xz-lzma” adds alternatives for the lzma,
   unlzma, and lzcat commands, but since the lzma package provides
   better alternatives, the lzma symlink is still untouched.

Afterwards, if the lzma package is deconfigured or removed, the
lzma symlink changes to point to /usr/bin/xz.  At no point is
/usr/bin/lzma missing or pointing nowhere; dpkg’s pre-dependency
is satisfied.

Thanks to adn for the idea.
debian/.gitignore
debian/changelog
debian/control
debian/xz-lzma.dirs [new file with mode: 0644]
debian/xz-lzma.install [new file with mode: 0644]
debian/xz-lzma.links [new file with mode: 0644]
debian/xz-lzma.postinst [new file with mode: 0644]
debian/xz-lzma.prerm [new file with mode: 0644]