FreeBSD Bugzilla – Attachment 8149 Details for
Bug 17188
make(1) option to reproduce original -V behaviour
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.28 KB, created by
Mark Valentine
on 2000-03-04 21:10:02 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Mark Valentine
Created:
2000-03-04 21:10:02 UTC
Size:
3.28 KB
patch
obsolete
>Index: main.c >=================================================================== >RCS file: /usr/cvs/src/usr.bin/make/main.c,v >retrieving revision 1.35 >diff -u -r1.35 main.c >--- main.c 1999/11/23 10:35:24 1.35 >+++ main.c 2000/03/04 20:32:17 >@@ -122,6 +122,7 @@ > static Boolean noBuiltins; /* -r flag */ > static Lst makefiles; /* ordered list of makefiles to read */ > static Boolean printVars; /* print value of one or more vars */ >+static Boolean expandVars; /* fully expand printed variables */ > static Lst variables; /* list of variables to print */ > int maxJobs; /* -j argument */ > static Boolean forceJobs; /* -j argument given */ >@@ -175,9 +176,9 @@ > > optind = 1; /* since we're called more than once */ > #ifdef REMOTE >-# define OPTFLAGS "BD:E:I:L:PSV:d:ef:ij:km:nqrstv" >+# define OPTFLAGS "BD:E:I:L:PSV:Xd:ef:ij:km:nqrstv" > #else >-# define OPTFLAGS "BD:E:I:PSV:d:ef:ij:km:nqrstv" >+# define OPTFLAGS "BD:E:I:PSV:Xd:ef:ij:km:nqrstv" > #endif > rearg: while((c = getopt(argc, argv, OPTFLAGS)) != -1) { > switch(c) { >@@ -193,15 +194,13 @@ > break; > case 'V': > printVars = TRUE; >- p = malloc(strlen(optarg) + 1 + 3); >- if (!p) >- Punt("make: cannot allocate memory."); >- /* This sprintf is safe, because of the malloc above */ >- (void)sprintf(p, "${%s}", optarg); >- (void)Lst_AtEnd(variables, (ClientData)p); >+ (void)Lst_AtEnd(variables, (ClientData)optarg); > Var_Append(MAKEFLAGS, "-V", VAR_GLOBAL); > Var_Append(MAKEFLAGS, optarg, VAR_GLOBAL); > break; >+ case 'X': >+ expandVars = FALSE; >+ break; > case 'B': > compatMake = TRUE; > Var_Append(MAKEFLAGS, "-B", VAR_GLOBAL); >@@ -619,6 +618,7 @@ > makefiles = Lst_Init(FALSE); > envFirstVars = Lst_Init(FALSE); > printVars = FALSE; >+ expandVars = TRUE; > variables = Lst_Init(FALSE); > beSilent = FALSE; /* Print commands as executed */ > ignoreErrors = FALSE; /* Pay attention to non-zero returns */ >@@ -826,10 +826,21 @@ > > for (ln = Lst_First(variables); ln != NILLNODE; > ln = Lst_Succ(ln)) { >- char *value = Var_Subst(NULL, (char *)Lst_Datum(ln), >- VAR_GLOBAL, FALSE); >- >+ char *value; >+ if (expandVars) { >+ p1 = malloc(strlen((char *)Lst_Datum(ln)) + 1 + 3); >+ if (!p1) >+ Punt("make: cannot allocate memory."); >+ /* This sprintf is safe, because of the malloc above */ >+ (void)sprintf(p1, "${%s}", (char *)Lst_Datum(ln)); >+ value = Var_Subst(NULL, p1, VAR_GLOBAL, FALSE); >+ } else { >+ value = Var_Value((char *)Lst_Datum(ln), >+ VAR_GLOBAL, &p1); >+ } > printf("%s\n", value ? value : ""); >+ if (p1) >+ free(p1); > } > } > >Index: make.1 >=================================================================== >RCS file: /usr/cvs/src/usr.bin/make/make.1,v >retrieving revision 1.27 >diff -u -r1.27 make.1 >--- make.1 2000/01/19 10:44:28 1.27 >+++ make.1 2000/03/04 20:38:03 >@@ -40,7 +40,7 @@ > .Nd maintain program dependencies > .Sh SYNOPSIS > .Nm make >-.Op Fl BPSeiknqrstv >+.Op Fl BPSXeiknqrstv > .Op Fl D Ar variable > .Op Fl d Ar flags > .Op Fl E Ar variable >@@ -212,6 +212,11 @@ > .It Fl v > Be extra verbose. > For multi-job makes, this will cause file banners to be generated. >+.It Fl X >+When using the >+.Fl V >+option to print the values of variables, >+do not recursively expand the values. > .It Ar variable Ns No = Ns Ar value > Set the value of the variable > .Ar variable
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 17188
: 8149