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

Re: Is it a bug to call /usr/bin/X11/foo in the postinst?



Christian Schwarz <schwarz@monet.m.isar.de> wrote:

> FSSTND 1.2 _and_ FHS 2.0 reads in section 4.1 /usr/X11R6 : X Window
> System, Version 11 Release 6:

>   ``/usr/bin/X11 -> /usr/X11R6/bin
>     /usr/lib/X11 -> /usr/X11R6/lib/X11
>     /usr/include/X11 -> /usr/X11R6/include/X11

> In general, software should not be installed or managed via the above
> symbolic links.''

> Therefore, Adrian was right.

> If you disagree with FSSTND/FHS, please post a better proposal to
> either debian-policy or directly to the fhs-discuss list.

(Please don't reply to this posting with comments about X11R6.4's
licensing problems.)

This posting concerns only the bug report filed against rxvt using
/usr/bin/X11 in its postinst script.  First, I shall demonstrate that
fix provided in the bug report (using /usr/X11R6/bin) is broken.  Then,
I shall provide two possible solutions, each with its own caveat.


USING /usr/X11R6/bin IN /etc/alternatives IS BROKEN:

Consider an X program called foo -- with several possible alternative
implementations: foo1, foo2, etc. -- and observe what happens when
/usr/X11R6/bin/foo is used as the pathname for update-alternatives:

   # update-alternatives --install /usr/X11R6/bin/foo foo \
	   /usr/X11R6/bin/foo1 20
   Checking available versions of foo, updating links in /etc/alternatives ...
   (You may modify the symlinks there yourself if desired - see `man ln'.)
   Updating foo (/usr/X11R6/bin/foo) to point to /usr/X11R6/bin/foo1.

But when foo moves to X11R7, the alternatives link does not follow (unless
the priority of the link is increased, which will cause other problems):

   # update-alternatives --install /usr/X11R7/bin/foo foo \
	   /usr/X11R7/bin/foo1 20
   Checking available versions of foo, updating links in /etc/alternatives ...
   (You may modify the symlinks there yourself if desired - see `man ln'.)
   Renaming foo link from /usr/X11R6/bin/foo to /usr/X11R7/bin/foo.
   Leaving foo (/usr/X11R7/bin/foo) pointing to /usr/X11R6/bin/foo1.


POSSIBLE SOLUTIONS:

Solution 1:
Include the X version number in the name of the alternative link.

Description:
Instead of using foo as the name of the alternatives link, use X11R6-foo.
Then when foo1 moves to X11R7, the X11R6-foo alternatives link will be
removed and replaced with X11R7-foo.

Problem:
If the system administrator (the Debian user) has overridden the link, his
link in /etc/alternatives will be lost when foo moves from X11R6 to X11R7.


Solution 2:
Use /usr/bin/X11 instead of /usr/X11R6/bin/foo.

Description:
Call update-alternatives with:

   # update-alternatives --install /usr/bin/X11/foo foo \
	   /usr/bin/X11/foo1 20

This is how update-alternatives is currently called by rxvt.  Unlike
the first solution, this does not discard the system administrator's
/etc/alternatives link when foo moves to X11R7.

Problem:
The alternatives link will break if an X11R6 version of foo is installed
on an X11R7 system.


CONCLUSION:

Debian's policy makers should choose a solution to this problem and make
it a standard part of the policy.  Although it appears that any solution
that will be chosen will have some problems, these problems will be
consistent across all packages and can be documented so that Debian's
users will know what to expect.


--
To UNSUBSCRIBE, email to debian-policy-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: