On 04/25/2017 02:26 PM, Christian Boltz wrote:
Am Dienstag, 25. April 2017, 10:22:58 CEST schrieb Roger Oberholtzer:
I think part of the confusion (at least for me) is that there are two independent version numbering systems: one in /etc/os-release, and another in RPM macros.
It was only independent in Leap 42.x - in all previous releases, suse_version matched /etc/os-release IIRC. Well, the dot was removed and a zero added, but for a human it looked similar.
That's not true.
To begin with, there is no previous version of Leap 42. For openSUSE *was* %suse_version matching /etc/os-release. For Tumbleweed this may be still true. For SLE it's %sle_version and for Leap it's %leap_version.
All the problems only occurred because of trying to build adventurous logic into the version numbers and trying to use one version number for different products.
BTW: That's also the reason why SLE12 and Leap 42.2 have that strange 1315 suse_version - SLE12 was branched off between openSUSE 13.1 and 13.2.
/etc/-os-release has increased with a big gap (13.3 -> 42.1) and will perhaps now go backwards (42.2 -> 15.1). Everything outside of
The first Leap 15 release will be 15.0 (as in "based on pure SLE 15, no service pack yet"), not 15.1 (as in SLE 15 SP1).
When Leap was "invented", it started with SLE 12 SP1, therefore Leap 42.1.
Oh, and 13.3 never existed - the release before Leap 42.1 was 13.2.
So even without the 42.x -> 15.x leap (pun intended), it seems version numbers are already confusing ;-) I know switching to 15.x adds slightly more confusion now, but on the long term it's much better to have SLE, Leap and suse_version in sync than always having to do the "+ 30" math for the Leap version.
RPM/zypper is potentially messed up. This includes Makefiles, shell scripts, and probably most things outside RPM/zypper. It is this type of stuff that I am most concerned about.
OOC, is there any reliable way outside RPM to get access to the version that RPM would use? Something other than /etc/os-release?
Not as a plain file AFAIK , but it's easy to query it:
# rpm --eval '%suse_version' 1330
This should also make it obvious that I'm writing this mail on Tumbleweed ;-)
 In theory you could parse /usr/lib/rpm/suse_macros, but you'll have fun[tm] doing it. The rpm --eval way is much easier.