Module Name: src Committed By: rillig Date: Sat Aug 8 13:09:55 UTC 2020
Modified Files: src/usr.bin/make/unit-tests: modmisc.exp modmisc.mk Log Message: make(1): add test for the :gmtime modifier with indirect time To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/usr.bin/make/unit-tests/modmisc.exp cvs rdiff -u -r1.35 -r1.36 src/usr.bin/make/unit-tests/modmisc.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/unit-tests/modmisc.exp diff -u src/usr.bin/make/unit-tests/modmisc.exp:1.37 src/usr.bin/make/unit-tests/modmisc.exp:1.38 --- src/usr.bin/make/unit-tests/modmisc.exp:1.37 Sat Aug 8 13:03:13 2020 +++ src/usr.bin/make/unit-tests/modmisc.exp Sat Aug 8 13:09:55 2020 @@ -107,6 +107,9 @@ mod-gmtime: 2020 %Y %Y +mod-gmtime-indirect: +make: Unknown modifier '1' + mod-localtime: %Y 2020 Index: src/usr.bin/make/unit-tests/modmisc.mk diff -u src/usr.bin/make/unit-tests/modmisc.mk:1.35 src/usr.bin/make/unit-tests/modmisc.mk:1.36 --- src/usr.bin/make/unit-tests/modmisc.mk:1.35 Sat Aug 8 13:03:13 2020 +++ src/usr.bin/make/unit-tests/modmisc.mk Sat Aug 8 13:09:55 2020 @@ -1,4 +1,4 @@ -# $Id: modmisc.mk,v 1.35 2020/08/08 13:03:13 rillig Exp $ +# $Id: modmisc.mk,v 1.36 2020/08/08 13:09:55 rillig Exp $ # # miscellaneous modifier tests @@ -30,6 +30,7 @@ all: mod-quote all: mod-break-many-words all: mod-remember all: mod-gmtime +all: mod-gmtime-indirect all: mod-localtime all: mod-hash all: mod-range @@ -295,6 +296,16 @@ mod-gmtime: @echo ${%Y:L:gmtimer=1593536400} # modifier name too long @echo ${%Y:L:gm=gm:M*} +mod-gmtime-indirect: + @echo $@: + # It's not possible to pass the seconds via a variable expression. + # Parsing of the :gmtime modifier stops at the '$' and returns to + # ApplyModifiers. There, a colon would be skipped but not a dollar. + # Parsing continues by looking at the next modifier. Now the ${:U} + # is expanded and interpreted as a variable modifier, which results + # in the error message "Unknown modifier '1'". + @echo ${%Y:L:gmtime=${:U1593536400}} + mod-localtime: @echo $@: @echo ${%Y:L:localtim=1593536400} # modifier name too short