tools/mkrpm: improve version.release handling

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.

The usage of --force disables essentials checks such as file conflict
detection. As a result the new xen.rpm may overwrite files owned by
other 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.

Update mkrpm to recognize PKG_RELEASE=. Its value will be appended to
the Release string. It can be filled with a time stamp, like:
 make rpmball PKG_RELEASE="`date +%Y%m%d%H%M%S`"

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>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
Tested-by: George Dunlap <george.dunlap@eu.citrix.com>
This commit is contained in:
Olaf Hering authored and Ian Campbell committed 2015-03-30 09:34:57 +01:00
1 parent 6ea0b23ed5
commit 624de4dfb4
2 files changed
+4 -4

No files matched your search

+3 -1
View File
@@ -197,8 +197,10 @@ BOOT_DIR=
EFI_DIR= EFI_DIR=
The make target 'rpmball' will build a xen.rpm. This variable can be The make target 'rpmball' will build a xen.rpm. This variable can be
used to append a custom string to the name. used to append a custom string to the name. In addition a string can be
appended to the rpm Release: tag.
PKG_SUFFIX= PKG_SUFFIX=
PKG_RELEASE=
The hypervisor will report a certain version string. This variable can The hypervisor will report a certain version string. This variable can
be used to append a custom string to the version. be used to append a custom string to the version.
+1 -3
View File
@@ -17,9 +17,7 @@ xenroot="$1"
# version and release. Default to "0" if there isn't a release. # version and release. Default to "0" if there isn't a release.
v=(${2/-/ }) v=(${2/-/ })
version=${v[0]} version=${v[0]}
release=${v[1]} release="${v[1]:-0}${PKG_RELEASE:+.$PKG_RELEASE}"
[[ -n "$release" ]] || release="0"
cd $xenroot cd $xenroot
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.