[fpc-pascal] Detecting what is the linux distro

Graeme Geldenhuys graemeg.lists at gmail.com
Mon Oct 11 14:03:26 CEST 2010


On 11 October 2010 13:33, ik <idokan at gmail.com> wrote:
>
> At first I thought about /etc/issue, but it seems that some are abusing this
> file.
> Many distro's uses /etc/XXXX__release, where XXXX is their name, but it's
> not a proper way either to detect, because not everyone uses it.
>
> Any additional ideas ?


If your distro complies with the LSB standards (most popular distros
do), then you should have a /etc/lsb-release text file that you can
parse.


------------------------------------
~ $ cd /etc
etc $ ls -l lsb-release
-rw-r--r-- 1 root root 104 2010-07-08 16:55 lsb-release

etc $ cat lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.1 LTS"

------------------------------------


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net:8080/fpgui/



More information about the fpc-pascal mailing list