Re: xdvi alternatives
On Mit, 18 Apr 2007, Frank Küster wrote:
> But doesn't that mean that unless someone (our packages or the local
> admin) unregistered tetex-bin's xdvi, it will show up in the output of
> "u-a --list xdvi.bin", no matter whether the link points there or not?
> And doesn't it make sense to unregister it ("u-a --remove ...") it in
> this case?
Yes. I mixed up something.
I guess the right thing is:
1. if it shows up in --list => remove it
2. if it is in status "manual" AND points to xdvi.real => set to auto
3. if it is in status "manual" AND points somewhere else => leave
untouched
The only question is whether 2. could happen. This is what I tried to
solve.
I guess the full code would be:
if update-alternative --list xdvi.bin | grep -q xdvi.real ; then
# remove the old tetex code, should switch to auto mode automatically
# even if there are other xdvi alternatives installed (xdvi-ja)
update-alternatives --remove xdvi.bin /usr/bin/xdvi.real
else
if update-alternative --display xdvi.bin | grep -q "status is manual" ; then
if update-alternative --display xdvi.bin | grep -q "link currently points to /usr/bin/xdvi.real' ; then
# link status is manual, and we point to the tetex alternative
# can this happen?
# we switch to auto mode
update-alternatives --auto xdvi.bin
else
# xdvi.bin is in manual mode but not pointing to xdvi.real, leave
# it untouched
:
fi
fi
fi
Best wishes
Norbert
-------------------------------------------------------------------------------
Dr. Norbert Preining <preining@logic.at> Università di Siena
Debian Developer <preining@debian.org> Debian TeX Group
gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
BOTCHERBY
The principle by which British roads are signposted.
--- Douglas Adams, The Meaning of Liff
Reply to: