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

Re: Is there a way to positively, uniquely identify which Debian release a program is running on?



Hi,

I once wrote a small python utility called udist that tries to work out which distribution it runs on. It works on several RPM based distributions, as well as the Debian based distros I've tested. I originally had in mind putting the project on a public server and involving more people to test and implement more distros but I never got around to it.

The utility makes use of different strategies when attempting to fill out the different fields. It can use LSB but can also carry on with out it as in the example below.

This is the kind of output I get on my Ubuntu machine:

[mok@sebulpa udist]$ bin/udist
No LSB modules are available.
id:ubuntu
name:Ubuntu
codename:feisty
desc:Ubuntu 7.04
rel:7.04
rel_major:7
family:debian
sfam:ubuntu
reltag:ubuntu7
processor:
machine:i686
arch:i386

... and this is from a CentOS machine:

[mok@ghost ~]$ udist
id:centos
name:CentOS
codename:Final
desc:CentOS release 4.4 (Final)
rel:4.4
rel_major:4
family:redhat
sfam:rhel
reltag:el4
processor:athlon
machine:i686
arch:i386

By using switches (a la uname) you can output specific fields. I've put a .tar.gz file here: ftp://ftp.bioxray.dk:/pub/mok/src/udist-0.5.tar.gz if you're interested.

I anyone wants to join in and extend/rewrite/improve this utility, let me know.

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 * http://www.bioxray.dk/~mok



Reply to: