rpm release tag including date : reviewed the heuristic
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 5 May 2008 11:55:28 +0000 (11:55 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 5 May 2008 11:55:28 +0000 (11:55 +0000)
* removed the 'myplc' exception hard-coded in Makefile
* container packges (like myplc, bootstrapfs and the like)
  now need to explicitly set <package>-RPMDATE in the .mk file

Makefile
onelab.mk
planetlab.mk

index 4dd947a..b6a8051 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -64,6 +64,9 @@
 # (*) package-RPMBUILD: If not rpmbuild - mostly used for sudo'ing rpmbuild
 # (*) package-BUILD-FROM-SRPM: set this to any non-empty value, if your package is able to produce 
 #     a source rpms by running 'make srpm'
+# (*) package-RPMDATE: set this to any non-empty value to get the rpm package's release field hold the current date
+#     this is useful for container packages, like e.g. bootstrapfs or vserver, that contains much more than the
+#     correspondng module
 #
 #################### modules
 # Required information about the various modules (set this in e.g. planetlab-tags.mk)
@@ -84,7 +87,7 @@
 # (*)  $ make ulogd-pkginfo
 #        to see the list f variables attached to a given package
 # (*)  $ make kernel-devel-rpminfo
-#        to see the list f variables attached to a given rpm
+#        to see the list of variables attached to a given rpm
 #
 ####################
 
@@ -215,17 +218,17 @@ endef
 $(foreach package, $(ALL), $(eval $(call stage1_variables,$(package))))
 
 #
-# for each package, compute whether we need to set date (i.e. whether we use the trunk)
-# the myplc package is forced to have a date, because it is more convenient
-# (we cannot bump its number everytime something changes in the system)
-# myplc-native does not need this trick
+# for each package, compute whether we need to set date 
+# the heuristic is that we mention the date as part of the rpm release flag if
+# (*) the package has requested it by setting package-RPMDATE (container packages should do that)
+# (*) or SVNPATH contains 'trunk' or 'branches' 
 # 
 define package_hasdate
-$(1).has-date = $(if $(subst myplc,,$(1)), \
-                 $(if $($($(1).module)-SVNPATH),\
-                    $(if $(findstring /trunk,$($($(1).module)-SVNPATH)),yes,),\
-                    $(if $(findstring HEAD,$($($(1).module)-TAG)),yes,)), \
-               yes)
+$(1).has-date = $(if $($(1)-RPMDATE),yes, \
+                  $(if $($($(1).module)-SVNPATH), \
+                    $(if $(findstring /trunk,$($($(1).module)-SVNPATH)),yes, \
+                       $(if $(findstring /branches,$($($(1).module)-SVNPATH)),yes,)), \
+                    $(if $(findstring HEAD,$($($(1).module)-TAG)),yes,)))
 endef
 
 $(foreach package, $(ALL), $(eval $(call package_hasdate,$(package))))
@@ -656,7 +659,7 @@ RPMKEYS := rpm-path package
 
 #################### various lists - designed to run with stage1=true
 packages:
-       @$(foreach package,$(ALL), echo package=$(package) ref_module=$($(package).module) modules=$($(package)-MODULES); )
+       @$(foreach package,$(ALL), echo package=$(package) ref_module=$($(package).module) modules=$($(package)-MODULES) rpmnames=$($(package).rpmnames); )
 
 modules:
        @$(foreach module,$(ALL-MODULES), echo module=$(module) svnpath=$($(module)-SVNPATH); )
@@ -737,6 +740,9 @@ help:
        @echo "make ++ALL"
        @echo "  Displays the value of a given variable (here ALL)"
        @echo "  with only a single plus sign only the value is displayed"
+       @echo "make info"
+       @echo "  is equivalent to make packages modules branches"
+       @echo "  provides various info on these objects"
        @echo "make ulogd-pkginfo"
        @echo "  Displays know attributes of a package"
        @echo "make kernel-devel-rpminfo"
index adc8a0f..f5f5e99 100644 (file)
--- a/onelab.mk
+++ b/onelab.mk
@@ -321,6 +321,7 @@ bootcd-RPMBUILD := sudo bash ./rpmbuild.sh
 # package has *some* dependencies, at least these ones
 bootcd-DEPEND-PACKAGES := $(IN_BOOTCD)
 bootcd-DEPEND-FILES := RPMS/yumgroups.xml
+bootcd-RPMDATE := yes
 ALL += bootcd
 IN_MYPLC += bootcd
 
@@ -335,6 +336,7 @@ vserver-RPMBUILD := sudo bash ./rpmbuild.sh
 # always redo all sequentially - try to keep updated
 vserver-DEPEND-PACKAGES := $(IN_VSERVER)
 vserver-DEPEND-FILES := RPMS/yumgroups.xml
+vserver-RPMDATE := yes
 ALL += vserver
 IN_BOOTSTRAPFS += vserver
 
@@ -347,6 +349,7 @@ bootstrapfs-RPMBUILD := sudo bash ./rpmbuild.sh
 # package requires all regular packages
 bootstrapfs-DEPEND-PACKAGES := $(IN_BOOTSTRAPFS)
 bootstrapfs-DEPEND-FILES := RPMS/yumgroups.xml
+bootstrapfs-RPMDATE := yes
 ALL += bootstrapfs
 IN_MYPLC += bootstrapfs
 
@@ -367,6 +370,7 @@ noderepo-DEPEND-PACKAGES := $(IN_BOOTSTRAPFS) $(IN_VSERVER)
 noderepo-DEPEND-FILES := RPMS/yumgroups.xml
 #export rpm list to the specfile
 noderepo-SPECVARS = node_rpms_plus=$(NODEREPO_RPMS_3PLUS)
+noderepo-RPMDATE := yes
 ALL += noderepo
 IN_MYPLC += noderepo
 
@@ -380,6 +384,7 @@ myplc-RPMBUILD := sudo bash ./rpmbuild.sh
 # myplc may require all packages
 myplc-DEPEND-PACKAGES := $(IN_MYPLC)
 myplc-DEPEND-FILES := RPMS/yumgroups.xml myplc-release
+myplc-RPMDATE := yes
 ALL += myplc
 
 #
index de91b8e..5f45c8e 100644 (file)
@@ -299,6 +299,7 @@ bootcd-RPMBUILD := sudo bash ./rpmbuild.sh
 # package has *some* dependencies, at least these ones
 bootcd-DEPEND-PACKAGES := $(IN_BOOTCD)
 bootcd-DEPEND-FILES := RPMS/yumgroups.xml
+bootcd-RPMDATE := yes
 ALL += bootcd
 IN_MYPLC += bootcd
 
@@ -313,6 +314,7 @@ vserver-RPMBUILD := sudo bash ./rpmbuild.sh
 # always redo all sequentially - try to keep updated
 vserver-DEPEND-PACKAGES := $(IN_VSERVER)
 vserver-DEPEND-FILES := RPMS/yumgroups.xml
+vserver-RPMDATE := yes
 ALL += vserver
 IN_BOOTSTRAPFS += vserver
 
@@ -325,6 +327,7 @@ bootstrapfs-RPMBUILD := sudo bash ./rpmbuild.sh
 # package requires all regular packages
 bootstrapfs-DEPEND-PACKAGES := $(IN_BOOTSTRAPFS)
 bootstrapfs-DEPEND-FILES := RPMS/yumgroups.xml
+bootstrapfs-RPMDATE := yes
 ALL += bootstrapfs
 IN_MYPLC += bootstrapfs
 
@@ -345,6 +348,7 @@ noderepo-DEPEND-PACKAGES := $(IN_BOOTSTRAPFS) $(IN_VSERVER)
 noderepo-DEPEND-FILES := RPMS/yumgroups.xml
 #export rpm list to the specfile
 noderepo-SPECVARS = node_rpms_plus=$(NODEREPO_RPMS_3PLUS)
+noderepo-RPMDATE := yes
 ALL += noderepo
 IN_MYPLC += noderepo
 
@@ -358,6 +362,7 @@ myplc-RPMBUILD := sudo bash ./rpmbuild.sh
 # myplc may require all packages
 myplc-DEPEND-PACKAGES := $(IN_MYPLC)
 myplc-DEPEND-FILES := RPMS/yumgroups.xml myplc-release
+myplc-RPMDATE := yes
 ALL += myplc
 
 #