[Initscripts-ng-commits] r374 - in /trunk/src/insserv/debian: changelog patches/20_overrides.dpatch run-testsuite
pere at users.alioth.debian.org
pere at users.alioth.debian.org
Mon Dec 31 14:28:44 UTC 2007
Author: pere
Date: Mon Dec 31 14:28:44 2007
New Revision: 374
URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=374
Log:
Add patch from Otavio with a fix, and more tests.
Modified:
trunk/src/insserv/debian/changelog
trunk/src/insserv/debian/patches/20_overrides.dpatch
trunk/src/insserv/debian/run-testsuite
Modified: trunk/src/insserv/debian/changelog
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/changelog?rev=374&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Mon Dec 31 14:28:44 2007
@@ -1,6 +1,8 @@
insserv (1.09.0-8) unstable; urgency=low
* UNRELEASED
+
+ [ Petter Reinholdtsen ]
* Removed override files cpqarrayd, hotkey-setup and spamassassin as
they are equivalent with the defaults compiled into insserv.
* Removed override files courier-ldap, courier-authdaemon,
@@ -12,7 +14,11 @@
* Added patch 11_revdepend fetched from a review copy of version
1.10. Based on changes from Werner Fink.
- -- Petter Reinholdtsen <pere at debian.org> Sun, 30 Dec 2007 20:48:47 +0100
+ [ Otavio Salvador ]
+ * Extended patch 20_override to allow override path changing so the unit
+ test can use it.
+
+ -- Otavio Salvador <otavio at ossystems.com.br> Mon, 31 Dec 2007 12:07:55 -0200
insserv (1.09.0-7) unstable; urgency=low
Modified: trunk/src/insserv/debian/patches/20_overrides.dpatch
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/20_overrides.dpatch?rev=374&op=diff
==============================================================================
--- trunk/src/insserv/debian/patches/20_overrides.dpatch (original)
+++ trunk/src/insserv/debian/patches/20_overrides.dpatch Mon Dec 31 14:28:44 2007
@@ -6,8 +6,9 @@
## DP: files.
@DPATCH@
---- insserv-1.08.0/insserv.c 2006-02-06 16:45:54.000000000 +0100
-+++ insserv/insserv.c 2006-09-07 00:38:06.000000000 +0200
+diff -urNad insserv-1.09.0~/insserv.c insserv-1.09.0/insserv.c
+--- insserv-1.09.0~/insserv.c 2007-12-31 12:03:35.734629003 -0200
++++ insserv-1.09.0/insserv.c 2007-12-31 12:04:21.573241198 -0200
@@ -23,6 +23,7 @@
#include <fcntl.h>
#include <sys/stat.h>
@@ -16,7 +17,17 @@
#include <dirent.h>
#include <regex.h>
#include <errno.h>
-@@ -945,7 +946,7 @@
+@@ -39,6 +40,9 @@
+ #ifndef INITDIR
+ # define INITDIR "/etc/init.d"
+ #endif
++#ifndef OVERRIDEDIR
++# define OVERRIDEDIR "/etc/insserv/overrides"
++#endif
+ #ifndef INSCONF
+ # define INSCONF "/etc/insserv.conf"
+ #endif
+@@ -998,7 +1002,7 @@
regcompiler(®.desc, DESCRIPTION, REG_EXTENDED|REG_ICASE|REG_NEWLINE);
}
@@ -25,7 +36,7 @@
{
regmatch_t subloc[SUBNUM_SHD+1], *val = &subloc[SUBNUM-1], *shl = &subloc[SUBNUM_SHD-1];
FILE *script;
-@@ -967,18 +968,6 @@
+@@ -1022,18 +1026,6 @@
if (!script)
error("fopen(%s): %s\n", path, strerror(errno));
@@ -44,13 +55,13 @@
#define COMMON_ARGS buf, SUBNUM, subloc, 0
#define COMMON_SHD_ARGS buf, SUBNUM_SHD, subloc, 0
while (fgets(buf, sizeof(buf), script)) {
-@@ -1094,10 +1085,113 @@
+@@ -1169,10 +1161,113 @@
#undef default_start
#undef default_stop
#undef description
+ return ret;
+}
-+
+
+/*
+ * Follow symlinks, return the basename of the file pointed to by
+ * symlinks or the basename of the current path if no symlink.
@@ -95,7 +106,7 @@
+
+ free(script);
+ script = xstrdup(basename(linkbuf));
-
++
+ return script;
+}
+
@@ -113,7 +124,7 @@
return ret;
}
-+static boolean scan_script_defaults(const char *const path)
++static boolean scan_script_defaults(const char *const path, const char *const override_path)
+{
+ boolean ret = 0;
+ boolean override = 0;
@@ -125,8 +136,8 @@
+ xreset(script_inf.required_stop);
+ xreset(script_inf.should_start);
+ xreset(script_inf.should_stop);
-+ xreset(start_before);
-+ xreset(stop_after);
++ xreset(script_inf.start_before);
++ xreset(script_inf.stop_after);
+ xreset(script_inf.default_start);
+ xreset(script_inf.default_stop);
+ xreset(script_inf.description);
@@ -139,7 +150,7 @@
+
+ /* Allow host-specific overrides to replace the content in the
+ init.d scripts */
-+ override |= load_overrides("/etc/insserv/overrides", name);
++ override |= load_overrides(override_path, name);
+
+ if (!ret) {
+ warn("warning: script '%s' missing LSB tags\n", path);
@@ -158,3 +169,82 @@
static inline void scan_script_regfree()
{
regfree(®.prov);
+@@ -1237,7 +1332,7 @@
+ /*
+ * Scan current service structure
+ */
+-static void scan_script_locations(const char *const path)
++static void scan_script_locations(const char *const path, const char *const override_path)
+ {
+ int runlevel;
+
+@@ -1274,7 +1369,7 @@
+ 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);
+
+@@ -1561,6 +1656,7 @@
+ {"remove", 0, NULL, 'r'},
+ {"force", 0, NULL, 'f'},
+ {"path", 1, NULL, 'p'},
++ {"override",1, NULL, 'o'},
+ {"help", 0, NULL, 'h'},
+ { 0, 0, NULL, 0 },
+ };
+@@ -1574,6 +1670,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");
++ printf(" -o <path>, --override <path> Path to replace " OVERRIDEDIR ".\n");
+ 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 +1687,7 @@
+ struct stat st_script;
+ char * argr[argc];
+ char * path = INITDIR;
++ char * override_path = OVERRIDEDIR;
+ char * insconf = INSCONF;
+ int runlevel, c;
+ boolean del = false;
+@@ -1601,7 +1699,7 @@
+ for (c = 0; c < argc; c++)
+ argr[c] = NULL;
+
+- while ((c = getopt_long(argc, argv, "c:dfrhvnp:", long_options, NULL)) != -1) {
++ while ((c = getopt_long(argc, argv, "c:dfrhvnp:o:", long_options, NULL)) != -1) {
+ switch (c) {
+ case 'c':
+ insconf = optarg;
+@@ -1625,6 +1723,9 @@
+ case 'p':
+ path = optarg;
+ break;
++ case 'o':
++ override_path = optarg;
++ break;
+ case '?':
+ error("For help use: %s -h\n", myname);
+ case 'h':
+@@ -1736,7 +1837,7 @@
+ #if 0
+ if (!defaults)
+ #endif
+- scan_script_locations(path);
++ scan_script_locations(path, override_path);
+
+ if ((initdir = opendir(path)) == NULL)
+ error("can not opendir(%s): %s\n", path, strerror(errno));
+@@ -1823,7 +1924,7 @@
+ }
+
+ /* main scanner for LSB comment in current script */
+- lsb = scan_script_defaults(d->d_name);
++ lsb = scan_script_defaults(d->d_name, override_path);
+
+ /* Common script ... */
+ if (!strcmp(d->d_name, "halt")) {
Modified: trunk/src/insserv/debian/run-testsuite
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/run-testsuite?rev=374&op=diff
==============================================================================
--- trunk/src/insserv/debian/run-testsuite (original)
+++ trunk/src/insserv/debian/run-testsuite Mon Dec 31 14:28:44 2007
@@ -14,7 +14,7 @@
insserv_reg() {
script=$initddir/$1
- $insserv $debug -c $insconf -p $initddir $script
+ $insserv $debug -c $insconf -p $initddir -o $tmpdir/insserv/override $script
}
insertscript() {
@@ -260,6 +260,17 @@
### END INIT INFO
EOF
+insertscript needallfs2 <<'EOF'
+### BEGIN INIT INFO
+# Provides: needallfs2
+# Required-Start: $remote_fs
+# Required-Stop: $remote_fs
+# Should-Before: needallfs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+### END INIT INFO
+EOF
+
insertscript nolsbheader <<'EOF'
EOF
@@ -281,6 +292,7 @@
check_order 2 needlocalfs needallfs
check_order 2 needlocalfs nolsbheader
check_order 2 syslog nolsbheader
+check_order 2 needallfs2 needallfs
check_order 6 needallfs umountnfs
check_order 6 nolsbheader umountnfs
More information about the Initscripts-ng-commits
mailing list