[Initscripts-ng-commits] r992 - in /trunk/src/insserv/debian: changelog patches/81_lessverbose.patch patches/series
pere at users.alioth.debian.org
pere at users.alioth.debian.org
Wed Sep 9 19:45:00 UTC 2009
Author: pere
Date: Wed Sep 9 19:45:00 2009
New Revision: 992
URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=992
Log:
Drop the Loading... messages from the default verbosity level, and
only show then when -v is used several times.
Added:
trunk/src/insserv/debian/patches/81_lessverbose.patch
Modified:
trunk/src/insserv/debian/changelog
trunk/src/insserv/debian/patches/series
Modified: trunk/src/insserv/debian/changelog
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/changelog?rev=992&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Wed Sep 9 19:45:00 2009
@@ -6,6 +6,8 @@
* Make sure check-initd-order generated valid dotty files when
scripts provide strings with " in them (Closes: #545521). Thanks
to Laurent Bonnaud for discovering the problem.
+ * Drop the Loading... messages from the default verbosity level, and
+ only show then when -v is used several times.
-- Petter Reinholdtsen <pere at debian.org> Tue, 08 Sep 2009 08:51:43 +0200
Added: trunk/src/insserv/debian/patches/81_lessverbose.patch
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/81_lessverbose.patch?rev=992&op=file
==============================================================================
--- trunk/src/insserv/debian/patches/81_lessverbose.patch (added)
+++ trunk/src/insserv/debian/patches/81_lessverbose.patch Wed Sep 9 19:45:00 2009
@@ -1,0 +1,148 @@
+Purpose: Reduce verbosity level (drop Loading... messages)
+Fixes: -
+Status: Not yet submitted upstream.
+---
+
+Index: insserv/listing.h
+===================================================================
+--- insserv.orig/listing.h 2009-09-09 17:31:57.000000000 +0200
++++ insserv/listing.h 2009-09-09 17:33:30.000000000 +0200
+@@ -283,7 +283,7 @@
+ extern const char *const delimeter;
+ extern void error(const char *restrict fmt, ...) attribute((noreturn,format(printf,1,2)));
+ extern void warn (const char *restrict fmt, ...) attribute((format(printf,1,2)));
+-extern void info (const char *restrict fmt, ...) attribute((format(printf,1,2)));
++extern void info (int level, const char *restrict fmt, ...) attribute((format(printf,2,3)));
+ extern inline int map_has_runlevels(void) attribute((always_inline));
+ extern inline char map_runlevel_to_key(const int runlevel);
+ extern inline ushort map_key_to_lvl(const char key);
+@@ -312,23 +312,23 @@
+ (unlinkat(d,x,0) != 0 && (errno != EISDIR || unlinkat(d,x,AT_REMOVEDIR) != 0)))) \
+ warn ("can not remove(%s%s): %s\n", rcd, x, strerror(errno)); \
+ else \
+- info("remove service %s/%s%s\n", path, rcd, x); }))
++ info(1, "remove service %s/%s%s\n", path, rcd, x); }))
+ #else
+ # define xremove(d,x) (__extension__ ({ if ((dryrun ? 0 : (remove(x) != 0))) \
+ warn ("can not remove(%s%s): %s\n", rcd, x, strerror(errno)); \
+ else \
+- info("remove service %s/%s%s\n", path, rcd, x); }))
++ info(1, "remove service %s/%s%s\n", path, rcd, x); }))
+ #endif
+ #if defined(HAS_symlinkat) && defined(_ATFILE_SOURCE)
+ # define xsymlink(d,x,y) (__extension__ ({ if ((dryrun ? 0 : (symlinkat(x, d, y) != 0))) \
+ warn ("can not symlink(%s, %s%s): %s\n", x, rcd, y, strerror(errno)); \
+ else \
+- info("enable service %s -> %s/%s%s\n", x, path, rcd, y); }))
++ info(1, "enable service %s -> %s/%s%s\n", x, path, rcd, y); }))
+ #else
+ # define xsymlink(d,x,y) (__extension__ ({ if ((dryrun ? 0 : (symlink(x, y) != 0))) \
+ warn ("can not symlink(%s, %s%s): %s\n", x, rcd, y, strerror(errno)); \
+ else \
+- info("enable service %s -> %s/%s%s\n", x, path, rcd, y); }))
++ info(1, "enable service %s -> %s/%s%s\n", x, path, rcd, y); }))
+ #endif
+ #if defined(HAS_fstatat) && defined(_ATFILE_SOURCE)
+ # define xstat(d,x,s) (__extension__ ({ fstatat(d,x,s, 0); }))
+Index: insserv/insserv.c
+===================================================================
+--- insserv.orig/insserv.c 2009-09-09 17:33:18.000000000 +0200
++++ insserv/insserv.c 2009-09-09 17:33:34.000000000 +0200
+@@ -112,8 +112,8 @@
+ /* The main line buffer if unique */
+ static char buf[LINE_MAX];
+
+-/* When to be verbose */
+-static boolean verbose = false;
++/* When to be verbose, and what level of verbosity */
++static int verbose = 0;
+
+ /* When to be verbose */
+ static boolean dryrun = false;
+@@ -688,9 +688,9 @@
+
+ if (dryrun) {
+ #ifdef USE_KILL_IN_BOOT
+- info("dryrun, not creating .depend.boot, .depend.start, .depend.halt, and .depend.stop\n");
++ info(1, "dryrun, not creating .depend.boot, .depend.start, .depend.halt, and .depend.stop\n");
+ #else /* not USE_KILL_IN_BOOT */
+- info("dryrun, not creating .depend.boot, .depend.start, and .depend.stop\n");
++ info(1, "dryrun, not creating .depend.boot, .depend.start, and .depend.stop\n");
+ #endif /* not USE_KILL_IN_BOOT */
+ return;
+ }
+@@ -705,8 +705,8 @@
+ return;
+ }
+
+- info("creating .depend.boot\n");
+- info("creating .depend.start\n");
++ info(1, "creating .depend.boot\n");
++ info(1, "creating .depend.start\n");
+
+ lsort('S'); /* Sort into start order, set new sorder */
+
+@@ -872,9 +872,9 @@
+ return;
+ }
+
+- info("creating .depend.halt\n");
++ info(1, "creating .depend.halt\n");
+ #endif /* USE_KILL_IN_BOOT */
+- info("creating .depend.stop\n");
++ info(1, "creating .depend.stop\n");
+
+ lsort('K'); /* Sort into stop order, set new korder */
+
+@@ -1012,9 +1012,9 @@
+ /*
+ * Print message when verbose is enabled
+ */
+-void info(const char *fmt, ...) {
++void info(int level, const char *fmt, ...) {
+ va_list ap;
+- if (!verbose)
++ if (level > verbose)
+ goto out;
+ va_start(ap, fmt);
+ _logger(fmt, ap);
+@@ -1060,7 +1060,7 @@
+
+ if (stat(rcpath, &st) < 0) {
+ if (errno == ENOENT) {
+- info("creating directory '%s'\n", rcpath);
++ info(1, "creating directory '%s'\n", rcpath);
+ if (!dryrun)
+ mkdir(rcpath, (S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH));
+ } else
+@@ -1185,7 +1185,7 @@
+ #define description script_inf.description
+ #define interactive script_inf.interactive
+
+- info("Loading %s\n", path);
++ info(2, "Loading %s\n", path);
+
+ if ((fd = xopen(dfd, path, o_flags)) < 0 || (script = fdopen(fd, "r")) == (FILE*)0)
+ error("fopen(%s): %s\n", path, strerror(errno));
+@@ -1826,7 +1826,7 @@
+ regmatch_t subloc[SUBCONFNUM], *val = (regmatch_t*)0;
+ FILE *conf;
+
+- info("Loading %s\n", file);
++ info(2, "Loading %s\n", file);
+
+ do {
+ const char * fptr = file;
+@@ -2290,10 +2290,10 @@
+ ignore = true;
+ break;
+ case 'v':
+- verbose = true;
++ verbose ++;
+ break;
+ case 'n':
+- verbose = true;
++ verbose ++;
+ dryrun = true;
+ break;
+ case 'p':
Modified: trunk/src/insserv/debian/patches/series
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/series?rev=992&op=diff
==============================================================================
--- trunk/src/insserv/debian/patches/series (original)
+++ trunk/src/insserv/debian/patches/series Wed Sep 9 19:45:00 2009
@@ -10,6 +10,7 @@
70_req_start_all_depends.patch
71_complete_makefile.patch
80_manual_warnings.patch
+81_lessverbose.patch
90_no_runlevel_spec_for_debian.patch
91_kfreebsd_nofadvice.patch
92_m68k_alignment.patch
More information about the Initscripts-ng-commits
mailing list