[csw-devel] SF.net SVN: gar:[6745] csw/mgar/gar/v2-pbuild

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Wed Oct 7 16:04:36 CEST 2009


Revision: 6745
          http://gar.svn.sourceforge.net/gar/?rev=6745&view=rev
Author:   dmichelsen
Date:     2009-10-07 14:04:36 +0000 (Wed, 07 Oct 2009)

Log Message:
-----------
mGAR v2-pbuild: Add setonce-magic to some variables

Modified Paths:
--------------
    csw/mgar/gar/v2-pbuild/gar.mk
    csw/mgar/gar/v2-pbuild/gar.pkg.mk

Modified: csw/mgar/gar/v2-pbuild/gar.mk
===================================================================
--- csw/mgar/gar/v2-pbuild/gar.mk	2009-10-07 13:06:14 UTC (rev 6744)
+++ csw/mgar/gar/v2-pbuild/gar.mk	2009-10-07 14:04:36 UTC (rev 6745)
@@ -33,6 +33,10 @@
 MAKEPATH = $(shell echo $(1) | perl -lne 'print join(":", split)')
 TOLOWER = $(shell echo $(1) | tr '[A-Z]' '[a-z]')
 
+# If you call this the value is only evaluated the first time
+# Usage: $(call SETONCE,A,MyComplexVariableEvaluatedOnlyOnce)
+SETONCE = $(eval $(1) ?= $(2))
+
 #meant to take a git url and return just the $proj.git part
 GITPROJ = $(lastword $(subst /, ,$(1)))
 

Modified: csw/mgar/gar/v2-pbuild/gar.pkg.mk
===================================================================
--- csw/mgar/gar/v2-pbuild/gar.pkg.mk	2009-10-07 13:06:14 UTC (rev 6744)
+++ csw/mgar/gar/v2-pbuild/gar.pkg.mk	2009-10-07 14:04:36 UTC (rev 6745)
@@ -157,7 +157,7 @@
 
 SPKG_DEPEND_DB  = $(GARDIR)/csw/depend.db
 
-SPKG_PKGFILE ?= %{bitname}-%{SPKG_VERSION}%{SPKG_REVSTAMP}-%{SPKG_OSNAME}-%{arch}-$(or $(filter $(call _REVISION),UNCOMMITTED NOTVERSIONED NOSVN),CSW).pkg
+SPKG_PKGFILE ?= %{bitname}-%{SPKG_VERSION},%{SPKG_REVSTAMP}-%{SPKG_OSNAME}-%{arch}-$(or $(filter $(call _REVISION),UNCOMMITTED NOTVERSIONED NOSVN),CSW).pkg
 
 # Handle cswclassutils
 # - prepend cswpreserveconf if it is not already in SPKG_CLASSES
@@ -191,9 +191,9 @@
 endif
 
 ifeq ($(SPKG_FULL_REVSTAMP),1)
-SPKG_REVSTAMP  ?= ,REV=$(shell date '+%Y.%m.%d.%H.%M')
+$(call SETONCE,SPKG_REVSTAMP,REV=$(shell date '+%Y.%m.%d.%H.%M'))
 else
-SPKG_REVSTAMP  ?= ,REV=$(shell date '+%Y.%m.%d')
+$(call SETONCE,SPKG_REVSTAMP,REV=$(shell date '+%Y.%m.%d'))
 endif
 
 # Where we find our mkpackage global templates
@@ -470,7 +470,7 @@
 	$(_DBG)(echo "PKG=$*"; \
 	echo "NAME=$(call catalogname,$*) - $(call pkgvar,SPKG_DESC,$*)"; \
 	echo "ARCH=$(if $(or $(ARCHALL),$(ARCHALL_$*)),all,$(call pkgvar,GARCH,$*))"; \
-	echo "VERSION=$(call pkgvar,SPKG_VERSION,$*)$(call pkgvar,SPKG_REVSTAMP,$*)"; \
+	echo "VERSION=$(call pkgvar,SPKG_VERSION,$*),$(call pkgvar,SPKG_REVSTAMP,$*)"; \
 	echo "CATEGORY=$(call pkgvar,SPKG_CATEGORY,$*)"; \
 	echo "VENDOR=$(call pkgvar,SPKG_VENDOR,$*)"; \
 	echo "EMAIL=$(call pkgvar,SPKG_EMAIL,$*)"; \
@@ -681,7 +681,7 @@
 submitpkg-%:
 	@$(if $(filter $(call _REVISION),UNCOMMITTED NOTVERSIONED NOSVN),\
 		$(error You have local files not in the repository. Please commit everything before submitting a package))
-	$(SVN) -m "$(GARNAME): Tag as release $(SPKG_VERSION)$(SPKG_REVSTAMP)$(if $(filter default,$*),, for project '$*')" cp $(_PKGURL)/trunk $(_PKGURL)/tags/$(if $(filter default,$*),,$*_)$(GARNAME)-$(SPKG_VERSION)$(SPKG_REVSTAMP)
+	$(SVN) -m "$(GARNAME): Tag as release $(SPKG_VERSION),$(SPKG_REVSTAMP)$(if $(filter default,$*),, for project '$*')" cp $(_PKGURL)/trunk $(_PKGURL)/tags/$(if $(filter default,$*),,$*_)$(GARNAME)-$(SPKG_VERSION),$(SPKG_REVSTAMP)
 
 # dependb - update the dependency database
 #


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list