[opensuse-factory] /etc/-os-release on Tumbleweed
I am curious if my /etc/os-release is odd: # VERSION="20160913" ID=opensuse ID_LIKE="suse" VERSION_ID="20160913" PRETTY_NAME="openSUSE Tumbleweed" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:tumbleweed:20160913" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://www.opensuse.org/" Should the VERSION line be commented as shown above? Or has something odd happened to my file? -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wed, 2016-09-28 at 10:56 +0200, Roger Oberholtzer wrote:
I am curious if my /etc/os-release is odd:
# VERSION="20160913" ID=opensuse ID_LIKE="suse" VERSION_ID="20160913" PRETTY_NAME="openSUSE Tumbleweed" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:tumbleweed:20160913" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://www.opensuse.org/"
Should the VERSION line be commented as shown above? Or has something odd happened to my file?
That's correct... VERSION is added merely for 'your reference' but not used to interpret by tools (hence commented) This is totally fine and no reason to worry (also, VERSION is expliitly mentioned in the specs that it's not mandatory and can be skipped, especially in the context of rolling distributions). Cheers, Dominique
On Wed, Sep 28, 2016 at 11:03 AM, Dominique Leuenberger / DimStar
On Wed, 2016-09-28 at 10:56 +0200, Roger Oberholtzer wrote:
I am curious if my /etc/os-release is odd:
# VERSION="20160913" ID=opensuse ID_LIKE="suse" VERSION_ID="20160913" PRETTY_NAME="openSUSE Tumbleweed" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:tumbleweed:20160913" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://www.opensuse.org/"
Should the VERSION line be commented as shown above? Or has something odd happened to my file?
That's correct...
VERSION is added merely for 'your reference' but not used to interpret by tools (hence commented)
Okay. We use this in Makefiles via a simple "include /etc/os-release". All previous /etc/os-release and /etc/SuSE-release defined this. 42.1 changed VERSION from something like "13.1 (Bottle)" to "42.1" without the code name. But VERSION was defined. What we are trying to do is obtain things like 12.3, 13.1, 42.1, Tumbleweed. We build for multiple platforms with the results placed as based on the openSUSE release. There has to be an easier way. GNU Makefile macros are a PITA.... -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wed, Sep 28, 2016 at 12:14 PM, Roger Oberholtzer
What we are trying to do is obtain things like 12.3, 13.1, 42.1, Tumbleweed. We build for multiple platforms with the results placed as based on the openSUSE release.
Empty VERSION == Tumbleweed? :) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
In fact we have finally moved our Makefiles to using /etc/os-release,
We use VERSION_ID now instead of the defunct VERSION (commenting it
out makes it effectively defunct as it won't be defined when
/etc/os-release is used via an include or some similar mechanism).
What we have done in the relevant Makefile definition file is:
include /etc/os-release
ifeq ($(PRETTY_NAME),"openSUSE Tumbleweed")
VERSION_ID = Tumbleweed
endif
Tumbleweed is a special case for us. We don't use it in production.
But we use it to build on test systems. So we are happy to lump all
Tumbleweed into one category. Even if that is not an accurate thing to
do. It works in our context.
We'll see how long that works...
On Wed, Sep 28, 2016 at 11:36 AM, Andrei Borzenkov
On Wed, Sep 28, 2016 at 12:14 PM, Roger Oberholtzer
wrote: What we are trying to do is obtain things like 12.3, 13.1, 42.1, Tumbleweed. We build for multiple platforms with the results placed as based on the openSUSE release.
Empty VERSION == Tumbleweed? :)
-- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wednesday 2016-09-28 11:14, Roger Oberholtzer wrote:
Okay. We use this in Makefiles via a simple "include /etc/os-release".
That is totally bogus. os-release is not written in make syntax, but (a really restricted set of) sh. You will see once you have something like PRETTY_NAME='The $$$ Generating Distribution' -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Not bogus at all. It is perfect Makefile syntax
var = value
No problem. It works.
I can understand if this is not an intended or expected usage. But it
is fully functional.
It also works in bash scripts.
In Tcl scripts, I do have to have a bit of a wrapper.
# Get the suse version. If a parameter is given, the '.' in
the version us replaced with it.
proc getSUSErelease {{map .}} {
set ret "Undefined"
if {![catch {set ver [open "/etc/os-release"]} fid] } {
while {[gets $ver line] >= 0} {
if {[string compare -length 10 "$line"
"VERSION = "] == 0} {
set ret [string range "$line" 10 end]
}
}
close $ver
set ret [string map ". $map" $ret]
}
return $ret
}
Programmers. What to do with them, huh?
On Wed, Sep 28, 2016 at 3:49 PM, Jan Engelhardt
On Wednesday 2016-09-28 11:14, Roger Oberholtzer wrote:
Okay. We use this in Makefiles via a simple "include /etc/os-release".
That is totally bogus. os-release is not written in make syntax, but (a really restricted set of) sh. You will see once you have something like
PRETTY_NAME='The $$$ Generating Distribution' -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
-- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wednesday 2016-09-28 16:05, Roger Oberholtzer wrote:
Not bogus at all. It is perfect Makefile syntax No problem. It works. I can understand if this is not an intended or expected usage. But it is fully functional.
I just gave you an example why it does not work, but of course you can keep telling yourself that "fully functional" lie all day long if it pleases you. Good day, sir. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wed, Sep 28, 2016 at 4:14 PM, Jan Engelhardt
On Wednesday 2016-09-28 16:05, Roger Oberholtzer wrote:
Not bogus at all. It is perfect Makefile syntax No problem. It works. I can understand if this is not an intended or expected usage. But it is fully functional.
I just gave you an example why it does not work, but of course you can keep telling yourself that "fully functional" lie all day long if it pleases you. Good day, sir.
PRETTY_NAME works on 12.3, 13.1, 42.1 and Tumbleweed. Which are the platforms I compile for. (And cross compile with mingw for Windows 32- and 64- bit). As does the rest of the file. Of course, if a $$ is put somewhere I may have a problem. But wouldn't that be the same if the files is read in to a bash script? The /etc/os-release files I see look like this: 12.3 NAME=openSUSE VERSION="12.3 (Dartmouth)" VERSION_ID="12.3" PRETTY_NAME="openSUSE 12.3 (Dartmouth) (i586)" ID=opensuse ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:opensuse:12.3" 13.1 NAME=openSUSE VERSION="13.1 (Bottle)" VERSION_ID="13.1" PRETTY_NAME="openSUSE 13.1 (Bottle) (i586)" ID=opensuse ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:opensuse:13.1" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://opensuse.org/" ID_LIKE="suse" 42.1 VERSION="42.1" VERSION_ID="42.1" PRETTY_NAME="openSUSE Leap 42.1 (x86_64)" ID=opensuse ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:opensuse:42.1" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://opensuse.org/" ID_LIKE="suse" Tumbleweed # VERSION="20160913" ID=opensuse ID_LIKE="suse" VERSION_ID="20160913" PRETTY_NAME="openSUSE Tumbleweed" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:tumbleweed:20160913" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://www.opensuse.org/" Sorry to report that it works for me. The earlier /etc/SuSE-release was problematic in that all lines were not var=value. I used $[shell grep ...) in the makefile fo get the info I wanted. When/if I encounter a problem, I can take action. -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Am 28.09.2016 um 11:03 schrieb Dominique Leuenberger / DimStar:
On Wed, 2016-09-28 at 10:56 +0200, Roger Oberholtzer wrote:
I am curious if my /etc/os-release is odd:
# VERSION="20160913" ID=opensuse ID_LIKE="suse" VERSION_ID="20160913" PRETTY_NAME="openSUSE Tumbleweed" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:tumbleweed:20160913" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://www.opensuse.org/"
Should the VERSION line be commented as shown above? Or has something odd happened to my file?
That's correct...
VERSION is added merely for 'your reference' but not used to interpret by tools (hence commented)
I'm assuming though this commented field has been causing GRUB menus (e.g. on ARM) to display "openSUSE Tumbleweed , "? Note the space before the comma for lack of version. Regards, Andreas -- SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg)
On Wednesday 2016-09-28 16:33, Roger Oberholtzer wrote:
Of course, if a $$ is put somewhere I may have a problem. But wouldn't that be the same if the files is read in to a bash script?
No, because make and (ba)sh handle FOO='X$$$Y' differently. *Vastly* differently. In fact, in make, the variable will contain *seven* characters, in sh just five. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wed, Sep 28, 2016 at 7:49 PM, Jan Engelhardt
On Wednesday 2016-09-28 16:33, Roger Oberholtzer wrote:
Of course, if a $$ is put somewhere I may have a problem. But wouldn't that be the same if the files is read in to a bash script?
No, because make and (ba)sh handle
FOO='X$$$Y'
differently. *Vastly* differently. In fact, in make, the variable will contain *seven* characters, in sh just five.
I'm not arguing the point. It could be an exploit waiting to happen. All I mean is that the files I have seen thus far are okay. We only use this in our own internal Makefiles in a globally included file that sets some stuff based on the system. It can easily be modified to treat the file as text with no variable substitution. bash sets FOO to the 'X' followed by the process number. If Y is defined, that will follow. e.g., "X1995" GNU make sets FOO to "X$" My question was about the commented VERSION= string. Roger Oberholtzer -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Thu, Sep 29, 2016 at 8:52 AM, Roger Oberholtzer
FOO='X$$Y' ...
bash sets FOO to the 'X' followed by the process number.
You apparently have very non-standard bash version :) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wed, Sep 28, 2016 at 7:02 PM, Andreas Färber
Am 28.09.2016 um 11:03 schrieb Dominique Leuenberger / DimStar:
On Wed, 2016-09-28 at 10:56 +0200, Roger Oberholtzer wrote:
I am curious if my /etc/os-release is odd:
# VERSION="20160913" ID=opensuse ID_LIKE="suse" VERSION_ID="20160913" PRETTY_NAME="openSUSE Tumbleweed" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:tumbleweed:20160913" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://www.opensuse.org/"
Should the VERSION line be commented as shown above? Or has something odd happened to my file?
That's correct...
VERSION is added merely for 'your reference' but not used to interpret by tools (hence commented)
I'm assuming though this commented field has been causing GRUB menus (e.g. on ARM) to display "openSUSE Tumbleweed , "? Note the space before the comma for lack of version.
I thought that ARM switched to extlinux? In which file do you see it? Could you attach it? -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Andrei Borzenkov wrote:
On Thu, Sep 29, 2016 at 8:52 AM, Roger Oberholtzer
wrote: FOO='X$$Y' ...
bash sets FOO to the 'X' followed by the process number.
You apparently have very non-standard bash version :)
Yeah. Roger, presumably you used double-qoutes? -- Per Jessen, Zürich (14.3°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wed, 2016-09-28 at 18:02 +0200, Andreas Färber wrote:
Am 28.09.2016 um 11:03 schrieb Dominique Leuenberger / DimStar:
On Wed, 2016-09-28 at 10:56 +0200, Roger Oberholtzer wrote:
I am curious if my /etc/os-release is odd:
# VERSION="20160913" ID=opensuse ID_LIKE="suse" VERSION_ID="20160913" PRETTY_NAME="openSUSE Tumbleweed" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:tumbleweed:20160913" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://www.opensuse.org/"
Should the VERSION line be commented as shown above? Or has something odd happened to my file?
That's correct...
VERSION is added merely for 'your reference' but not used to interpret by tools (hence commented)
I'm assuming though this commented field has been causing GRUB menus (e.g. on ARM) to display "openSUSE Tumbleweed , "? Note the space before the comma for lack of version.
yes, that's right - but it's better than having the '20160921' string in the grub menu (and 'Tumbleweed' as VERSION was set before, was technically wrong and we had bug reports about that) as for the grub menu, this follow up bug is tracked in https://bugzilla.opensuse.org/show_bug.cgi?id=995549 Cheers, Dominique
On Thu, Sep 29, 2016 at 9:12 AM, Dominique Leuenberger / DimStar
yes, that's right - but it's better than having the '20160921' string in the grub menu (and 'Tumbleweed' as VERSION was set before, was technically wrong and we had bug reports about that)
I can imagine. Still, I can have, say, 42.1 installed as the base, but with so many updates it is far from the original. Granted the basic install layout is probably not so different. But thinking that 42.1 is adequate info to know the version of what is installed is risky. I would have preferred Tumbleweed rather than the date of the last Tumbleweed release. But not so strongly as to argue for it of others have a different opinion. -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Thu, Sep 29, 2016 at 9:06 AM, Per Jessen
You apparently have very non-standard bash version :)
Bog standard.
Yeah. Roger, presumably you used double-qoutes?
I changed to double quotes in my tests because that is what is actually in /etc/os-release - not the single quotes in the posts. Or perhaps single and double quotes are both allowed in this file? -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Thursday 2016-09-29 09:24, Roger Oberholtzer wrote:
I changed to double quotes in my tests because that is what is actually in /etc/os-release - not the single quotes in the posts. Or perhaps single and double quotes are both allowed in this file?
Of course. Did you ever bother to read the manpage os-release(5)? -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Thu, Sep 29, 2016 at 9:40 AM, Jan Engelhardt
On Thursday 2016-09-29 09:24, Roger Oberholtzer wrote:
I changed to double quotes in my tests because that is what is actually in /etc/os-release - not the single quotes in the posts. Or perhaps single and double quotes are both allowed in this file?
Of course. Did you ever bother to read the manpage os-release(5)?
Hmmm. From the man page: "The basic file format of os-release is a newline-separated list of environment-like shell-compatible variable assignments. It is possible to source the configuration from shell scripts, however, beyond mere variable assignments, no shell features are supported (this means variable expansion is explicitly not supported)." It goes on to say: "Shell special characters ("$", quotes, backslash, backtick) must be escaped with backslashes" Do any openSUSE releases put unquoted special characters in this file? Or even quoted special characters? -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Sep 28 2016, Jan Engelhardt
On Wednesday 2016-09-28 11:14, Roger Oberholtzer wrote:
Okay. We use this in Makefiles via a simple "include /etc/os-release".
That is totally bogus. os-release is not written in make syntax, but (a really restricted set of) sh. You will see once you have something like
PRETTY_NAME='The $$$ Generating Distribution'
It's still valid makefile syntax, even if the value will be interpreted differently when *used* by make. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Thu, Sep 29, 2016 at 11:31 AM, Andreas Schwab
On Sep 28 2016, Jan Engelhardt
wrote:
PRETTY_NAME='The $$$ Generating Distribution'
It's still valid makefile syntax, even if the value will be interpreted differently when *used* by make.
Yep. I fully agree. But according to the man page for os-release, maybe the $ should be escaped? -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Sep 29 2016, Roger Oberholtzer
On Thu, Sep 29, 2016 at 11:31 AM, Andreas Schwab
wrote: On Sep 28 2016, Jan Engelhardt
wrote: PRETTY_NAME='The $$$ Generating Distribution'
It's still valid makefile syntax, even if the value will be interpreted differently when *used* by make.
Yep. I fully agree.
But according to the man page for os-release, maybe the $ should be escaped?
That would change the value even in sh mode. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Am 29.09.2016 um 08:31 schrieb Andrei Borzenkov:
On Wed, Sep 28, 2016 at 7:02 PM, Andreas Färber
wrote: Am 28.09.2016 um 11:03 schrieb Dominique Leuenberger / DimStar:
On Wed, 2016-09-28 at 10:56 +0200, Roger Oberholtzer wrote:
I am curious if my /etc/os-release is odd:
# VERSION="20160913" ID=opensuse ID_LIKE="suse" VERSION_ID="20160913" PRETTY_NAME="openSUSE Tumbleweed" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:tumbleweed:20160913" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://www.opensuse.org/"
Should the VERSION line be commented as shown above? Or has something odd happened to my file?
That's correct...
VERSION is added merely for 'your reference' but not used to interpret by tools (hence commented)
I'm assuming though this commented field has been causing GRUB menus (e.g. on ARM) to display "openSUSE Tumbleweed , "? Note the space before the comma for lack of version.
I thought that ARM switched to extlinux?
No. Matwey implemented extlinux support, but shortly after the YaST team announced they would only support GRUB2, so Alex implemented UEFI support in U-Boot and we started adopting GRUB2 wherever it has been tested to work. https://events.opensuse.org/conference/oSC16/program/proposal/946 Also there have always been AArch64 platforms with native UEFI firmware (AppliedMicro, AMD, Cavium, HiKey, OVMF), also a few ARMv7. Regards, Andreas -- SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Thu, Sep 29, 2016 at 1:46 PM, Andreas Färber
VERSION is added merely for 'your reference' but not used to interpret by tools (hence commented)
I'm assuming though this commented field has been causing GRUB menus (e.g. on ARM) to display "openSUSE Tumbleweed , "? Note the space before the comma for lack of version.
I thought that ARM switched to extlinux?
No. Matwey implemented extlinux support, but shortly after the YaST team announced they would only support GRUB2, so Alex implemented UEFI support in U-Boot and we started adopting GRUB2 wherever it has been tested to work.
Then it should be the same everywhere and I do not remember seeing this lone comma. Can you provide full file where this comma appears? -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (7)
-
Andreas Färber
-
Andreas Schwab
-
Andrei Borzenkov
-
Dominique Leuenberger / DimStar
-
Jan Engelhardt
-
Per Jessen
-
Roger Oberholtzer