ArchThis Forum is for the discussion of Arch Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
Last edited by ruario; 04-07-2013 at 04:51 AM.
Reason: added more information
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:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.