SCIENTIFIC-LINUX-USERS Archives

June 2005

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Morten Kjeldgaard <[log in to unmask]>
Reply To:
Morten Kjeldgaard <[log in to unmask]>
Date:
Thu, 23 Jun 2005 15:09:50 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (67 lines)
Troy wrote:

> OK, so we're going to do the change for sl-release 4.1, and 3.0.5. 
> And we were thinking of makeing a SL-lsb-fix (or something like that)
> for the older releases ... basically so that someone can add it or
> remove it, depending on if they have scripts depending on it or not.
> So for redhat-lsb, we also need to put the change above in?  Correct?

Yes, /etc/redhat-release and /etc/lsb-release contain basically the same
information, but are part of different packages (sl-release and
redhat-lsb, respectively). The script /usr/bin/lsb_release attempts to
read both of them to obtain the information it wants. By reading the
script and experimenting a little, I discovered that:

(a) it works correctly if the "R -> r" fix is made in 
/etc/redhat-release.

(b) /etc/lsb-release takes precedence over /etc/redhat-release if both 
are present, and the script can glean the info it needs from it.

While several of the RedHat derived distributions all have files called
"redhat-release", the standard (AFAICT) only calls for the program
/etc/lsb_release to produce the correct output. For example, the format
of /etc/lsb-release is different in Debian-based distributions (but they
are also using a later version of the LSB standard).

Check for yourself at http://www.linuxbase.org/ if you too are a 
standards-freak :-)

> Looking at redhat-lsb, I see that they don't put anything in
> /etc/lsb-release except the lsb version, so this isn't totally our
> fault. ;) But while I'm getting my fingers dirty with this ... do you
> have a script or something that generates /etc/lsb-release correctly
> from a correctly formated release file?

No, I don't have such a script, but I propose that the DISTRIB_DESC line 
contains the line:

DISTRIB_DESC="Scientific Linux SL release 4.0 (Beryllium)"

and then here is your script:

#! /bin/sh
source /etc/lsb-release
echo $DISTRIB_DESC > /etc/redhat-release

:-)

As for the rest of the information in /etc/lsb-release, you the 
maintainers of SL have to decide what you want the DISTRIB_ID to be: 
"Scientific Linux", "Scientific", "scientificlinux", "SL"... I think it 
make sense to use the same id as is used in the rpm that owns 
/etc/redhat-release = "sl-release" = "SL" (OR change the name of that 
package ("<id>-release") so the id matches).

Fascinating that something so simple can be so complicated :-)

Cheers,
Morten

-- 
Morten Kjeldgaard, Asc. professor, Ph.D.
Department of Molecular Biology, Aarhus University
Gustav Wieds Vej 10 C, DK-8000 Aarhus C, Denmark
Lab +45 89425026 * Mobile +45 51860147 * Fax +45 86123178
Home +45 86188180 * ICQ 27224900 * http://www.bioxray.dk/~mok

ATOM RSS1 RSS2