delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/03/26/07:42:55

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: /etc/alternatives was RE: [Re: GCC 4 installation problem]
Date: Thu, 26 Mar 2009 12:42:19 -0000
Message-ID: <5E25AF06EFB9EA4A87C19BC98F5C875302E759AB@core-email.int.ascribe.com>
In-Reply-To: <49CA90D2.9080809@gmail.com>
References: <49CA8243 DOT 2090908 AT encelade DOT com> <49CA90D2 DOT 9080809 AT gmail DOT com>
From: "Phil Betts" <Phil DOT Betts AT ascribe DOT com>
To: <cygwin AT cygwin DOT com>
Reply-To: <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Dave Korn wrote:
>   Sounds more to me like you forgot to use the alternatives program to
> configure the alternatives and have been messing around manually in
its
> private data directories and broken it.
>=20
>   (You're not the first person to do this.  For some reason it seems
to
> be a hard-to-resist temptation for people to just dive into the data
> directories and start tampering, rather than say reading the=20
> alternatives readme or man/info page which would explain the
easy-to-use
> command-line syntax by which alternatives.exe will switch over the=20
> symlinks correctly.)

I see two problems here:

1) Unless you already know that /etc/alternatives is a 'managed'=20
directory, there's nothing to suggest that there's any tool associated=20
with it, and certainly nothing to suggest that there's an associated=20
database.

2) It's so easy to manually change the links that it's unlikely anyone=20
is going to spend time looking for some (possibly non-existent) tool to=20
do it.  By the time you've found the right tool, you could have changed=20
the link and got on with whatever you were trying to do in the first=20
place.

When the directory first appeared on Linux, I thought the links were
just set up manually.  It took me a while to discover that they were
managed, and that was only by digging around in RPMs for post-install
scripts to find out what kept changing my X desktop manager after an
update.

For the first problem, I think it would help avoid installation problems
if the directory contained a simple README file explaining how to=20
properly maintain the links, and why manually changing them is a bad=20
idea.  To avoid looking like just another link, and thus getting=20
overlooked, I think this should be a real file, rather than a symlink=20
to the README in the doc directory.  Maybe Chuck could add this to the=20
cygwin alternatives package, or perhaps he would prefer the upstream=20
chkconfig maintainer to consider it.

For the second problem, perhaps it would also help if the names of the=20
links in the alternatives directory were a hash of the program name.
E.g.
 /usr/bin/gs -> /etc/alternatives/9ad6a289eea9c92be09d3a5a8bc737e6
 /etc/alternatives/9ad6a289eea9c92be09d3a5a8bc737e6 -> /usr/bin/gs-x11
where 9ad6a289eea9c92be09d3a5a8bc737e6 is the md5sum of "/usr/bin/gs".
This would make it much more obvious that the links were managed, or=20
at least give one pause for thought before diving in.


Phil

This email has been scanned by Ascribe PLC using Microsoft Antigen for Exch=
ange.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019