LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Arch
User Name
Password
Arch This Forum is for the discussion of Arch Linux.

Notices


Reply
  Search this Thread
Old 04-07-2013, 02:29 AM   #1
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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.
 
Old 04-07-2013, 04:06 AM   #2
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
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.
 
1 members found this post helpful.
Old 04-07-2013, 04:21 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by ruario View Post
... /etc/os-release gained the traction that lsb_release failed to do.
I wonder why.
 
Old 04-07-2013, 04:46 AM   #4
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
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.

Last edited by ruario; 04-07-2013 at 04:51 AM. Reason: added more information
 
Old 04-07-2013, 05:13 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by ruario View Post
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.
 
Old 04-07-2013, 06:37 AM   #6
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by catkin View Post
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.
 
Old 04-07-2013, 06:39 AM   #7
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

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

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Arch BSD: Arch Linux Atop The FreeBSD Kernel LXer Syndicated Linux News 0 01-24-2013 03:20 PM
Arch Linux Installation Problems - arch-chroot, Grub2 Ronky Linux - Newbie 3 01-08-2013 05:22 PM
Arch user wanted to help padawan learner install arch and use it thomas-linuxing Linux - Software 9 10-18-2006 04:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Arch

All times are GMT -5. The time now is 01:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration