[Initscripts-ng-commits] r443 - in /trunk/src/insserv/debian: changelog patches/21_overrides.dpatch patches/41_debiandefault.dpatch

pere at users.alioth.debian.org pere at users.alioth.debian.org
Fri Jan 4 16:00:20 UTC 2008


Author: pere
Date: Fri Jan  4 16:00:20 2008
New Revision: 443

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=443
Log:
  * UNRELEASED.
  * Reduce the redundant warnings in the override patch.
  * Changed patch 21_overrides to only warn once about scripts without
    LSB header.
  * Moved default dependencies from patch 21_overrides to
    41_debiandefault where it belong.

Modified:
    trunk/src/insserv/debian/changelog
    trunk/src/insserv/debian/patches/21_overrides.dpatch
    trunk/src/insserv/debian/patches/41_debiandefault.dpatch

Modified: trunk/src/insserv/debian/changelog
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/changelog?rev=443&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Fri Jan  4 16:00:20 2008
@@ -1,3 +1,15 @@
+insserv (1.09.0-14) unstable; urgency=low
+
+  * UNRELEASED.
+
+  * Reduce the redundant warnings in the override patch.
+  * Changed patch 21_overrides to only warn once about scripts without
+    LSB header.
+  * Moved default dependencies from patch 21_overrides to
+    41_debiandefault where it belong.
+
+ -- Petter Reinholdtsen <pere at debian.org>  Fri,  4 Jan 2008 16:41:28 +0100
+
 insserv (1.09.0-13) unstable; urgency=low
 
   * Update patch 21_overrides to fix bug in override handling.  Now a

Modified: trunk/src/insserv/debian/patches/21_overrides.dpatch
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/21_overrides.dpatch?rev=443&op=diff
==============================================================================
--- trunk/src/insserv/debian/patches/21_overrides.dpatch (original)
+++ trunk/src/insserv/debian/patches/21_overrides.dpatch Fri Jan  4 16:00:20 2008
@@ -7,8 +7,8 @@
 
 @DPATCH@
 diff -urNad insserv~/insserv.c insserv/insserv.c
---- insserv~/insserv.c	2008-01-04 11:21:58.000000000 +0100
-+++ insserv/insserv.c	2008-01-04 11:21:58.000000000 +0100
+--- insserv~/insserv.c	2008-01-04 16:43:37.000000000 +0100
++++ insserv/insserv.c	2008-01-04 16:45:30.000000000 +0100
 @@ -23,6 +23,7 @@
  #include <fcntl.h>
  #include <sys/stat.h>
@@ -27,7 +27,7 @@
  #ifndef  INSCONF
  # define INSCONF	"/etc/insserv.conf"
  #endif
-@@ -998,7 +1002,21 @@
+@@ -998,7 +1004,21 @@
      regcompiler(&reg.desc,      DESCRIPTION,    REG_EXTENDED|REG_ICASE|REG_NEWLINE);
  }
  
@@ -50,7 +50,7 @@
  {
      regmatch_t subloc[SUBNUM_SHD+1], *val = &subloc[SUBNUM-1], *shl = &subloc[SUBNUM_SHD-1];
      FILE *script;
-@@ -1022,25 +1040,18 @@
+@@ -1022,25 +1042,18 @@
      if (!script)
  	error("fopen(%s): %s\n", path, strerror(errno));
  
@@ -82,7 +82,7 @@
  
  	if (!provides       && regexecutor(&reg.prov,      COMMON_ARGS) == true) {
  	    if (val->rm_so < val->rm_eo) {
-@@ -1169,10 +1180,104 @@
+@@ -1169,7 +1182,94 @@
  #undef default_start
  #undef default_stop
  #undef description
@@ -148,46 +148,36 @@
 +    if (0 == stat(fullpath, &statbuf) && S_ISREG(statbuf.st_mode)) {
 +        ret = scan_lsb_headers(fullpath);
 +    }
++    return ret;
++}
++
++#define FOUND_LSB_HEADER   0x01
++#define FOUND_LSB_DEFAULT  0x02
++#define FOUND_LSB_OVERRIDE 0x02
++
++static boolean scan_script_defaults(const char *const path, const char *const override_path)
++{
++    int ret = 0;
++    char *name = scriptname(path);
++
++    /* Reset old results */
++    scan_script_reset();
++
++    /* Load values if the override file exist */
++    ret |= load_overrides("/usr/share/insserv/overrides", name);
++
++    /* Replace with headers from the script itself */
++    ret |= scan_lsb_headers(path);
++
++    /* Allow host-specific overrides to replace the content in the
++       init.d scripts */
++    ret |= load_overrides(override_path, name);
++
++    free(name);
      return ret;
  }
  
-+static boolean scan_script_defaults(const char *const path, const char *const override_path)
-+{
-+    boolean ret = 0;
-+    boolean override = 0;
-+    char *name = scriptname(path);
-+
-+    /* Reset old results */
-+    scan_script_reset();
-+
-+    /* Load values if the override file exist */
-+    override = load_overrides("/usr/share/insserv/overrides", name);
-+
-+    /* Replace with headers from the script itself */
-+    ret = scan_lsb_headers(path);
-+
-+    /* Allow host-specific overrides to replace the content in the
-+       init.d scripts */
-+    override |= load_overrides(override_path, name);
-+
-+    if (!ret) {
-+        warn("warning: script '%s' missing LSB tags\n", path);
-+	if (!override) {
-+	  warn("warning: script '%s' missing override too\n", name);
-+	  script_inf.required_start = xstrdup("$remote_fs $syslog");
-+	  script_inf.required_stop = xstrdup("$remote_fs $syslog");
-+	  script_inf.default_start = xstrdup(DEFAULT_START_LVL);
-+	  script_inf.default_stop = xstrdup(DEFAULT_STOP_LVL);
-+	}
-+    }
-+    free(name);
-+    return ret | override;
-+}
-+
- static inline void scan_script_regfree()
- {
-     regfree(&reg.prov);
-@@ -1237,7 +1342,7 @@
+@@ -1237,7 +1337,7 @@
  /*
   * Scan current service structure
   */
@@ -196,16 +186,37 @@
  {
      int runlevel;
  
-@@ -1274,7 +1379,7 @@
+@@ -1274,10 +1374,12 @@
  		continue;
  	    }
  
 -	    lsb = scan_script_defaults(d->d_name);
 +	    lsb = scan_script_defaults(d->d_name, override_path);
++
  	    if (!script_inf.provides || script_inf.provides == empty)
  		script_inf.provides = xstrdup(ptr);
  
-@@ -1325,16 +1430,7 @@
++
+ 	    begin = script_inf.provides;
+ 	    while ((token = strsep(&script_inf.provides, delimeter)) && *token) {
+ 		serv_t * service = NULL;
+@@ -1293,6 +1401,15 @@
+ 
+ 		if (!lsb)
+ 		    service->opts |= SERV_NOTLSB;
++
++		if (! (lsb & FOUND_LSB_HEADER) ) {
++		    if (! (lsb & (FOUND_LSB_DEFAULT | FOUND_LSB_OVERRIDE) ))
++		      warn("warning: script '%s' missing LSB tags and overrides\n",
++			   d->d_name);
++		    else
++  		        warn("warning: script '%s' missing LSB tags\n",
++			     d->d_name);
++		}
+ 		if (script_inf.required_start && script_inf.required_start != empty) {
+ 		    rememberreq(service, REQ_MUST, script_inf.required_start);
+ 		    requiresv(token, script_inf.required_start);
+@@ -1325,16 +1442,7 @@
  	    }
  	    script_inf.provides = begin;
  
@@ -223,7 +234,7 @@
  	}
  	popd();
  	closedir(rcdir);
-@@ -1561,6 +1657,7 @@
+@@ -1561,6 +1669,7 @@
      {"remove",	0, NULL, 'r'},
      {"force",	0, NULL, 'f'},
      {"path",	1, NULL, 'p'},
@@ -231,7 +242,7 @@
      {"help",	0, NULL, 'h'},
      { 0,	0, NULL,  0 },
  };
-@@ -1574,6 +1671,7 @@
+@@ -1574,6 +1683,7 @@
      printf("  -f, --force      Ignore if a required service is missed.\n");
      printf("  -v, --verbose    Provide information on what is being done.\n");
      printf("  -p <path>, --path <path>  Path to replace " INITDIR ".\n");
@@ -239,7 +250,7 @@
      printf("  -c <config>, --config <config>  Path to config file.\n");
      printf("  -n, --dryrun     Do not change the system, only talk about it.\n");
      printf("  -d, --default    Use default runlevels a defined in the scripts\n");
-@@ -1590,6 +1688,7 @@
+@@ -1590,6 +1700,7 @@
      struct stat st_script;
      char * argr[argc];
      char * path = INITDIR;
@@ -247,7 +258,7 @@
      char * insconf = INSCONF;
      int runlevel, c;
      boolean del = false;
-@@ -1601,7 +1700,7 @@
+@@ -1601,7 +1712,7 @@
      for (c = 0; c < argc; c++)
  	argr[c] = NULL;
  
@@ -256,7 +267,7 @@
  	switch (c) {
  	    case 'c':
  		insconf = optarg;
-@@ -1625,6 +1724,9 @@
+@@ -1625,6 +1736,9 @@
  	    case 'p':
  		path = optarg;
  		break;
@@ -266,7 +277,7 @@
  	    case '?':
  		error("For help use: %s -h\n", myname);
  	    case 'h':
-@@ -1736,7 +1838,7 @@
+@@ -1736,7 +1850,7 @@
  #if 0
      if (!defaults)
  #endif
@@ -275,16 +286,25 @@
  
      if ((initdir = opendir(path)) == NULL)
  	error("can not opendir(%s): %s\n", path, strerror(errno));
-@@ -1823,7 +1925,7 @@
+@@ -1823,7 +1937,16 @@
  	}
  
  	/* main scanner for LSB comment in current script */
 -	lsb = scan_script_defaults(d->d_name);
 +	lsb = scan_script_defaults(d->d_name, override_path);
++
++	if (! (lsb & FOUND_LSB_HEADER) ) {
++	    if (! (lsb & (FOUND_LSB_DEFAULT | FOUND_LSB_OVERRIDE) ))
++	        warn("warning: script '%s' missing LSB tags and overrides\n",
++		     d->d_name);
++	    else
++	        warn("warning: script '%s' missing LSB tags\n",
++		     d->d_name);
++	}
  
  	/* Common script ... */
  	if (!strcmp(d->d_name, "halt")) {
-@@ -2175,16 +2277,7 @@
+@@ -2175,16 +2305,7 @@
  	    service->opts |= SERV_NOTLSB;
      }
      /* Reset remaining pointers */

Modified: trunk/src/insserv/debian/patches/41_debiandefault.dpatch
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/41_debiandefault.dpatch?rev=443&op=diff
==============================================================================
--- trunk/src/insserv/debian/patches/41_debiandefault.dpatch (original)
+++ trunk/src/insserv/debian/patches/41_debiandefault.dpatch Fri Jan  4 16:00:20 2008
@@ -6,9 +6,9 @@
 
 @DPATCH@
 diff -urNad insserv~/insserv.c insserv/insserv.c
---- insserv~/insserv.c	2008-01-04 11:22:07.000000000 +0100
-+++ insserv/insserv.c	2008-01-04 11:22:07.000000000 +0100
-@@ -37,6 +37,14 @@
+--- insserv~/insserv.c	2008-01-04 16:54:52.000000000 +0100
++++ insserv/insserv.c	2008-01-04 16:56:22.000000000 +0100
+@@ -37,6 +37,15 @@
  static const int map_runlevel_to_seek(const int runlevel);
  #endif /* not SUSE */
  
@@ -18,12 +18,40 @@
 +/* for Debian*/
 +#define DEFAULT_START_LVL "2 3 4 5"
 +#define DEFAULT_STOP_LVL  "0 1 6"
++#define DEFAULT_DEPENDENCY "$remote_fs $syslog"
 +#endif
 +
  #ifndef  INITDIR
  # define INITDIR	"/etc/init.d"
  #endif
-@@ -2162,7 +2170,7 @@
+@@ -1377,6 +1386,12 @@
+ 	    if (!script_inf.provides || script_inf.provides == empty)
+ 		script_inf.provides = xstrdup(ptr);
+ 
++	    if (!lsb) {
++	        script_inf.required_start = xstrdup(DEFAULT_DEPENDENCY);
++		script_inf.required_stop = xstrdup(DEFAULT_DEPENDENCY);
++		script_inf.default_start = xstrdup(DEFAULT_START_LVL);
++		script_inf.default_stop = xstrdup(DEFAULT_STOP_LVL);
++	    }
+ 
+ 	    begin = script_inf.provides;
+ 	    while ((token = strsep(&script_inf.provides, delimeter)) && *token) {
+@@ -1968,6 +1983,13 @@
+ 	}
+ #endif /* SUSE */
+ 
++	if (!lsb) {
++	    script_inf.required_start = xstrdup(DEFAULT_DEPENDENCY);
++	    script_inf.required_stop = xstrdup(DEFAULT_DEPENDENCY);
++	    script_inf.default_start = xstrdup(DEFAULT_START_LVL);
++	    script_inf.default_stop = xstrdup(DEFAULT_STOP_LVL);
++	}
++
+ 	/*
+ 	 * Oops, no comment found, guess one
+ 	 */
+@@ -2175,7 +2197,7 @@
  			    /*
  			     * Ahh ... set default multiuser with network
  			     */
@@ -32,7 +60,7 @@
  		    }
  #ifndef SUSE
  		    /*
-@@ -2208,15 +2216,12 @@
+@@ -2221,15 +2243,12 @@
  	    free(begin);
  	}
  




More information about the Initscripts-ng-commits mailing list