NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/41700: :tr modifier for NetBSD make [patch]



 >> Some time ago I proposed to implement a new variable modifier for bmake, :tr
 >> for character substitution in tr(1) manner.
>  
>  This looks OK in princple, but it also needs man page updates and
>  regression tests.

Index: unit-tests/Makefile
===================================================================
RCS file: /cvsroot/src/usr.bin/make/unit-tests/Makefile,v
retrieving revision 1.23
diff -u -r1.23 Makefile
--- unit-tests/Makefile 25 Oct 2008 22:27:39 -0000      1.23
+++ unit-tests/Makefile 11 Jul 2009 12:39:15 -0000
@@ -29,6 +29,7 @@
        modmisc \
        modorder \
        modts \
+       modtr \
        modword \
        posix \
        qequals \
Index: unit-tests/modtr
===================================================================
RCS file: unit-tests/modtr
diff -N unit-tests/modtr
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ unit-tests/modtr    11 Jul 2009 12:39:15 -0000
@@ -0,0 +1,12 @@
+
+LIST= apple 0xf00dbeaf
+
+all:   mod-tr
+
+mod-tr:
+       @echo 'LIST="${LIST}"'
+       @echo 'LIST:tr///="${LIST:tr///}"'
+       @echo 'LIST:tr|abcdef|ABCDEF|="${LIST:tr|abcdef|ABCDEF|}"'
+#      1 is not implemented (yet?)
+#      @echo 'LIST:tr///1="${LIST:tr///1}"'
+#      @echo 'LIST:tr|abcdef|ABCDEF|1="${LIST:tr|abcdef|ABCDEF|1}"'
Index: unit-tests/test.exp
===================================================================
RCS file: /cvsroot/src/usr.bin/make/unit-tests/test.exp,v
retrieving revision 1.27
diff -u -r1.27 test.exp
--- unit-tests/test.exp 3 Feb 2009 23:11:12 -0000       1.27
+++ unit-tests/test.exp 11 Jul 2009 12:39:15 -0000
@@ -147,6 +147,9 @@
 FU_mod-ts="a/b/cool"
 FU_mod-ts:ts:T="cool" == cool?
 B.${AAA:ts}="Baaa" == Baaa?
+LIST="apple 0xf00dbeaf"
+LIST:tr///="apple 0xf00dbeaf"
+LIST:tr|abcdef|ABCDEF|="ApplE 0xF00DBEAF"
 make: Bad modifier `:[]' for LIST
 LIST:[]="" is an error
 LIST:[0]="one two three four five six"

-- 
Best regards, Aleksey Cheusov.


Home | Main Index | Thread Index | Old Index