From: Olaf Hering Subject: [PATCH v2] tools/mkrpm: improve version.release handling Date: Tue, 24 Mar 2015 14:37:42 +0000 Message-ID: <1427207862-28204-1-git-send-email-olaf@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Olaf Hering , Wei Liu , Ian Campbell , Stefano Stabellini , George Dunlap , Ian Jackson List-Id: xen-devel@lists.xenproject.org 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 Cc: Ian Campbell Cc: Ian Jackson Cc: Stefano Stabellini Cc: Wei Liu Cc: George Dunlap --- INSTALL | 4 +++- tools/misc/mkrpm | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/INSTALL b/INSTALL index 1b67c36..8735bf5 100644 --- a/INSTALL +++ b/INSTALL @@ -197,8 +197,10 @@ BOOT_DIR= EFI_DIR= 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_RELEASE= The hypervisor will report a certain version string. This variable can be used to append a custom string to the version. diff --git a/tools/misc/mkrpm b/tools/misc/mkrpm index 9b8c6d9..f9363a1 100644 --- 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