Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make make(1): move flag runAlways into RunFlags



details:   https://anonhg.NetBSD.org/src/rev/9fb7e85a943e
branches:  trunk
changeset: 957723:9fb7e85a943e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Dec 08 20:04:17 2020 +0000

description:
make(1): move flag runAlways into RunFlags

diffstat:

 usr.bin/make/job.c |  23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diffs (85 lines):

diff -r ef2ace5201e6 -r 9fb7e85a943e usr.bin/make/job.c
--- a/usr.bin/make/job.c        Tue Dec 08 19:58:20 2020 +0000
+++ b/usr.bin/make/job.c        Tue Dec 08 20:04:17 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.347 2020/12/08 19:58:20 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.348 2020/12/08 20:04:17 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
 #include "trace.h"
 
 /*     "@(#)job.c      8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.347 2020/12/08 19:58:20 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.348 2020/12/08 20:04:17 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -222,6 +222,8 @@
 typedef struct RunFlags {
        /* true if we put a no echo command into the command file */
        Boolean silent;
+
+       Boolean always;
 } RunFlags;
 
 /*
@@ -675,14 +677,12 @@
 
 /* Parse leading '@', '-' and '+', which control the exact execution mode. */
 static void
-ParseRunOptions(char **pp,
-               RunFlags *out_runFlags, Boolean *out_errOff,
-               Boolean *out_runAlways)
+ParseRunOptions(char **pp, RunFlags *out_runFlags, Boolean *out_errOff)
 {
        char *p = *pp;
        out_runFlags->silent = FALSE;
        *out_errOff = FALSE;
-       *out_runAlways = FALSE;
+       out_runFlags->always = FALSE;
 
        for (;;) {
                if (*p == '@')
@@ -690,7 +690,7 @@
                else if (*p == '-')
                        *out_errOff = TRUE;
                else if (*p == '+')
-                       *out_runAlways = TRUE;
+                       out_runFlags->always = TRUE;
                else
                        break;
                p++;
@@ -742,9 +742,9 @@
  * it any more complex than it already is?
  */
 static void
-JobPrintSpecialsErrCtl(Job *job, Boolean shutUp)
+JobPrintSpecialsErrCtl(Job *job, Boolean silent)
 {
-       if (!(job->flags & JOB_SILENT) && !shutUp && commandShell->hasEchoCtl) {
+       if (!(job->flags & JOB_SILENT) && !silent && commandShell->hasEchoCtl) {
                JobPrintln(job, commandShell->echoOff);
                JobPrintln(job, commandShell->errOffOrExecIgnore);
                JobPrintln(job, commandShell->echoOn);
@@ -836,7 +836,6 @@
         * and need to turn it back on
         */
        Boolean errOff;
-       Boolean runAlways;
        /* Template to use when printing the command */
        const char *cmdTemplate;
        char *cmdStart;         /* Start of expanded command */
@@ -852,9 +851,9 @@
 
        cmdTemplate = "%s\n";
 
-       ParseRunOptions(&cmd, &runFlags, &errOff, &runAlways);
+       ParseRunOptions(&cmd, &runFlags, &errOff);
 
-       if (runAlways && noSpecials) {
+       if (runFlags.always && noSpecials) {
                /*
                 * We're not actually executing anything...
                 * but this one needs to be - use compat mode just for it.



Home | Main Index | Thread Index | Old Index