commit insserv for openSUSE:Factory
Hello community, here is the log from the commit of package insserv for openSUSE:Factory checked in at Mon May 3 23:19:34 CEST 2010. -------- --- insserv/insserv.changes 2010-04-29 13:03:28.000000000 +0200 +++ insserv/insserv.changes 2010-04-30 18:36:52.000000000 +0200 @@ -1,0 +2,5 @@ +Fri Apr 30 18:27:29 CEST 2010 - werner@suse.de + +- Add the option of recursive enabling all required services + +------------------------------------------------------------------- calling whatdependson for head-i586 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ insserv.spec ++++++ --- /var/tmp/diff_new_pack.1fdk4W/_old 2010-05-03 23:19:06.000000000 +0200 +++ /var/tmp/diff_new_pack.1fdk4W/_new 2010-05-03 23:19:06.000000000 +0200 @@ -24,7 +24,7 @@ Provides: aaa_base:/sbin/insserv AutoReqProv: on Version: 1.14.0 -Release: 2 +Release: 3 Summary: A Program to Arrange Initialization Scripts Url: http://savannah.nongnu.org/projects/sysvinit/ Source0: http://download.savannah.gnu.org/releases/sysvinit/insserv-%{version}.tar.bz2 ++++++ insserv-1.14.0.dif ++++++ --- /var/tmp/diff_new_pack.1fdk4W/_old 2010-05-03 23:19:06.000000000 +0200 +++ /var/tmp/diff_new_pack.1fdk4W/_new 2010-05-03 23:19:06.000000000 +0200 @@ -1,4 +1,272 @@ ---- .dummy -+++ .dummy 2009-08-19 12:18:39.181901099 +0200 -@@ -0,0 +1 @@ -+this is a dummy, remove if real changes are required +--- listing.h (revision 75) ++++ listing.h (working copy) +@@ -379,6 +379,8 @@ static inline char * xstrdup(const char *restrict + #define SERV_NOSTOP 0x0100 + #define SERV_CMDLINE 0x0200 + #define SERV_FIRST 0x0400 ++#define SERV_ENFORCE 0x0800 ++#define SERV_WARNED 0x1000 + + /* + * Bits of the runlevels +--- CHANGES (revision 75) ++++ CHANGES (working copy) +@@ -1,4 +1,9 @@ + ------------------------------------------------------------------- ++Fri Apr 30 18:27:29 CEST 2010 - werner@suse.de ++ ++- Add the option of recursive enabling all required services ++ ++------------------------------------------------------------------- + Wed Apr 28 15:29:23 CEST 2010 - werner@suse.de + + - Use savannah as primary site +--- insserv.c (revision 75) ++++ insserv.c (working copy) +@@ -389,8 +389,8 @@ static void reversereq(service_t *restrict serv, u + /* + * Check required services for name + */ +-static boolean chkrequired(service_t *restrict serv) attribute((nonnull(1))); +-static boolean chkrequired(service_t *restrict serv) ++static boolean chkrequired(service_t *restrict serv, const boolean recursive) attribute((nonnull(1))); ++static boolean chkrequired(service_t *restrict serv, const boolean recursive) + { + boolean ret = true; + list_t * pos; +@@ -409,12 +409,23 @@ static void reversereq(service_t *restrict serv, u + must = getorig(must); + + if ((must->attr.flags & (SERV_CMDLINE|SERV_ENABLED)) == 0) { +- warn("Service %s has to be enabled to start service %s\n", +- req->serv->name, serv->name); ++ if (recursive) { ++ must->attr.flags |= SERV_ENFORCE; ++ continue; /* Enabled this later even if not on command line */ ++ } ++ if ((must->attr.flags & SERV_WARNED) == 0) { ++ warn("FATAL: service %s has to be enabled to use service %s\n", ++ req->serv->name, serv->name); ++ must->attr.flags |= SERV_WARNED; ++ } + ret = false; + } + } + #if 0 ++ /* ++ * Once we may use REQ_MUST for X-Start-Before and/or ++ * X-Stop-After we may enable this, see reversereq() ++ */ + if (serv->attr.flags & (SERV_CMDLINE|SERV_ENABLED)) + goto out; + np_list_for_each(pos, &serv->sort.rev) { +@@ -425,9 +436,8 @@ static void reversereq(service_t *restrict serv, u + continue; + must = rev->serv; + must = getorig(must); +- + if (must->attr.flags & (SERV_CMDLINE|SERV_ENABLED)) { +- warn("Service %s has to be enabled to stop service %s\n", ++ warn("FATAL: service %s has to be enabled to use service %s\n", + serv->name, rev->serv->name); + ret = false; + } +@@ -476,7 +486,7 @@ static boolean chkdependencies(service_t *restrict + if ((cur->attr.flags & SERV_CMDLINE) && (flags & SERV_CMDLINE)) + continue; + +- warn("Service %s has to be enabled to start service %s\n", ++ warn("FATAL: service %s has to be enabled to use service %s\n", + name, cur->name); + ret = false; + } +@@ -1416,7 +1426,7 @@ static uchar scan_lsb_headers(const int dfd, const + char *name = basename(path); + if (*name == 'S' || *name == 'K') + name += 3; +- warn("Script %s is broken: missing end of LSB comment.\n", name); ++ warn("%sscript %s is broken: missing end of LSB comment.\n", ignore ? "" : "FATAL: ", name); + if (!ignore) + error("exiting now!\n"); + } +@@ -1432,7 +1442,7 @@ static uchar scan_lsb_headers(const int dfd, const + char *name = basename(path); + if (*name == 'S' || *name == 'K') + name += 3; +- warn("Script %s is broken: incomplete LSB comment.\n", name); ++ warn("script %s is broken: incomplete LSB comment.\n", name); + if (!provides) + warn("missing `Provides:' entry: please add.\n"); + if (provides == empty) +@@ -2338,17 +2348,18 @@ out: + + static struct option long_options[] = + { +- {"verbose", 0, (int*)0, 'v'}, +- {"config", 1, (int*)0, 'c'}, +- {"dryrun", 0, (int*)0, 'n'}, +- {"default", 0, (int*)0, 'd'}, +- {"remove", 0, (int*)0, 'r'}, +- {"force", 0, (int*)0, 'f'}, +- {"path", 1, (int*)0, 'p'}, +- {"override",1, (int*)0, 'o'}, +- {"upstart-job",1, (int*)0, 'u'}, +- {"help", 0, (int*)0, 'h'}, +- { 0, 0, (int*)0, 0 }, ++ {"verbose", 0, (int*)0, 'v'}, ++ {"config", 1, (int*)0, 'c'}, ++ {"dryrun", 0, (int*)0, 'n'}, ++ {"default", 0, (int*)0, 'd'}, ++ {"remove", 0, (int*)0, 'r'}, ++ {"force", 0, (int*)0, 'f'}, ++ {"path", 1, (int*)0, 'p'}, ++ {"override", 1, (int*)0, 'o'}, ++ {"upstart-job", 1, (int*)0, 'u'}, ++ {"recursive", 0, (int*)0, 'e'}, ++ {"help", 0, (int*)0, 'h'}, ++ { 0, 0, (int*)0, 0 }, + }; + + static void help(const char *restrict const name) attribute((nonnull(1))); +@@ -2364,6 +2375,8 @@ static void help(const char *restrict const name) + 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(" -u <path>, --upstart-job <path> Path to replace existing upstart job path.\n"); ++ printf(" -e, --recursive Expand and enable all required services.\n"); + printf(" -d, --default Use default runlevels a defined in the scripts\n"); + } + +@@ -2386,6 +2399,8 @@ int main (int argc, char *argv[]) + boolean defaults = false; + boolean ignore = false; + boolean loadarg = false; ++ boolean recursive = false; ++ boolean waserr = false; + + myname = basename(*argv); + +@@ -2400,7 +2415,7 @@ int main (int argc, char *argv[]) + for (c = 0; c < argc; c++) + argr[c] = (char*)0; + +- while ((c = getopt_long(argc, argv, "c:dfrhvno:p:u:", long_options, (int *)0)) != -1) { ++ while ((c = getopt_long(argc, argv, "c:dfrhvno:p:u:e", long_options, (int *)0)) != -1) { + size_t l; + switch (c) { + case 'c': +@@ -2445,6 +2460,9 @@ int main (int argc, char *argv[]) + goto err; + upstartjob_path = optarg; + break; ++ case 'e': ++ recursive = true; ++ break; + case '?': + err: + error("For help use: %s -h\n", myname); +@@ -3000,8 +3018,10 @@ int main (int argc, char *argv[]) + if (!del || (del && !isarg)) + warn("script %s: service %s already provided!\n", d->d_name, token); + +- if (!del && !ignore && isarg) +- error("exiting now!\n"); ++ if (!del && !ignore && isarg) { ++ waserr = true; ++ continue; ++ } + + if (!del || (del && !ignore && !isarg)) + continue; +@@ -3064,9 +3084,9 @@ int main (int argc, char *argv[]) + if (del) + ok = chkdependencies(service); + else +- ok = chkrequired(service); ++ ok = chkrequired(service, recursive); + if (!ok && !ignore) +- error("exiting now!\n"); ++ waserr = true; + } + + if (script_inf.default_start && script_inf.default_start != empty) { +@@ -3357,6 +3377,42 @@ int main (int argc, char *argv[]) + active_script(); + + /* ++ * Check for recursive mode the existence of the required services ++ */ ++ if (recursive && !del && !ignore) { ++ c = argc; ++ while (c--) { ++ service_t * cur; ++ list_t * ptr; ++ cur = findservice(argv[c]); ++ cur = getorig(cur); ++ if (list_empty(&cur->sort.req)) ++ continue; ++ np_list_for_each(ptr, &cur->sort.req) { ++ req_t *req = getreq(ptr); ++ service_t * must; ++ ++ if ((req->flags & REQ_MUST) == 0) ++ continue; ++ must = req->serv; ++ must = getorig(must); ++ ++ if (must->attr.flags & SERV_ENABLED) ++ continue; ++ ++ if ((must->attr.flags & (SERV_ENFORCE|SERV_KNOWN)) == SERV_ENFORCE) { ++ warn("Service %s has to exists for service %s\n", ++ req->serv->name, cur->name); ++ waserr = true; ++ } ++ } ++ } ++ } ++ ++ if (waserr) ++ error("exiting now!\n"); ++ ++ /* + * Sorry but we support only [KS][0-9][0-9]<name> + */ + if (maxstart > MAX_DEEP || maxstop > MAX_DEEP) +@@ -3435,13 +3491,16 @@ int main (int argc, char *argv[]) + + script = (char*)0; + while ((serv = listscripts(&script, 'X', lvl))) { +- const boolean this = chkfor(script, argv, argc); ++ boolean this = chkfor(script, argv, argc); + boolean found, slink; + char * clink; + + if (*script == '$') /* Do not link in virtual dependencies */ + continue; + ++ if ((serv->attr.flags & (SERV_ENFORCE|SERV_ENABLED)) == SERV_ENFORCE) ++ this = true; ++ + slink = false; + if ((serv->start->lvl & lvl) == 0) + goto stop; +@@ -3616,7 +3675,7 @@ int main (int argc, char *argv[]) + + script = (char*)0; + while ((serv = listscripts(&script, 'X', seek))) { +- const boolean this = chkfor(script, argv, argc); ++ boolean this = chkfor(script, argv, argc); + boolean found; + char * clink; + char mode; +@@ -3624,6 +3683,9 @@ int main (int argc, char *argv[]) + if (*script == '$') /* Do not link in virtual dependencies */ + continue; + ++ if ((serv->attr.flags & (SERV_ENFORCE|SERV_ENABLED)) == SERV_ENFORCE) ++ this = true; ++ + sprintf(olink, "../init.d/%s", script); + if (serv->stopp->lvl & lvl) { + # ifndef USE_KILL_IN_BOOT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de