SF.net SVN: gar:[24770] csw/mgar/gar/v2/gar.mk
dmichelsen at users.sourceforge.net
dmichelsen at users.sourceforge.net
Wed Mar 25 16:47:55 CET 2015
Revision: 24770
http://sourceforge.net/p/gar/code/24770
Author: dmichelsen
Date: 2015-03-25 15:47:54 +0000 (Wed, 25 Mar 2015)
Log Message:
-----------
mGAR v2: Substitute vars embedded only in @...@ and not in @@...@@
Modified Paths:
--------------
csw/mgar/gar/v2/gar.mk
Modified: csw/mgar/gar/v2/gar.mk
===================================================================
--- csw/mgar/gar/v2/gar.mk 2015-03-25 13:48:41 UTC (rev 24769)
+++ csw/mgar/gar/v2/gar.mk 2015-03-25 15:47:54 UTC (rev 24770)
@@ -480,12 +480,12 @@
extract-p:
@$(foreach COOKIEFILE,$(EXTRACT_TARGETS), test -e $(COOKIEDIR)/$(COOKIEFILE) ;)
-# The rule takes all files from EXPANDVARS and replaces all occurrences of @<var>@ in the file
+# The rule takes all files from EXPANDVARS and replaces all occurrences of @<var>@ (but not @@<var>@@ as this is used by patch) in the file
# with the values of <var> from the Makefile.
-_var_definitions = $(foreach VAR,$(shell perl -ne 'print "$$1 " while( /@([^@]+)@/g );' <$1),$(VAR)="$($(VAR))")
+_var_definitions = $(foreach VAR,$(shell perl -ne 'print "$$1 " while( /(?<!@)@([^@]+)@(?!@)/g );' <$1),$(VAR)="$($(VAR))")
expandvars-%:
- $(call _var_definitions,$(WORKDIR)/$*) perl -i-unexpanded -npe 's/@([^@]+)@/$$ENV{$$1}/eg' $(WORKDIR)/$*
+ $(call _var_definitions,$(WORKDIR)/$*) perl -i-unexpanded -npe 's/(?<!@)@([^@]+)@(?!@)/$$ENV{$$1}/eg' $(WORKDIR)/$*
@$(MAKECOOKIE)
post-extract-reinplace-%:
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