Am 25.08.2006 um 17:49 schrieb Chuan-kai Lin:
On Fri, Aug 25, 2006 at 09:05:26AM +0200, Sven Joachim wrote:
You are trying to fix #383971, but this is _not_ the way to do it!
I agree that the current approach is quite awful.
If the user had set the `yacc' alternative to manual, the preinst
script breaks that. A better way to do this would be to test first
if the system is actually affected by #383971, which should only be
the case if /usr/bin/yacc is not a symlink:
[ -L /usr/bin/yacc ] || update-alternatives --auto yacc
Looks good. But what if /usr/bin/yacc is an admin-installed script?
This does not need to be supported, IMHO. Admins are expected not to
install software under /usr, that's what /usr/local is for. But there
are other, more serious problems anyway, as I just noticed ...
I propose the following variety:
[ -e /usr/bin/yacc ] || update-alternatives --auto yacc
If we are upgrading from 2.3.dfsg-2, by the time the preinst script
runs, the /usr/bin/yacc script installed by -2 should have already been
removed, so the update-alternatives command would still run.
Err, I don't understand that. The faulty version (that with the
/usr/bin/yacc script) was 2.3.dfsg-1, not -2. And by the time the
preinst runs, the script is _not_ yet removed, AFICS. This happens
only later, during unpacking; see section 6.6 of the Policy Manual for
details. Especially the following sentence from there should ring
the alarm bell:
6. Any files which were in the old version of the package but not in
the new are removed.
You see? Upgrading from 2.3.dfsg-1 leaves you without /usr/bin/yacc
after unpacking, there is nothing you can do about that in the preinst.
So you have to deal with that in the postinst, rather. I propose the
following solution:
- Remove the call to update-alternatives from the preinst
- Put your fix in the postinst, after the call to
update-alternatives --install:
[...]
case "$1" in
configure|abort-remove|abort-deconfigure)
update-alternatives --install /usr/bin/yacc yacc \
/usr/bin/bison.yacc 100 \
--slave /usr/share/man/man1/yacc.1.gz yaccman \
/usr/share/man/man1/bison.1.gz
[ -e /usr/bin/yacc ] || update-alternatives --auto yacc
;;
[...]
That should (well, hopefully ;-) ) clean up the mess.
Kind regards,
Sven
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]