diff --git a/usr.sbin/config/config.8 b/usr.sbin/config/config.8 index 4468ba15a4c..14e308dc202 100644 --- a/usr.sbin/config/config.8 +++ b/usr.sbin/config/config.8 @@ -40,7 +40,7 @@ .Nd build system configuration files .Sh SYNOPSIS .Nm -.Op Fl gpr +.Op Fl gp .Op Fl d Ar destdir .Ar SYSTEM_NAME .Sh DESCRIPTION @@ -93,8 +93,6 @@ If two or more options are supplied, .Nm configures a system for high resolution profiling. -.It Fl r -Remove the old compile directory (see below). .It Ar SYSTEM_NAME Specify the name of the system configuration file containing device specifications, configuration options @@ -117,9 +115,6 @@ or the one given with the .Fl d option as necessary and places all output files there. -If the output directory already exists and the -.Fl r -flag was specified, it will be removed first. The output of .Nm consists of a number of files; for the diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y index 03545272341..9fde7001c3d 100644 --- a/usr.sbin/config/config.y +++ b/usr.sbin/config/config.y @@ -165,7 +165,7 @@ Config_spec: System_spec: CONFIG System_id System_parameter_list - = { warnx("line %d: root/dump/swap specifications obsolete", yyline);} + = { errx(1, "line %d: root/dump/swap specifications obsolete", yyline);} | CONFIG System_id ; @@ -209,11 +209,8 @@ Option: */ op->op_line = yyline; opt = op; - if ((s = strchr(op->op_name, '='))) { - warnx("line %d: The `=' in options should not be quoted", yyline); - *s = '\0'; - op->op_value = ns(s + 1); - } + if ((s = strchr(op->op_name, '='))) + errx(1, "line %d: The `=' in options should not be quoted", yyline); } | Save_id EQUALS Opt_value = { @@ -295,7 +292,7 @@ Device_spec: cur.d_name = $2; cur.d_count = $3; if (cur.d_count == 0) - warnx("line %d: devices with zero units are not likely to be correct", yyline); + errx(1, "line %d: devices with zero units are not likely to be correct", yyline); } ; %% @@ -304,7 +301,7 @@ static void yyerror(char *s) { - warnx("line %d: %s", yyline + 1, s); + errx(1, "line %d: %s", yyline + 1, s); } /* diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c index 9850a29cf76..638e04e47a5 100644 --- a/usr.sbin/config/main.c +++ b/usr.sbin/config/main.c @@ -72,7 +72,6 @@ char * PREFIX; char destdir[MAXPATHLEN]; char srcdir[MAXPATHLEN]; -static int no_config_clobber = TRUE; int debugging; int profiling; @@ -92,7 +91,7 @@ main(int argc, char **argv) int ch, len; char *p; - while ((ch = getopt(argc, argv, "d:gprn")) != -1) + while ((ch = getopt(argc, argv, "d:gp")) != -1) switch (ch) { case 'd': if (*destdir == '\0') @@ -106,14 +105,6 @@ main(int argc, char **argv) case 'p': profiling++; break; - case 'n': - /* no_config_clobber is now true by default, no-op */ - fprintf(stderr, - "*** Using obsolete config option '-n' ***\n"); - break; - case 'r': - no_config_clobber = FALSE; - break; case '?': default: usage(); @@ -142,23 +133,8 @@ main(int argc, char **argv) if (mkdir(p, 0777)) err(2, "%s", p); } - else if ((buf.st_mode & S_IFMT) != S_IFDIR) { + else if ((buf.st_mode & S_IFMT) != S_IFDIR) errx(2, "%s isn't a directory", p); - } - else if (!no_config_clobber) { - char tmp[strlen(p) + 8]; - - fprintf(stderr, "Removing old directory %s: ", p); - fflush(stderr); - snprintf(tmp, sizeof(tmp), "rm -rf %s", p); - if (system(tmp)) { - fprintf(stderr, "Failed!\n"); - err(2, "%s", tmp); - } - fprintf(stderr, "Done.\n"); - if (mkdir(p, 0777)) - err(2, "%s", p); - } dtab = NULL; if (yyparse()) @@ -214,7 +190,7 @@ get_srcdir(void) static void usage(void) { - fprintf(stderr, "usage: config [-gpr] [-d destdir] sysname\n"); + fprintf(stderr, "usage: config [-gp] [-d destdir] sysname\n"); exit(1); } diff --git a/usr.sbin/config/mkheaders.c b/usr.sbin/config/mkheaders.c index 7210491cdbb..9b44da40a54 100644 --- a/usr.sbin/config/mkheaders.c +++ b/usr.sbin/config/mkheaders.c @@ -77,7 +77,7 @@ headers(void) for (dp = dtab; dp != 0; dp = dp->d_next) { if ((dp->d_type & TYPEMASK) == DEVICE) { if (!(dp->d_type & DEVDONE)) - printf("Warning: device \"%s\" is unknown\n", + errx(1, "Error: device \"%s\" is unknown", dp->d_name); } } diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c index 1953b1a4b14..5dc889cf627 100644 --- a/usr.sbin/config/mkmakefile.c +++ b/usr.sbin/config/mkmakefile.c @@ -190,7 +190,7 @@ makefile(void) else if (strncmp(line, "%VERSREQ=", sizeof("%VERSREQ=") - 1) == 0) { versreq = atoi(line + sizeof("%VERSREQ=") - 1); if (versreq != CONFIGVERS) { - fprintf(stderr, "WARNING: version of config(8) does not match kernel!\n"); + fprintf(stderr, "ERROR: version of config(8) does not match kernel!\n"); fprintf(stderr, "config version = %d, ", CONFIGVERS); fprintf(stderr, "version required = %d\n\n", versreq); fprintf(stderr, "Make sure that /usr/src/usr.sbin/config is in sync\n"); @@ -200,6 +200,7 @@ makefile(void) fprintf(stderr, "file against the GENERIC or LINT config files for\n"); fprintf(stderr, "changes in config syntax, or option/device naming\n"); fprintf(stderr, "conventions\n\n"); + exit(1); } } else fprintf(stderr,