[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Sorting out the xdvi.bin problem



On Tue, 10 Jul 2001, Julian Gilbey wrote:

> On Mon, Jul 09, 2001 at 02:17:21PM +0200, Christoph Martin wrote:
> > Julian Gilbey writes:
> >  > I haven't been keeping track of this list for the last couple of
> >  > weeks, but I know that this problem keeps rearing its head for
> >  > people.  I just noticed it on my machine: the xdvi.bin link is in
> >  > manual mode, but /usr/bin/xdvi.bin doesn't actually exist.  Perhaps
> >  > the postinst could do something like the following:
> >  >
> >  > if [ ! -L /usr/bin/xdvi.bin ]; then
> >  >     update-alternatives --auto xdvi.bin
> >  > fi
> >  >
> >
> > I think this solution is really the best one. We can keep
> > update-alternatives. The only drawback is that someone might have
> > switched to manual mode on purpose and this would change it back.
>
> That's why the test for the *presence* of xdvi.bin; this would still
> be a problem even if they had changed to manual.

It checks for the existance of xdvi.bin - but you gain nothing when it's a
dangling symlink.

My solution is to check whether it does currently point to anything in
/usr/X11R6/bin and if yes switch to auto mode:

# remove the manual setting of the xdvi alternatives when
# they point to the obsolete location in /usr/X11R6/bin
update-alternatives --display xdvi.bin | grep "points to" | \
  grep X11R6 >/dev/null && update-alternatives --auto xdvi.bin  || true
update-alternatives --display oxdvi.bin | grep "points to" | \
  grep X11R6 >/dev/null &&  update-alternatives --auto oxdvi.bin || true


>    Julian

cu
Adrian

-- 

Get my GPG key: finger bunk@debian.org | gpg --import

Fingerprint: B29C E71E FE19 6755 5C8A  84D4 99FC EA98 4F12 B400



Reply to: