From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH 1/5] tools/mkrpm: improve version.release handling Date: Mon, 23 Mar 2015 19:49:41 +0100 Message-ID: <20150323184941.GA13561@aepfle.de> References: <1426872279-5001-1-git-send-email-olaf@aepfle.de> <1426872279-5001-2-git-send-email-olaf@aepfle.de> <55103C3E.3000302@eu.citrix.com> <20150323175232.GA13774@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: Ian Jackson , "xen-devel@lists.xen.org" , Wei Liu , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Mon, Mar 23, George Dunlap wrote: > On Mon, Mar 23, 2015 at 5:52 PM, Olaf Hering wrote: > > On Mon, Mar 23, George Dunlap wrote: > >> xen-4.6_unstable-20150323160547.x86_64.rpm > > Do you want to continue to get "unstable" as release? > > My patch uses everything passed as "$2" as Version string. I think thats > > ok. > I think "unstable" (or "pre" for the stable branches) should > definitely be in there to distinguish it from an actual release. If I > were writing the patch I might consider taking out the _ (i.e., s/-//; > instead of s/-/_/;) but that's not a big deal. > > > Release will be either 0 or $PKG_DATE. > You mean, "0 or $PKG_RELEASE"? I had in mind that someone might want > to either set their own package release manually (PKG_RELEASE="9"), or > do PKG_RELEASE="$(git log RELEASE-4.5.0.. | wc -l)" Ok. Then the essential part of the patch could look like this: --- a/tools/misc/mkrpm +++ b/tools/misc/mkrpm @@ -17,9 +17,7 @@ xenroot="$1" # version and release. Default to "0" if there isn't a release. v=(${2/-/ }) version=${v[0]} -release=${v[1]} - -[[ -n "$release" ]] || release="0" +release="${v[1]:-0}${PKG_RELEASE:+.$PKG_RELEASE}" cd $xenroot release will be anything after a dash, or 0. And an optional ".$PKG_RELEASE" will be appended. Olaf