Jim Meyering
2008-Oct-08 17:07 UTC
[Ovirt-devel] [PATCH *ALL*] Makefile.am: set OVIRT_DEV from Release: 0 in spec.in file
I'd been running "make build" without setting OVIRT_DEV. That would cause trouble due to using out of date RPMs. But in development, we should always simply set OVIRT_DEV=1. We know we're in development mode when the spec.in file contains has a line that starts like this: Release: 0 so I've adjusted all Makefile.am files to automatically do what we want. Painful to have to put this same snippet in 7 different repositories, but very soon I'll be motivated (and have time) to factor out the worst of that duplication. Jim>From b7f104e0d410164682c16995fea6358a74e64b16 Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Wed, 8 Oct 2008 18:58:32 +0200 Subject: [PATCH appliance] Makefile.am: set OVIRT_DEV from Release: 0 in spec.in file --- Makefile.am | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6631274..f77d157 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,6 +25,11 @@ EXTRA_DIST = \ ovirt-appliance.spec \ ovirt-appliance.spec.in +# For Release: 0..., set OVIRT_DEV=1 so that we get extra_release.GIT- +# annotated rpm version strings. +OVIRT_DEV = \ + $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \ + $(srcdir)/*.spec.in && echo 1 || :) git_head = $$(git log -1 --pretty=format:%h) GIT_RELEASE = $$(date --utc +%Y%m%d%H%M%S)git$(git_head) -- 1.6.0.2.304.gc76d>From ee12814840cc1a052827887ee8cf8acda68c3693 Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Wed, 8 Oct 2008 18:59:10 +0200 Subject: [PATCH docs] Makefile.am: set OVIRT_DEV from Release: 0 in spec.in file --- Makefile.am | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/Makefile.am b/Makefile.am index 47fbbab..af55e4f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -24,6 +24,12 @@ EXTRA_DIST = \ oVirt_Installation_Guide \ Using_the_oVirt_Admin_UI +# For Release: 0..., set OVIRT_DEV=1 so that we get extra_release.GIT- +# annotated rpm version strings. +OVIRT_DEV = \ + $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \ + $(srcdir)/*.spec.in && echo 1 || :) + git_head = $$(git log -1 --pretty=format:%h) GIT_RELEASE = $$(date --utc +%Y%m%d%H%M%S)git$(git_head) RPMDIR = $$(rpm --eval '%{_rpmdir}') -- 1.6.0.2.304.gc76d>From 679eeeb67c975ec6289b859b4b6309b465516403 Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Wed, 8 Oct 2008 19:00:03 +0200 Subject: [PATCH node] Makefile.am: set OVIRT_DEV from Release: 0 in spec.in file --- Makefile.am | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/Makefile.am b/Makefile.am index 28aa71e..034fdde 100644 --- a/Makefile.am +++ b/Makefile.am @@ -32,6 +32,12 @@ EXTRA_DIST = \ logrotate/ovirt-logrotate \ logrotate/ovirt-logrotate.conf +# For Release: 0..., set OVIRT_DEV=1 so that we get extra_release.GIT- +# annotated rpm version strings. +OVIRT_DEV = \ + $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \ + $(srcdir)/*.spec.in && echo 1 || :) + git_head = $$(git log -1 --pretty=format:%h) GIT_RELEASE = $$(date --utc +%Y%m%d%H%M%S)git$(git_head) RPMDIR = $$(rpm --eval '%{_rpmdir}') -- 1.6.0.2.304.gc76d>From a00b0850a4e2c51606715deea71dba1c55d10f97 Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Wed, 8 Oct 2008 19:00:25 +0200 Subject: [PATCH node-image] Makefile.am: set OVIRT_DEV from Release: 0 in spec.in file --- Makefile.am | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/Makefile.am b/Makefile.am index 50d55ef..d34887b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,6 +30,12 @@ EXTRA_DIST = \ ovirt-node-image.ks \ ovirt-pxe +# For Release: 0..., set OVIRT_DEV=1 so that we get extra_release.GIT- +# annotated rpm version strings. +OVIRT_DEV = \ + $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \ + $(srcdir)/*.spec.in && echo 1 || :) + git_head = $$(git log -1 --pretty=format:%h) GIT_RELEASE = $$(date --utc +%Y%m%d%H%M%S)git$(git_head) RPMDIR = $$(rpm --eval '%{_rpmdir}') -- 1.6.0.2.304.gc76d>From acba318c9075a2fce29bc095c4318c0c522080c1 Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Wed, 8 Oct 2008 19:00:34 +0200 Subject: [PATCH recipe] Makefile.am: set OVIRT_DEV from Release: 0 in spec.in file --- Makefile.am | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/Makefile.am b/Makefile.am index 37751af..b0be2c0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -34,6 +34,12 @@ EXTRA_DIST = \ appliances/ovirt/templates/ovirt-server-appliance-setup.erb \ appliances/ovirt/templates/terminal.erb +# For Release: 0..., set OVIRT_DEV=1 so that we get extra_release.GIT- +# annotated rpm version strings. +OVIRT_DEV = \ + $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \ + $(srcdir)/*.spec.in && echo 1 || :) + git_head = $$(git log -1 --pretty=format:%h) GIT_RELEASE = $$(date --utc +%Y%m%d%H%M%S)git$(git_head) RPMDIR = $$(rpm --eval '%{_rpmdir}') -- 1.6.0.2.304.gc76d>From 006d020c145c0a29ba311057d97ed39a4d43afc9 Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Wed, 8 Oct 2008 18:56:58 +0200 Subject: [PATCH release] Makefile.am: set OVIRT_DEV from Release: 0 in spec.in file --- Makefile.am | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/Makefile.am b/Makefile.am index 0637125..9c37e91 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,6 +25,12 @@ EXTRA_DIST = \ ovirt.repo \ misc-scripts +# For Release: 0..., set OVIRT_DEV=1 so that we get extra_release.GIT- +# annotated rpm version strings. +OVIRT_DEV = \ + $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \ + $(srcdir)/*.spec.in && echo 1 || :) + git_head = $$(git log -1 --pretty=format:%h) GIT_RELEASE = $$(date --utc +%Y%m%d%H%M%S)git$(git_head) RPMDIR = $$(rpm --eval '%{_rpmdir}') -- 1.6.0.2.304.gc76d>From 9303c86a3d17416bec096e05e84c057a430f3ac7 Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Wed, 8 Oct 2008 18:57:46 +0200 Subject: [PATCH server] Makefile.am: set OVIRT_DEV from Release: 0 in spec.in file --- Makefile.am | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/Makefile.am b/Makefile.am index daf6ef0..2dc9c92 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,6 +25,12 @@ EXTRA_DIST = \ conf \ src +# For Release: 0..., set OVIRT_DEV=1 so that we get extra_release.GIT- +# annotated rpm version strings. +OVIRT_DEV = \ + $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \ + $(srcdir)/*.spec.in && echo 1 || :) + git_head = $$(git log -1 --pretty=format:%h) GIT_RELEASE = $$(date --utc +%Y%m%d%H%M%S)git$(git_head) RPMDIR = $$(rpm --eval '%{_rpmdir}') -- 1.6.0.2.304.gc76d
Perry N. Myers
2008-Oct-09 04:12 UTC
[Ovirt-devel] [PATCH *ALL*] Makefile.am: set OVIRT_DEV from Release: 0 in spec.in file
Jim Meyering wrote:> I'd been running "make build" without setting OVIRT_DEV. > That would cause trouble due to using out of date RPMs. > But in development, we should always simply set OVIRT_DEV=1. > We know we're in development mode when the spec.in file contains > has a line that starts like this: > > Release: 0 > > so I've adjusted all Makefile.am files to automatically do > what we want. Painful to have to put this same snippet in > 7 different repositories, but very soon I'll be motivated > (and have time) to factor out the worst of that duplication.These patches seem to work fine, and I would ACK them except... I've noticed that occasionally the rpm flags for OVIRT_DEV are not set properly in the ovirt-appliance repo, causing the version for ovirt-appliance to occasionally be 0.94-0 even though the Release is 0 in the spec file. I can't seem to replicate the error with any consistency. It just happens once and a while with seemingly the same environment (I know there must be something different, but haven't pinned it down yet) If anyone has seen this behavior w/o these patches applied please let me know, as maybe this has been a problem all along. It could be that the bashism used to set rpm_flags is not working properly in the Makefile. Perry