* [PATCH v2] tools/mkrpm: improve version.release handling
@ 2015-03-24 14:37 Olaf Hering
2015-03-25 14:01 ` George Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Olaf Hering @ 2015-03-24 14:37 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.
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>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] tools/mkrpm: improve version.release handling
2015-03-24 14:37 [PATCH v2] tools/mkrpm: improve version.release handling Olaf Hering
@ 2015-03-25 14:01 ` George Dunlap
2015-03-26 7:39 ` Olaf Hering
2015-03-30 9:08 ` Ian Campbell
0 siblings, 2 replies; 4+ messages in thread
From: George Dunlap @ 2015-03-25 14:01 UTC (permalink / raw)
To: Olaf Hering, xen-devel
Cc: Wei Liu, Ian Jackson, Ian Campbell, Stefano Stabellini
On 03/24/2015 02:37 PM, Olaf Hering wrote:
> 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>
> ---
> 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}"
Thanks Olaf. I kicked the tires a bit and it seems to work as described.
I think in my ideal world the result would look like this:
case ${v[1]} && PKG_RELEASE: "${v[1]}.${PKG_RELEASE}"
case ${v[1]} && !PKG_RELEASE: "${v[1]}"
case !${v[1]} && PKG_RELEASE: "${PKG_RELEASE}"
case !${v[1]} && !PKG_RELEASE: "0"
Right now the 3rd case looks like "0.${PKG_RELEASE}". But I think
you've put up enough with my pickiness. :-)
I may come back and see if I can make a patch so it acts like above; but
for now:
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
Tested-by: George Dunlap <george.dunlap@eu.citrix.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] tools/mkrpm: improve version.release handling
2015-03-25 14:01 ` George Dunlap
@ 2015-03-26 7:39 ` Olaf Hering
2015-03-30 9:08 ` Ian Campbell
1 sibling, 0 replies; 4+ messages in thread
From: Olaf Hering @ 2015-03-26 7:39 UTC (permalink / raw)
To: George Dunlap
Cc: Wei Liu, Stefano Stabellini, Ian Jackson, Ian Campbell, xen-devel
On Wed, Mar 25, George Dunlap wrote:
> Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
> Tested-by: George Dunlap <george.dunlap@eu.citrix.com>
Thanks.
Whoever is in charge, please backport to staging-4.5 as well.
Olaf
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] tools/mkrpm: improve version.release handling
2015-03-25 14:01 ` George Dunlap
2015-03-26 7:39 ` Olaf Hering
@ 2015-03-30 9:08 ` Ian Campbell
1 sibling, 0 replies; 4+ messages in thread
From: Ian Campbell @ 2015-03-30 9:08 UTC (permalink / raw)
To: George Dunlap
Cc: Wei Liu, Olaf Hering, Stefano Stabellini, Ian Jackson, xen-devel
On Wed, 2015-03-25 at 14:01 +0000, George Dunlap wrote:
> Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
> Tested-by: George Dunlap <george.dunlap@eu.citrix.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-03-30 9:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-24 14:37 [PATCH v2] tools/mkrpm: improve version.release handling Olaf Hering
2015-03-25 14:01 ` George Dunlap
2015-03-26 7:39 ` Olaf Hering
2015-03-30 9:08 ` Ian Campbell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.