From d81f04d7fa86567e9742fb4970879179ed1d6cd5 Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Wed, 30 May 2012 22:23:08 +0000 Subject: [PATCH] Deprecate the FreeBSD make's ":U" (to-upper case) and ":L" (to-lower case) modifiers for ":tu" and ":tl" from OSF's ODE, which made its way into NetBSD's make, which is the source for the Portable Berkeley Make. Submitted by: Simon Gerraty --- usr.bin/make/Makefile | 2 +- usr.bin/make/make.1 | 19 +++++++++++++++++++ usr.bin/make/var.c | 15 +++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/usr.bin/make/Makefile b/usr.bin/make/Makefile index 670e524ba6f2..9afaa5721fdd 100644 --- a/usr.bin/make/Makefile +++ b/usr.bin/make/Makefile @@ -15,7 +15,7 @@ NO_SHARED?= YES .endif # Version has the RYYYYMMDDX format, where R is from RELENG_ -CFLAGS+=-DMAKE_VERSION=\"5201111300\" +CFLAGS+=-DMAKE_VERSION=\"10201120530\" # There is no obvious performance improvement currently. # CFLAGS+=-DUSE_KQUEUE diff --git a/usr.bin/make/make.1 b/usr.bin/make/make.1 index 80216b4189c1..fc91f3c95f7d 100644 --- a/usr.bin/make/make.1 +++ b/usr.bin/make/make.1 @@ -902,6 +902,7 @@ Replaces each word in the variable with its suffix. Replaces each word in the variable with everything but the last component. .It Cm :L Converts variable to lower-case letters. +(deprecated) .It Cm :M Ns Ar pattern Select only those words that match the rest of the modifier. The standard shell wildcard characters @@ -993,8 +994,13 @@ to be replaced in .Ar new_string . .It Cm :T Replaces each word in the variable with its last component. +.It Cm :tl +Converts variable to lower-case letters. +.It Cm :tu +Converts variable to upper-case letters. .It Cm :U Converts variable to upper-case letters. +(deprecated) .It Cm :u Remove adjacent duplicate words (like .Xr uniq 1 ) . @@ -1742,6 +1748,19 @@ is set to the same value as .Va .MAKE ; support for this may be removed in the future. .Pp +The use of the +.Cm :L +and +.Cm :U +modifiers are deprecated +in +.Fx 10.0 +and the more portable (among Pmake decedents) +.Cm :tl +and +.Cm :tu +should be used instead. +.Pp Most of the more esoteric features of .Nm should probably be avoided for greater compatibility. diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index a7babaf259e2..341ee79b16b6 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -1746,6 +1746,19 @@ ParseModifier(VarParser *vp, char startc, Var *v, Boolean *freeResult) case 'C': newStr = modifier_C(vp, value, v); break; + case 't': + /* :tl :tu for OSF ODE & NetBSD make compatibility */ + switch (vp->ptr[1]) { + case 'l': + vp->ptr++; + goto mod_lower; + break; + case 'u': + vp->ptr++; + goto mod_upper; + break; + } + /* FALLTHROUGH */ default: if (vp->ptr[1] != endc && vp->ptr[1] != ':') { #ifdef SUNSHCMD @@ -1774,6 +1787,7 @@ ParseModifier(VarParser *vp, char startc, Var *v, Boolean *freeResult) switch (vp->ptr[0]) { case 'L': + mod_lower: { const char *cp; Buffer *buf; @@ -1799,6 +1813,7 @@ ParseModifier(VarParser *vp, char startc, Var *v, Boolean *freeResult) vp->ptr++; break; case 'U': + mod_upper: { const char *cp; Buffer *buf;