DragonFly BSD
DragonFly submit List (threaded) for 2004-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

tiny improvement to config(8)


From: Chris Pressey <cpressey@xxxxxxxxxxxxxxx>
Date: Sat, 6 Mar 2004 13:52:56 -0800

'lo all,

The attached patch makes an ever-so-tiny improvement to config(8):
it adds a -q ("quiet") flag which suppresses reminder messages.

The idea is that the message "Don't forget to do a ``make depend''" is
(at best) redundant and (at worst) confusing, when using the "new"
kernel building method (which is virtually standard nowadays.)

To try it, you can run

  make buildkernel KERNCONF=FOO CONFIGARGS="-q"

This is working fine for me, and the patch is so simple, I am fairly
confident there are no errors in it.

I'm planning to do much more intensive work on config(8) soon, I'll post
to the kernel list later today detailing my plans.

-Chris
diff -ruN /root/config3/config.8 config/config.8
--- /root/config3/config.8	Sat Mar  6 13:21:45 2004
+++ config/config.8	Sat Mar  6 13:26:53 2004
@@ -41,7 +41,7 @@
 .Nd build system configuration files
 .Sh SYNOPSIS
 .Nm
-.Op Fl gpr
+.Op Fl gpqr
 .Op Fl d Ar destdir
 .Ar SYSTEM_NAME
 .Sh DESCRIPTION
@@ -98,6 +98,8 @@
 options are supplied,
 .Nm
 configures a system for high resolution profiling.
+.It Fl q
+Do not print reminder messages.
 .It Fl r
 Remove the old compile directory (see below).
 .It Ar SYSTEM_NAME
@@ -149,7 +151,9 @@
 was created.
 The
 .Nm
-utility prints a reminder of this when it completes.
+utility prints a reminder of this when it completes, unless the
+.Fl q
+flag was specified.
 .Pp
 If any other error messages are produced by
 .Nm ,
diff -ruN /root/config3/config.h config/config.h
--- /root/config3/config.h	Sat Mar  6 13:21:45 2004
+++ config/config.h	Sat Mar  6 13:24:11 2004
@@ -163,6 +163,7 @@
 
 extern int	profiling;
 extern int	debugging;
+extern int	quiet;
 
 extern int	maxusers;
 
diff -ruN /root/config3/main.c config/main.c
--- /root/config3/main.c	Sat Mar  6 13:21:45 2004
+++ config/main.c	Sat Mar  6 13:24:29 2004
@@ -64,8 +64,9 @@
 char 	srcdir[MAXPATHLEN];
 
 static int no_config_clobber = TRUE;
-int	debugging;
-int	profiling;
+int	debugging = 0;
+int	profiling = 0;
+int	quiet = 0;
 
 static void configfile(void);
 static void get_srcdir(void);
@@ -84,7 +85,7 @@
 	char linksrc[64], linkdest[MAXPATHLEN];
 	static char *emus[] = { "linux", "svr4" };
 
-	while ((ch = getopt(argc, argv, "d:gprn")) != -1)
+	while ((ch = getopt(argc, argv, "d:gpqrn")) != -1)
 		switch (ch) {
 		case 'd':
 			if (*destdir == '\0')
@@ -98,6 +99,9 @@
 		case 'p':
 			profiling++;
 			break;
+		case 'q':
+			quiet++;
+			break;
 		case 'n':
 			/* no_config_clobber is now true by default, no-op */
 			fprintf(stderr,
@@ -208,7 +212,8 @@
 	makefile();			/* build Makefile */
 	headers();			/* make a lot of .h files */
 	configfile();			/* put config file into kernel*/
-	printf("Kernel build directory is %s\n", p);
+	if (quiet == 0)
+		printf("Kernel build directory is %s\n", p);
 	exit(EX_OK);
 }
 
@@ -229,7 +234,7 @@
 usage(void)
 {
 	
-	fprintf(stderr, "usage: config [-gpr] [-d destdir] sysname\n");
+	fprintf(stderr, "usage: config [-gpqr] [-d destdir] sysname\n");
 	exit(1);
 }
 
diff -ruN /root/config3/mkmakefile.c config/mkmakefile.c
--- /root/config3/mkmakefile.c	Sat Mar  6 13:21:45 2004
+++ config/mkmakefile.c	Sat Mar  6 13:25:15 2004
@@ -218,7 +218,8 @@
 	fclose(ofp);
 	moveifchanged(path("Makefile.new"), path("Makefile"));
 
-	printf("Don't forget to do a ``make depend''\n");
+	if (quiet == 0)
+		printf("Don't forget to do a ``make depend''\n");
 }
 
 /*


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