Bug 960501 - lsb_release returns wrong release number if lsb is installed
Summary: lsb_release returns wrong release number if lsb is installed
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal with 1 vote (vote)
Target Milestone: ---
Assignee: Ruediger Oertel
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-03 19:57 UTC by Antoine Belvire
Modified: 2017-08-21 10:00 UTC (History)
6 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Belvire 2016-01-03 19:57:25 UTC
If the lsb package is installed, the lsb_release command returns wrong release number.

lsb is not rebuilt for each snapshot?

Steps to reproduce:
1. Install the 'lsb' package
2. Run 'lsb_release -r'

Expected results: the actual release number ('Release:	20151229')

Actual results: 'Release:	20151124'
Comment 1 Thorsten Kukuk 2016-01-20 09:13:50 UTC
(In reply to Antoine Belvire from comment #0)
> If the lsb package is installed, the lsb_release command returns wrong
> release number.
> 
> lsb is not rebuilt for each snapshot?

Of course not, lsb_release does not contain any hardcoded informations, this is all read from a configuration file (/etc/os-release in this case).

> Steps to reproduce:
> 1. Install the 'lsb' package
> 2. Run 'lsb_release -r'
> 
> Expected results: the actual release number ('Release:	20151229')
> 
> Actual results: 'Release:	20151124'

So your /etc/os-release has the wrong release number and did not got updated.
Comment 2 Antoine Belvire 2016-01-20 16:06:59 UTC
> So your /etc/os-release has the wrong release number and did not got updated.

Of course not :)

The lsb package contains the /etc/lsb-release file:

> antoine@antoine-laptop:~> 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_ID="openSUSE"
> DISTRIB_RELEASE="20151124"
> DISTRIB_CODENAME="Tumbleweed"
> DISTRIB_DESCRIPTION="openSUSE Tumbleweed (20151124) (x86_64)"
> antoine@antoine-laptop:~>

And the /usr/bin/lsb_release script (owned by the lsb-release package) checks this /etc/lsb-release file *before* /etc/os-release:
> antoine@antoine-laptop:~> cat /etc/os-release 
> NAME=openSUSE
> VERSION="Tumbleweed"
> VERSION_ID="20160116"
> PRETTY_NAME="openSUSE Tumbleweed (20160116) (x86_64)"
> ID=opensuse
> ANSI_COLOR="0;32"
> CPE_NAME="cpe:/o:opensuse:opensuse:20160116"
> BUG_REPORT_URL="https://bugs.opensuse.org"
> HOME_URL="https://www.opensuse.org/"
> ID_LIKE="suse"
> antoine@antoine-laptop:~>

So if you have /etc/lsb-release (lsb package), /etc/os-release is ignored by the /usr/bin/lsb_release (lsb-release package).

Clearing needinfo.
Comment 3 Shyukri Shyukriev 2017-08-07 18:18:25 UTC
What exactly needs to be fixed for this one?

1.5y later this is again the same situation:

➜  ~  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_ID="openSUSE Tumbleweed"                                                                                                                      
DISTRIB_RELEASE="20170712"                                                                                                                            
DISTRIB_CODENAME=""                                                                                                                                   
DISTRIB_DESCRIPTION="openSUSE Tumbleweed"                                                                                                             

➜  ~  cat /etc/os-release                                                                                                                             
NAME="openSUSE Tumbleweed"           
# VERSION="20170804"                 
ID=opensuse                          
ID_LIKE="suse"                       
VERSION_ID="20170804"                
PRETTY_NAME="openSUSE Tumbleweed"    
ANSI_COLOR="0;32"                    
CPE_NAME="cpe:/o:opensuse:tumbleweed:20170804"                             
BUG_REPORT_URL="https://bugs.opensuse.org"                                 
HOME_URL="https://www.opensuse.org/" 

➜  ~  zypper info lsb-release 
Information for package lsb-release: 
------------------------------------ 
Repository     : openSUSE:Factory    
Name           : lsb-release         
Version        : 2.0-27.1            
...                                                              

➜  ~  sudo zypper rm lsb-release                                                                                               
Loading repository data...      
Reading installed packages...   
Resolving package dependencies...                               

The following application is going to be REMOVED:               
  "GNOME System Monitor"        

The following 5 packages are going to be REMOVED:               
  gnome-system-monitor gnome-system-monitor-lang lsb lsb-release mumble                                                         

5 packages to remove.           
After the operation, 8.8 MiB will be freed.
Comment 4 Antoine Belvire 2017-08-07 20:23:31 UTC
For example:

- Rebuild lsb package for each snapshot: Such information of lsb are just read from /etc/os-release at compile time… /etc/os-release belongs to openSUSE-release but the "BuildRequires:  openSUSE-release" does not trigger the rebuild here.

- Do not fill lsb package with information that are in /etc/os-release, let /usr/bin/lsb_release script read them from /etc/os-release at runtime.

- Make distribution info (/etc/os-release) take precedence over LSB info (/etc/lsb-release) in /usr/bin/lsb_release script.

- What else?
Comment 5 Antoine Belvire 2017-08-08 08:29:39 UTC
Adding people that contributed to the lsb package and in particular in https://build.opensuse.org/request/show/345047.
Comment 6 Marcus Meissner 2017-08-08 11:55:33 UTC
the rebuilds in openSUSE:Factory are triggered manually, perhaps it can be made indirect dependency of whatever does the snapshot triggers.

cc dimstar.

for lsb_release reading it directly.... would be a fix in the lsb package
Comment 7 Thorsten Kukuk 2017-08-15 07:42:55 UTC
This works everywhere else except on Tumbleweed, because somebody broke it explicit on and only on Tumbleweed in November 2015 by duplicating the fields from /etc/os-release to /etc/lsb-release. This change is nowhere else.

I have this now reverted.
Comment 8 Bernhard Wiedemann 2017-08-21 10:00:44 UTC
This is an autogenerated message for OBS integration:
This bug (960501) was mentioned in
https://build.opensuse.org/request/show/517872 Factory / lsb