[Ovirt-devel] [PATCH 1/4] Makefile, build-all adjustments
Jim Meyering
jim at meyering.net
Mon Jun 16 16:48:58 UTC 2008
Alan Pevec <apevec at redhat.com> wrote:
> Jim Meyering wrote:
>> git release, "make bumprelease" no longer works.
>> However, a manual "make bumprelease NEWRELEASE=2" does work.
>
> right, need to fix bumprelease to read only till dot in release field
>
>> of duplication, eventually I expect to factor those parts
>> into a common file and include that file from both places.
>
> yes, we need Makefile.common
>
>> --- a/wui/Makefile
>> +++ b/wui/Makefile
>> -VERSION = $(shell echo `awk '{ print $$1 }' version`)
>> -NEWVERSION = $(shell printf "%.2f" `dc -e "$(VERSION) .01 + p"`)
>
>> +VERSION = $$(awk '{ print $$1 }' version)
>> +NEWVERSION = $$(awk 'BEGIN { printf "%.2f", $(VERSION) + .01 }'))
>
> This fails:
> make bumpversion
> echo "$(awk 'BEGIN { printf "%.2f", $(awk '{ print $1 }' version) + .01 }')) 0" > version
> awk: BEGIN { printf "%.2f", $(awk {
> awk: ^ syntax error
> awk: cmd. line:1: BEGIN { printf "%.2f", $(awk {
> awk: cmd. line:1: ^ unexpected newline or end of string
Good catch.
My bad. I neglected to retest after rebasing (and resolving conflicts)
last night. Here's an incremental change to fix it, that I'm about to
squash onto 1/4 (which I will repost):
diff --git a/ovirt-host-creator/Makefile b/ovirt-host-creator/Makefile
index 9dc1e00..322d95e 100644
--- a/ovirt-host-creator/Makefile
+++ b/ovirt-host-creator/Makefile
@@ -1,7 +1,7 @@
-VERSION = $$(awk '{ print $$1 }' version)
-NEWVERSION = $$(awk 'BEGIN { printf "%.2f", $(VERSION) + .01 }'))
-RELEASE = $$(awk '{ print $$2 }' version)
-NEWRELEASE = $$(($(RELEASE) + 1)))
+VERSION := $(shell awk '{ print $$1 }' version)
+RELEASE := $(shell awk '{ print $$2 }' version)
+NEWVERSION = $$(awk 'BEGIN { printf "%.2f", $(VERSION) + .01 }')
+NEWRELEASE = $$(($(RELEASE) + 1))
X = $$(awk '{ split($$2,r,"."); \
printf("%d.%d\n", r[1], r[2]+1) }' version)
git_head = $$(git show-ref --hash=7 HEAD)
@@ -30,12 +30,12 @@ bumpgit:
bumprelease:
echo "$(VERSION) $(NEWRELEASE)" > version
+bumpversion:
+ echo "$(NEWVERSION) 0" > version
+
setversion:
echo "$(VERSION) $(RELEASE)" > version
-bumpversion:
- -echo "$(NEWVERSION) 0" > version
-
clean:
rm -rf ovirt-host-image-* ovirt-pxe.log
diff --git a/wui/Makefile b/wui/Makefile
index 3784d23..71239ab 100644
--- a/wui/Makefile
+++ b/wui/Makefile
@@ -1,7 +1,7 @@
-VERSION = $$(awk '{ print $$1 }' version)
-NEWVERSION = $$(awk 'BEGIN { printf "%.2f", $(VERSION) + .01 }'))
-RELEASE = $$(awk '{ print $$2 }' version)
-NEWRELEASE = $$(($(RELEASE) + 1)))
+VERSION := $(shell awk '{ print $$1 }' version)
+RELEASE := $(shell awk '{ print $$2 }' version)
+NEWVERSION = $$(awk 'BEGIN { printf "%.2f", $(VERSION) + .01 }')
+NEWRELEASE = $$(($(RELEASE) + 1))
X = $$(awk '{ split($$2,r,"."); \
printf("%d.%d\n", r[1], r[2]+1) }' version)
git_head = $$(git show-ref --hash=7 HEAD)
@@ -33,6 +33,9 @@ bumprelease:
bumpversion:
echo "$(NEWVERSION) 0" > version
+setversion:
+ echo "$(VERSION) $(RELEASE)" > version
+
clean:
rm -f ovirt*.gz ovirt*.rpm
rm -rf ovirt-wui-* dist build
More information about the ovirt-devel
mailing list