[Ovirt-devel] [PATCH *ALL*] Makefile.am: set OVIRT_DEV from Release: 0 in spec.in file

Jim Meyering jim at meyering.net
Thu Oct 9 17:18:04 UTC 2008


Jim Meyering <jim at meyering.net> wrote:

> "Perry N. Myers" <pmyers at redhat.com> wrote:
>> 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.
>
> Hi Perry,
>
> I've run "make build" several times, both with and without OVIRT_DEV=1
> in my environment, (though just for the first few seconds each time,
> which is enough to see the relevant rpmbuild command),
> and every time I saw the expected .git... argument:
>
>    --define "extra_release .$(date --utc +%Y%m%d%H%M%S)git$(git log -1 --pretty=format:%h)"
>
> Ah ha.
> But if I build with "make publish OVIRT_DEV=",
> *then* I see what you report: no extra_release definition.
>
> To reduce the likelihood of that happening,
> I could change the variable name to e.g., _OVIRT_DEV.

I've changed it to _ovirt_dev.
I'll push these 7 identical (modulo context) changes after I eat:

>From 9db4eb4dad24f3b5132944c5c1b916d2a42be615 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Thu, 9 Oct 2008 19:16:01 +0200
Subject: [PATCH appliance] Makefile.am: obviate OVIRT_DEV envvar

Now, _ovirt_dev is automatically set from Release: 0 in spec.in file.
Just like OVIRT_DEV was, it's used to define (or not) "extra_release".
---
 Makefile.am |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 6631274..8cba85d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,12 +25,17 @@ 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)
 RPMDIR		= $$(rpm --eval '%{_rpmdir}')
 RPM_FLAGS	= --define "ovirt_cache_dir $(OVIRT_CACHE_DIR)"
-RPM_FLAGS	+= $(if $(OVIRT_DEV),--define "extra_release .$(GIT_RELEASE)")
+RPM_FLAGS	+= $(if $(_ovirt_dev),--define "extra_release .$(GIT_RELEASE)")
 # FEDORA_URL env var can be set to the root of a fedora mirror
 RPM_FLAGS	+= $(if $(FEDORA_URL),--define "fedora_url $(FEDORA_URL)")
 # OVIRT_URL env var can be set to the root of an ovirt.org mirror
--
1.6.0.2.304.gc76d

>From 96223e17149e0440b616c75d4c189363318ab187 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Thu, 9 Oct 2008 19:16:01 +0200
Subject: [PATCH docs] Makefile.am: obviate OVIRT_DEV envvar

Now, _ovirt_dev is automatically set from Release: 0 in spec.in file.
Just like OVIRT_DEV was, it's used to define (or not) "extra_release".
---
 Makefile.am |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 47fbbab..9d58e23 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,11 +24,17 @@ 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}')
 RPM_FLAGS	= --define "ovirt_cache_dir $(OVIRT_CACHE_DIR)"
-RPM_FLAGS	+= $(if $(OVIRT_DEV),--define "extra_release .$(GIT_RELEASE)")
+RPM_FLAGS	+= $(if $(_ovirt_dev),--define "extra_release .$(GIT_RELEASE)")

 rpms: dist
 	rpmbuild $(RPM_FLAGS) -ta $(distdir).tar.gz
--
1.6.0.2.304.gc76d

>From f8eefaa29fbee9ddbc4b4159f765be573cdbc9e4 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Thu, 9 Oct 2008 19:16:01 +0200
Subject: [PATCH node] Makefile.am: obviate OVIRT_DEV envvar

Now, _ovirt_dev is automatically set from Release: 0 in spec.in file.
Just like OVIRT_DEV was, it's used to define (or not) "extra_release".
---
 Makefile.am |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 8ca63dc..1d63310 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -33,11 +33,17 @@ 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}')
 RPM_FLAGS	= --define "ovirt_cache_dir $(OVIRT_CACHE_DIR)"
-RPM_FLAGS	+= $(if $(OVIRT_DEV),--define "extra_release .$(GIT_RELEASE)")
+RPM_FLAGS	+= $(if $(_ovirt_dev),--define "extra_release .$(GIT_RELEASE)")

 rpms: dist
 	rpmbuild $(RPM_FLAGS) -ta $(distdir).tar.gz
--
1.6.0.2.304.gc76d

>From 4b276c09c8d211c63f6e6dc586c8a66b3dab6f05 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Thu, 9 Oct 2008 19:16:01 +0200
Subject: [PATCH node-image] Makefile.am: obviate OVIRT_DEV envvar

Now, _ovirt_dev is automatically set from Release: 0 in spec.in file.
Just like OVIRT_DEV was, it's used to define (or not) "extra_release".
---
 Makefile.am |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 50d55ef..73a0a7b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -30,11 +30,17 @@ 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}')
 RPM_FLAGS	= --define "ovirt_cache_dir $(OVIRT_CACHE_DIR)"
-RPM_FLAGS	+= $(if $(OVIRT_DEV),--define "extra_release .$(GIT_RELEASE)")
+RPM_FLAGS	+= $(if $(_ovirt_dev),--define "extra_release .$(GIT_RELEASE)")
 # FEDORA_URL env var can be set to the root of a fedora mirror
 RPM_FLAGS	+= $(if $(FEDORA_URL),--define "fedora_url $(FEDORA_URL)")
 # OVIRT_URL env var can be set to the root of an ovirt.org mirror
--
1.6.0.2.304.gc76d

>From 1b4e66eca164916440cac9031d174f0c82cc997d Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Thu, 9 Oct 2008 19:16:01 +0200
Subject: [PATCH recipe] Makefile.am: obviate OVIRT_DEV envvar

Now, _ovirt_dev is automatically set from Release: 0 in spec.in file.
Just like OVIRT_DEV was, it's used to define (or not) "extra_release".
---
 Makefile.am |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 37751af..db2962d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,11 +34,17 @@ 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}')
 RPM_FLAGS	= --define "ovirt_cache_dir $(OVIRT_CACHE_DIR)"
-RPM_FLAGS	+= $(if $(OVIRT_DEV),--define "extra_release .$(GIT_RELEASE)")
+RPM_FLAGS	+= $(if $(_ovirt_dev),--define "extra_release .$(GIT_RELEASE)")

 rpms: dist
 	rpmbuild $(RPM_FLAGS) -ta $(distdir).tar.gz
--
1.6.0.2.304.gc76d

>From 32e4db1453a2cdbed1ee29fb5f523f1fbbe9709c Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Thu, 9 Oct 2008 19:16:01 +0200
Subject: [PATCH release] Makefile.am: obviate OVIRT_DEV envvar

Now, _ovirt_dev is automatically set from Release: 0 in spec.in file.
Just like OVIRT_DEV was, it's used to define (or not) "extra_release".
---
 Makefile.am |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 0637125..d726dab 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,11 +25,17 @@ 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}')
 RPM_FLAGS	= --define "ovirt_cache_dir $(OVIRT_CACHE_DIR)"
-RPM_FLAGS	+= $(if $(OVIRT_DEV),--define "extra_release .$(GIT_RELEASE)")
+RPM_FLAGS	+= $(if $(_ovirt_dev),--define "extra_release .$(GIT_RELEASE)")

 rpms: dist
 	rpmbuild $(RPM_FLAGS) -ta $(distdir).tar.gz
--
1.6.0.2.304.gc76d

>From e84b82128372d6d58327116a22c6a3cd76084afc Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Thu, 9 Oct 2008 19:16:01 +0200
Subject: [PATCH server] Makefile.am: obviate OVIRT_DEV envvar

Now, _ovirt_dev is automatically set from Release: 0 in spec.in file.
Just like OVIRT_DEV was, it's used to define (or not) "extra_release".
---
 Makefile.am |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index daf6ef0..71a5e9f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,11 +25,17 @@ 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}')
 RPM_FLAGS	= --define "ovirt_cache_dir $(OVIRT_CACHE_DIR)"
-RPM_FLAGS	+= $(if $(OVIRT_DEV),--define "extra_release .$(GIT_RELEASE)")
+RPM_FLAGS	+= $(if $(_ovirt_dev),--define "extra_release .$(GIT_RELEASE)")

 rpms: dist
 	rpmbuild $(RPM_FLAGS) -ta $(distdir).tar.gz
--
1.6.0.2.304.gc76d




More information about the ovirt-devel mailing list