Could someone please tell me?
It will return the release number of the distro you had installed before upgrading to Tumbleweed e.g. typically 11.4 or 12.1
Really? What’s the output of lsb_release -a? Same as that (for example):
$ lsb_release -a
LSB Version: core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64:desktop-4.0-amd64:desktop-4.0-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch
Distributor ID: SUSE LINUX
Description: openSUSE 12.1 (x86_64)
Release: 12.1
Codename: Asparagus
That doesn’t seem right.
According to my interpretation, your underlying distro is 12.1. Is that right? Have I misinterpreted something?
This output is from 12.1. I don’t have Tumbleweed at all. I need a way to determine on which distros (or releases) scripts are running. lsb_release serves this purpose on LSB compliant distros (an others as well). My point is that if its output on Tumbleweed looks like the one I posted, it wouldn’t provide any indication about the system. Something has to be different, like the codename (lsb_release -sc)
More precisely atiupgrade uses a variable called LastSupportedSUSE to pass the release number to the ATI installer. Currently it is set to 121 (12.1). It needs this info to build the rpm package. I have been wondering why it worked under Tumbleweed. Now that you told me that lsb_release -sr returns 12.1 (or a smaller value), I understand. Though I think that it should return “rolling” on Tumbleweed (like on ArchLinux).
On Wed, 11 Apr 2012 02:26:02 +0000, please try again wrote:
> swerdna;2455267 Wrote:
>> According to my interpretation, your underlying distro is 12.1. Is that
>> right? Have I misinterpreted something?
>
> This output is from 12.1. I don’t have Tumbleweed at all. I need a way
> to determine on which distros (or releases) scripts are running.
Why, what are you trying to do? You should look at package versions if
you really need to care about if you are running on Tumbleweed or not.
> lsb_release serves this purpose on LSB compliant distros (an others as
> well). My point is that if its output on Tumbleweed looks like the one I
> posted, it wouldn’t provide any indication about the system. Something
> has to be different, like the codename (lsb_release -sc)
Nope, not for Tumbleweed, sorry.
> More precisely atiupgrade uses a variable called LastSupportedSUSE to
> pass the release number to the ATI installer. Currently it is set to 121
> (12.1). It needs this info to build the rpm package. I have been
> wondering why it worked under Tumbleweed. Now that you told me that
> lsb_release -sr returns 12.1 (or a smaller value), I understand. Though
> I think that it should return “rolling” on Tumbleweed (like on
> ArchLinux).
What you really need to know here is the kernel version, and maybe xorg,
and you can get those from rpm. That is the safe way to ensure you are
doing the correct thing, don’t rely on the base-distro-version to give
you what you need to know.
Hope this helps,
greg k-h
On Tumbleweed:
glosscomputer@laptop:~> lsb_release -sr
12.1
glosscomputer@laptop:~>
Then it’s a bug and needs to be fixed. The codename was fixed in openSUSE since Celadon. It returned an emply string before.
If I care about the kernel version, I’ll check the kernel version. This is the distro and the release I care about. One should be able to use a test like this one without worrying about the kernel version or querying the installed packages:
case $(lsb_release -si) in
"SUSE LINUX")
do something ...
case $(lsb_release -sr) in
11.4) do something ;;
12.1)do something ;;
**rolling**) echo "This is Tumbleweed" ;;
esac
;;
Fedora)
do something...
;;
archlinux)
do something ..
;;
etc
esac
Thank you. It answers my question and tells me how to handle this case … but it should not return this number, IMO.
In the meantime, may I suggest adding these two lines (in red below) in /etc/lsb-release on Tumbleweed?
$ cat /etc/lsb-release
LSB_VERSION="core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64"
DISTRIB_CODENAME=Tumbleweed
DISTRIB_RELEASE=rolling
$ lsb_release -sc
Tumbleweed
$ lsb_release -sr
rolling
That would provide an easy way to identify Tumbleweed in scripts.