From: George Dunlap <george.dunlap@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
George Dunlap <george.dunlap@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>,
xen-devel@lists.xen.org
Subject: Re: [PATCH 4/5] raisin: Change update/release parsing OSes
Date: Mon, 19 Oct 2015 10:16:53 +0100 [thread overview]
Message-ID: <5624B505.1000202@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1510161448340.27957@kaball.uk.xensource.com>
On 16/10/15 14:49, Stefano Stabellini wrote:
> On Wed, 14 Oct 2015, George Dunlap wrote:
>> At the moment, something like 7.1.1503 will be parsed as RELEASE=7.1
>> UPDATE=1503. Change the bash string so that RELEASE=7 UPDATE=1.1503
>> in this case.
>>
>> Also add an example CentOS 7 release string, and add the RELEASE /
>> UPDATE parsing to lsb_release as well.
>>
>> Signed-off-by: George Dunlap <george.dunlap@citrix.com>
>> ---
>> lib/common-functions.sh | 8 +++++---
>> 1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/lib/common-functions.sh b/lib/common-functions.sh
>> index a389054..1343dc8 100644
>> --- a/lib/common-functions.sh
>> +++ b/lib/common-functions.sh
>> @@ -103,13 +103,15 @@ function get_distro() {
>> os_VENDOR=`lsb_release -i -s`
>> os_RELEASE=`lsb_release -r -s`
>> os_CODENAME=`lsb_release -c -s`
>> - os_UPDATE=""
>> + os_UPDATE=${os_RELEASE#*.}
>> + os_RELEASE=${os_RELEASE%%.*}
>> elif [[ -r /etc/redhat-release ]]
>> then
>> # Red Hat Enterprise Linux Server release 5.5 (Tikanga)
>> # Red Hat Enterprise Linux Server release 7.0 Beta (Maipo)
>> # CentOS release 5.5 (Final)
>> # CentOS Linux release 6.0 (Final)
>> + # CentOS Linux release 7.1.1503 (Core)
>> # Fedora release 16 (Verne)
>> # XenServer release 6.2.0-70446c (xenenterprise)
>> os_CODENAME=""
>> @@ -120,8 +122,8 @@ function get_distro() {
>> ver=`sed -e 's/^.* \([0-9].*\) (\(.*\)).*$/\1\|\2/' /etc/redhat-release`
>> os_CODENAME=${ver#*|}
>> os_RELEASE=${ver%|*}
>> - os_UPDATE=${os_RELEASE##*.}
>> - os_RELEASE=${os_RELEASE%.*}
>> + os_UPDATE=${os_RELEASE#*.}
>> + os_RELEASE=${os_RELEASE%%.*}
>> break
>
> This change is OK, but I don't know if this is what we want for the
> other case above. I would be tempted to leave the lsb_release case as
> is.
?
Don't we want the resulting state of "get_distro()" to work the same
whether you have lsb_release installed or not?
I wrote this patch quite a while ago, but I'm pretty sure that I tested
it with the lsb package installed and not installed for C7 (and maybe C6
as well) and with this patch I got the same results.
(Or to put it a different way: The only reason I even modified the
lsb_release section is because I installed the lsb package and got
strange results.)
-George
next prev parent reply other threads:[~2015-10-19 9:16 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-14 16:21 [PATCH 0/5] raisin: Miscelaneous improvements George Dunlap
2015-10-14 16:21 ` [PATCH 1/5] raisin: Handle aliases for packages, add pciutils-dev / libpci-dev alias George Dunlap
2015-10-16 13:37 ` Stefano Stabellini
2015-10-19 9:52 ` George Dunlap
2015-10-14 16:21 ` [PATCH 2/5] raisin: Detect systemd George Dunlap
2015-10-14 16:34 ` George Dunlap
2015-10-16 13:41 ` Stefano Stabellini
2015-10-19 9:54 ` George Dunlap
2015-10-19 11:09 ` Stefano Stabellini
2015-10-16 13:39 ` Stefano Stabellini
2015-10-16 14:02 ` Ian Campbell
2015-10-16 14:04 ` Stefano Stabellini
2015-10-19 10:01 ` George Dunlap
2015-10-19 11:15 ` Stefano Stabellini
2015-10-14 16:21 ` [PATCH 3/5] raisin: Allow iasl to alias acpica-tools, unify Fedora and CentOS deps for xen George Dunlap
2015-10-16 13:42 ` Stefano Stabellini
2015-10-14 16:21 ` [PATCH 4/5] raisin: Change update/release parsing OSes George Dunlap
2015-10-16 13:49 ` Stefano Stabellini
2015-10-19 9:16 ` George Dunlap [this message]
2015-10-19 11:26 ` Stefano Stabellini
2015-10-19 11:39 ` George Dunlap
2015-10-14 16:21 ` [PATCH 5/5] raisin: Add XEN_CONFIG_EXTRA to config file George Dunlap
2015-10-16 13:53 ` Stefano Stabellini
2015-10-19 9:24 ` George Dunlap
2015-10-19 11:37 ` Stefano Stabellini
2015-10-19 11:42 ` George Dunlap
2015-10-19 11:49 ` Stefano Stabellini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5624B505.1000202@citrix.com \
--to=george.dunlap@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=stefano.stabellini@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).