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

Re: shouldn't I use update-alternatives for this?



On Wed, Aug 10, 2005 at 10:09:44PM -0600, Sebastian Kuzminsky wrote:
> So, I'm proposing this:
> 
>     GNU Interactive Tools installs /usr/bin/git.shell (or something)
> 
>     Cogito installs /usr/bin/git.scm (or something)
> 
>     update-alternatives is used to make one of those appear as
>     /usr/bin/git

As I understand it, update-alternatives is used for programs providing
similar functions, this is not the case for /usr/bin/git.

Please consider Debian as a multiuser OS, what should the admin do if
half the user want git the scm, and the other half want GNU Interactive
Tools?

I suggest dpkg-divert /usr/bin/git, and install a shell script as
/usr/bin/git, which will invoke either program depending on a certain
environment variable[1] or a configuration file.  It is possible to achieve
the following objectives.

(1) Installing cogito will not change the meaning of /usr/bin/git by
default;

(2) System admin can decide a default preference of /usr/bin/git,
through e.g. /etc/git.rc;

(3) Each user can choose her/his own preference by e.g. ~/.gitrc;

(4) cogito on Debian works the same as on other systems.

Of course, whatever configuration files or environment variables used
should be agreed by both package maintainers.

[1] I understand environment variable is not the recommended way to
configure Debian packages.  However, it can be used as a shortcut to
avoid reading any configuration files.

Regards,
Qingning



Reply to: