LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Arch (https://www.linuxquestions.org/questions/arch-29/)
-   -   lsb_release -r output on Arch Linux (https://www.linuxquestions.org/questions/arch-29/lsb_release-r-output-on-arch-linux-4175457199/)

catkin 04-07-2013 02:29 AM

lsb_release -r output on Arch Linux
 
This looks like a very quiet forum, presumably the Arch Linux people are somewhere else but this is such a simple question I'll give it a try.

What does the output of lsb_release -r look like on Arch?

The reason for wanting to know is that I'm trying to build ubuntuone-client on Slackware and the only Linux other than Ubuntu that has a build is Arch. In the build scripts there's this code, used unmodified in the Arch build
Code:

if [ -n "$(lsb_release -r | grep -v '1[2-9].[0-9][0-9]')" ]; then
    REACTOR="glib";
else
    REACTOR="gi"
fi

I would like to know what REACTOR (for Python twisted?) would be set to on Arch.

ruario 04-07-2013 04:06 AM

Arch does not have lsb_release installed by default. Looking at this thread I suspect release to say 'rolling'.

By the way I would not use lsb_release for finding out distro information. Very few distros actually install it be default. However recent versions of just about every distro have the /etc/os-release file, e.g. Arch, Debian (in Sid, I have not checked older version), Fedora, Gentoo, OpenSUSE, Mageia, Slackware, Ubuntu, etc. /etc/os-release gained the traction that lsb_release failed to do. It is the best method of doing distro detection going forward.

syg00 04-07-2013 04:21 AM

Quote:

Originally Posted by ruario (Post 4926727)
... /etc/os-release gained the traction that lsb_release failed to do.

I wonder why.

ruario 04-07-2013 04:46 AM

From the /etc/os-release FAQ (included on the page that announced /etc/os-release):

Quote:

There's already the lsb_release tool for this, why don't you just use that? Well, it's a very strange interface: a shell script you have to invoke (and hence spawn asynchronously from your C code), and it's not written to be extensible. It's an optional package in many distributions, and nothing we'd be happy to invoke as part of early boot in order to show a welcome message. (In times with sub-second userspace boot times we really don't want to invoke a huge shell script for a triviality like showing the welcome message). The lsb_release tool to us appears to be an attempt of abstracting distribution checks, where standardization of distribution checks is needed. It's simply a badly designed interface. In our opinion, it has its use as an interface to determine the LSB version itself, but not for checking the distribution or version.
Note: There is a text file /etc/lsb_release on some distros but the specification for lsb_release does not mandate the format for this file so it is unreliable to read it directy.

The second part of that FAQ answer gives you another reason. Systemd expects to find the file and reads it. Many distros have switched to systemd as their default system startup daemon and several of those that have not either provide systemd as an option or have experimented with it.

catkin 04-07-2013 05:13 AM

Quote:

Originally Posted by ruario (Post 4926727)
Arch does not have lsb_release installed by default. Looking at this thread I suspect release to say 'rolling'.

By the way I would not use lsb_release for finding out distro information. Very few distros actually install it be default. However recent versions of just about every distro have the /etc/os-release file, e.g. Arch, Debian (in Sid, I have not checked older version), Fedora, Gentoo, OpenSUSE, Mageia, Slackware, Ubuntu, etc. /etc/os-release gained the traction that lsb_release failed to do. It is the best method of doing distro detection going forward.

Thanks ruario :)

Exactly the info I was looking for. So when that build script runs on Arch the effect depends on whether lsb_release is installed. If it isn't (default, same as Slackware) nothing is written to stderr and <whatever> in [ -n <whatever> ] is empty so REACTOR is set to glib. If lsb_release is installed, the <whatever> is "rolling" and REACTOR is set to gi. Not safe!

Yes -- lsb_release is not the best choice of tool for the difficult task of determining distro info. UbuntuOne is, er, an Ubuntu-based product so the build developers probably used whatever worked for them. The only packages listed on https://one.ubuntu.com/downloads/ are for Windows, Mac, Ubuntu, Android and "iPhone & iPad". Sheesh! Are these people part of the Linux-sphere?!

FYI the Slackware64 14.0 /etc/os-release looks like this:
Code:

NAME=Slackware
VERSION="14.0"
ID=slackware
VERSION_ID=14.0
PRETTY_NAME="Slackware 14.0"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:slackware:slackware_linux:14.0"
HOME_URL="http://slackware.com/"
SUPPORT_URL="http://www.linuxquestions.org/questions/slackware-14/"
BUG_REPORT_URL="http://www.linuxquestions.org/questions/slackware-14/"

Debian Squueze does not have /etc/os-release.

ruario 04-07-2013 06:37 AM

Quote:

Originally Posted by catkin (Post 4926762)
Debian Squueze does not have /etc/os-release.

Shame but in the future it will since Sid has it, so going forward /etc/os-release will become increasingly useful.

ruario 04-07-2013 06:39 AM

F.Y.I. details of the /etc/os-release format can be found here:

http://www.freedesktop.org/software/...s-release.html


All times are GMT -5. The time now is 12:59 AM.