Re: xdvi alternatives
Norbert Preining <preining@logic.at> wrote:
> 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.
Yes, and it's the variant I forgot about. One idea I had that
update-alternatives might display a setting as manual if it used to be
auto, but the link target is missing. But that's not true (I tried it
out).
The cause of this bug is that in tetex-bin's prerm script, there's a
(handcrafted, no dh_...) call to update-alternatives --remove *except*
when upgrading.
I think that from this we can say
- that it should be safe to do the fix in tetex-bin_2007's
preinst,
- and (I think) that if the setting is "manual", it's either been done
by the local admin, or there's a bug in update-alternatives
On the other hand,
- we already have the code in texlive-base-bin's maintainer scripts
- at least two users have reported the manual setting, so it might be
worth catering for this.
> 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
s/code/alternative/
> # 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?
+> # can this happen? It seems so, see #419381 and siblings
The logic itself looks okay to me. Maybe we should inform the dpkg
maintainers about this "manual" thing.
Regards, Frank
--
Dr. Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX/TeXLive)
Reply to: