In a message dated: Wed, 14 Nov 2001 16:11:25 PST
"Karl J. Runge" said:

>Hi Paul,
>
>Could you give more detail on what you are trying to do?
>
>It sounds like you are trying to write a program or script that
>is portable across the various distros (or, how dated of me, multiple
>Unixes).  That sort of portability is a GoodThing!
>
>Anyway, from your listing of the /etc/ release files it seems like
>you are on the road to an alogorithm and I just wanted to know
>what sort of problem you were currently addressing.

Basically it started out with the Kickstart server we were building 
here.  We have it set up pretty modularly such that it should work 
for any version of RH.  Then I began thinking that it would be pretty 
cool to build in the functionality to be able to, at install time, 
differentiate between desktops and clients (I used to do this with 
Solaris JumpStart).

That led me looking at a script Derek wrote which installs the proper 
autofs package on a Debian, RH, or Mandrake system.  So I started 
looking at that and realized it would be pretty neat if we could 
write some generic scripts in this style to automagically install 
various packages.  In order to make it simple, we'd need the script 
to first be able to determine which distribution the system is 
running, then which release of that distribution.

In the old days is was fairly simple with uname to determine exactly 
which vendor you were dealing with and which rev of their OS, since 
the OS name was different between vendors, and the architecture was 
also easily discernible from uname output.

But with Linux, the OS name is always 'Linux' and for the most part 
the architecture is always 'iX86'.  There's nothing in uname which 
outputs which distribution.  What we need is a 'distname' or 
something, where the usage is similar to uname, but it tells you what 
dist you're running, and what rev:

        $ distname -a
        Debian Gnu/Linux potato 2.2r4
        $distname
        Debian Gnu/Linux
        $ distname -n
        potato
        $ distname -r
        2.2r4

In general it's a simple concept.  The problem is that since there is 
no standard for placing this information anywhere, it's impossible to
make sure it works everywhere.  RH, Mandrake, and SuSE all use
/etc/<distname>_release for this information, but the format is 
different for each one:

        $ cat /etc/redhat-release 
        Red Hat Linux release 6.2 (Zoot)

        $ cat /etc/mandrake-release
        Linux Mandrake release 8.0 (Traktopel) for i586

        $ cat /etc/SuSE-release
        SuSE Linux 7.1 (i386)
        Version=7.1

And Debian has almost nothing useful in there file at all!

        $ cat /etc/debian_version 
        testing/unstable

If there were at least some standard file format where this 
information could be kept across all distributions, it would be 
trivial to write a script that did what I wanted.  I could still do 
it, and probably will (though the Debian output won't work well), but 
it's going to have an awful lot of if...then clauses in it :)

I could probably do it with perl pretty simply, but, well, this is a 
system level script, and should probably be written in sh ;)

Really, I just wanted to rant about something :)

Thanks,
-- 

Seeya,
Paul
----

                          God Bless America!

        ...we don't need to be perfect to be the best around,
                and we never stop trying to be better. 
                       Tom Clancy, The Bear and The Dragon



*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************

Reply via email to