xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-xen-4.5] tools/mkrpm: improve version.release handling
@ 2014-10-07 15:01 Olaf Hering
  2014-10-07 15:03 ` Olaf Hering
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Olaf Hering @ 2014-10-07 15:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini,
	George Dunlap, Ian Jackson

An increasing version and/or release number helps to update existing
packages without --force as in "rpm Uvh --force xen.rpm". Instead its
possible to do "rpm -Fvh *.rpm" to update only already installed
packages.

With the current way of calculating version-release it is difficult to
get an increasing release number into the spec file. The release is
always zero unless "make make XEN_VENDORVERSION=`date +.%s`" is used,
which has the bad side effect that xen.gz always gets a different
filename every time.

Since the value of release has no meaning its fine to have an ever
increasing number. This could be either the number of seconds (+%s), or
some representation which could mean something to a human. The change
uses a representation of date+time.

With this change my xen$PKG_SUFFIX.rpm gets as version-release
4.5_unstable-20141007161858, instead of 4.5-unstable$XEN_VENDORVERSION.

Note: to maintain the functionality that "rpm -F xen.rpm" works its also
required that the alphanumerical chars increase. Unfortunately thats not
the case for 4.5-rcN because "r" is smaller than "u"nstable. And going
from 4.5-rcN to 4.5 (or 4.5.N-pre to 4.5.N) may break as well. But there
is nothing we can do about this part.
Once 4.6 opens I suggest to set XEN_EXTRAVERSION to -devel because "d"
is smaller than "r" in 4.6-rcN. But thats a different discussion.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>
---
 tools/misc/mkrpm | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/tools/misc/mkrpm b/tools/misc/mkrpm
index 9b8c6d9..b54de24 100644
--- a/tools/misc/mkrpm
+++ b/tools/misc/mkrpm
@@ -13,13 +13,11 @@ fi
 
 xenroot="$1"
 
-# rpmbuild doesn't like dashes in the version; break it down into
-# version and release.  Default to "0" if there isn't a release.
-v=(${2/-/ })
-version=${v[0]}
-release=${v[1]}
-
-[[ -n "$release" ]] || release="0"
+# rpmbuild doesn't support dashes in the version;
+version=${2//-/_}
+# Use an ever increasing release number for this devel pkg.
+# This makes sure rpm -Fvh xen$PKG_SUFFIX.rpm can be updated wihtout --force.
+release="`date +%Y%m%d%H%M%S`"
 
 cd $xenroot

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2014-11-07 14:52 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-07 15:01 [PATCH for-xen-4.5] tools/mkrpm: improve version.release handling Olaf Hering
2014-10-07 15:03 ` Olaf Hering
2014-10-29  8:17 ` Olaf Hering
2014-11-03 11:00   ` George Dunlap
2014-11-03 14:16 ` George Dunlap
2014-11-03 14:19   ` George Dunlap
2014-11-03 14:24   ` Olaf Hering
2014-11-03 14:29     ` Ian Campbell
2014-11-03 14:47       ` Olaf Hering
2014-11-04 10:11         ` Ian Campbell
2014-11-04 10:16           ` Olaf Hering
2014-11-03 14:32     ` George Dunlap
2014-11-03 14:48       ` Olaf Hering
2014-11-04 10:37         ` George Dunlap
2014-11-04 10:46           ` Olaf Hering
2014-11-04 11:00             ` George Dunlap
2014-11-04 11:03               ` Ian Campbell
2014-11-07 13:30                 ` Olaf Hering
2014-11-07 14:52                   ` Konrad Rzeszutek Wilk

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).