Hello community,
here is the log from the commit of package insserv checked in at Sat Aug 2 00:36:35 CEST 2008.
-------- --- insserv/insserv.changes 2008-06-11 15:06:41.000000000 +0200 +++ insserv/insserv.changes 2008-07-29 15:32:16.658890000 +0200 @@ -1,0 +2,34 @@ +Tue Jul 29 15:23:43 CEST 2008 - werner@suse.de + +- Resolve server minor problems on openSUSE and Debian + * Handle the runlevel bit for system boot in lvl2str() + * Handle dependencies on several script on command line + * Let link scheme overwrite empty default start/stop tags + +------------------------------------------------------------------- +Wed Jul 2 19:38:15 CEST 2008 - werner@suse.de + +- Use prefetch from kernels code for lists +- Make start/stop requirements link to the services its self +- Make -pedantic work +- Be sure that the code is optimized + +------------------------------------------------------------------- +Wed Jun 25 19:37:35 CEST 2008 - werner@suse.de + +- Handle provides and service lists in parallel, this should + reduce the double efforts. +- Calculate start oder and stop order separately +- Sort targets in the makefile accordingly to their order + +------------------------------------------------------------------- +Wed Jun 18 15:27:16 CEST 2008 - werner@suse.de + +- Clean out several provides of one specific script, add therefore + an alias list to the first provide. This makes less work load on + following the full dependcy trees. +- Use aligned memory allocation to avoid memory fragmentation +- Use reference counts to be able to free not needed memory +- Be able to follow not only the start but also the stop dependcies + +-------------------------------------------------------------------
Old: ---- insserv-1.11.0.dif insserv-1.11.0.tar.bz2
New: ---- insserv-1.12.0.dif insserv-1.12.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences: ------------------ ++++++ insserv.spec ++++++ --- /var/tmp/diff_new_pack.I13067/_old 2008-08-02 00:34:46.000000000 +0200 +++ /var/tmp/diff_new_pack.I13067/_new 2008-08-02 00:34:46.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package insserv (Version 1.11.0) +# spec file for package insserv (Version 1.12.0) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -16,13 +16,15 @@ Group: System/Base Provides: aaa_base:/sbin/insserv AutoReqProv: on -Version: 1.11.0 -Release: 33 +Version: 1.12.0 +Release: 1 Summary: A Program to Arrange Initialization Scripts Source0: insserv-%{version}.tar.bz2 Source1: insserv.conf Patch: insserv-%{version}.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build +%global _sysconfdir /etc +%global _sbindir /sbin
%description Insserv enables an installed system init script (boot script) by @@ -40,21 +42,46 @@ %patch
%build -make +make INITDIR=%{_sysconfdir}/init.d INSCONF=%{_sysconfdir}/insserv.conf
%install -make install DESTDIR=$RPM_BUILD_ROOT -install -m 644 %{SOURCE1} ${RPM_BUILD_ROOT}/etc/ +make install DESTDIR=%{buildroot} INITDIR=%{_sysconfdir}/init.d INSCONF=%{_sysconfdir}/insserv.conf +install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/ +mkdir -p %{buildroot}%{_datadir}/insserv/overrides
%files %defattr(-,root,root) -%config /etc/insserv.conf -/sbin/insserv +%config %{_sysconfdir}/insserv.conf +%{_sbindir}/insserv /lib/lsb/* -/usr/lib/lsb/* +%{_prefix}/lib/lsb/* %{_mandir}/man8/insserv.8.gz +%dir %{_datadir}/insserv +%dir %{_datadir}/insserv/overrides
%changelog +* Tue Jul 29 2008 werner@suse.de +- Resolve server minor problems on openSUSE and Debian + * Handle the runlevel bit for system boot in lvl2str() + * Handle dependencies on several script on command line + * Let link scheme overwrite empty default start/stop tags +* Wed Jul 02 2008 werner@suse.de +- Use prefetch from kernels code for lists +- Make start/stop requirements link to the services its self +- Make -pedantic work +- Be sure that the code is optimized +* Wed Jun 25 2008 werner@suse.de +- Handle provides and service lists in parallel, this should + reduce the double efforts. +- Calculate start oder and stop order separately +- Sort targets in the makefile accordingly to their order +* Wed Jun 18 2008 werner@suse.de +- Clean out several provides of one specific script, add therefore + an alias list to the first provide. This makes less work load on + following the full dependcy trees. +- Use aligned memory allocation to avoid memory fragmentation +- Use reference counts to be able to free not needed memory +- Be able to follow not only the start but also the stop dependcies * Wed Jun 11 2008 werner@suse.de - Make kbd interactive to avoid race during tty resize (bnc#259577) * Wed Jun 04 2008 werner@suse.de
++++++ insserv-1.11.0.dif -> insserv-1.12.0.dif ++++++ --- insserv/insserv-1.11.0.dif 2008-06-04 12:33:51.000000000 +0200 +++ insserv/insserv-1.12.0.dif 2008-07-31 18:09:46.805686000 +0200 @@ -1,413 +1,32 @@ ---- Makefile -+++ Makefile 2008-05-15 15:58:47.218346000 +0200 -@@ -31,6 +31,13 @@ endif - CFLAGS = -Wall $(COPTS) $(DEBUG) $(LOOPS) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \ - $(ISSUSE) -DINITDIR="$(INITDIR)" -DINSCONF="$(INSCONF)" -pipe - CLOOP = -falign-loops=0 -+ LDFLAGS = -Wl,-O,3,--relax -+ LIBS = -+ifdef USE_RPMLIB -+ CFLAGS += -DUSE_RPMLIB=1 -+ LDFLAGS += -Wl,--as-needed -+ LIBS += -lrpm -+endif - CC = gcc - RM = rm -f - MKDIR = mkdir -p -@@ -64,7 +71,7 @@ insserv.o: insserv.c listing.h .system - $(CC) $(CFLAGS) $(CLOOP) -c $< - - insserv: insserv.o listing.o -- $(CC) $(CFLAGS) -Wl,-O,3,--relax -o $@ $^ -+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) - - ifeq ($(ISSUSE),-DSUSE) - insserv.8: insserv.8.in .system --- insserv.c -+++ insserv.c 2008-06-04 12:32:19.514155760 +0200 -@@ -35,6 +35,10 @@ - #include <limits.h> - #include <getopt.h> - #include "listing.h" -+#if defined(USE_RPMLIB) && (USE_RPMLIB > 0) -+# include <rpm/rpmlib.h> -+# include <rpm/rpmmacro.h> -+#endif - - static const char *map_runlevel_to_location(const int runlevel); - #ifndef SUSE -@@ -166,7 +170,7 @@ typedef struct pwd_struct { - - static list_t pwd = { &(pwd), &(pwd) }, * topd = &(pwd); - --static void pushd(const char *const __restrict path); -+static void pushd(const char *const __restrict path) __attribute__((nonnull(1))); - static void pushd(const char *const path) - { - pwd_t * dir; -@@ -305,13 +309,13 @@ out: - return getserv(ptr); - } - --static serv_t * findserv(const char *const __restrict serv) __attribute__((nonnull(1))); -+static serv_t * findserv(const char *const __restrict serv); - static serv_t * findserv(const char *const serv) - { - list_t * ptr; - serv_t * ret = (serv_t*)0; - -- if (!serv) -+ if (serv == (const char*)0) - goto out; - - list_for_each(ptr, serv_start) { -@@ -334,6 +338,9 @@ static void rememberreq(serv_t *serv, ui - list_t * ptr; - uint old = bit; - -+ if (!tmp) -+ error("%s", strerror(errno)); -+ - while ((token = strsep(&tmp, delimeter))) { - boolean found = false; - req_t * this; -@@ -399,6 +406,9 @@ static void reversereq(const serv_t * se - char * rev = strdupa(list); - uint old = bit; - -+ if (!rev) -+ error("%s", strerror(errno)); -+ - while ((dep = strsep(&rev, delimeter)) && *dep) { - serv_t * tmp; - list_t * ptr; -@@ -437,7 +447,7 @@ static void reversereq(const serv_t * se - /* - * Check required services for name - */ --static boolean chkrequired(const char *const __restrict name) __attribute__((nonnull(1))); -+static boolean chkrequired(const char *const __restrict name); - static boolean chkrequired(const char *const name) - { - serv_t * serv = findserv(name); -@@ -587,7 +597,7 @@ static inline void active_script(void) - serv_t * chk = (serv_t*)0; - list_t * req; - const char *name; -- boolean ignore = false; -+ boolean skip = false; - - if (!(serv->lvls & cur->lvls)) - continue; -@@ -612,11 +622,11 @@ static inline void active_script(void) - */ - list_for_each(req, &(serv->sort.req)) { - if (!strcmp(getreq(req)->serv, cur->name)) -- ignore = true; -+ skip = true; - if (!strcmp(getreq(req)->serv, name)) -- ignore = true; -+ skip = true; - } -- if (ignore) continue; -+ if (skip) continue; - - /* - * Increase order of members of the same start -@@ -1111,8 +1121,8 @@ static inline void scan_script_reset(voi - #define FOUND_LSB_DEFAULT 0x02 - #define FOUND_LSB_OVERRIDE 0x04 - --static uchar scan_lsb_headers(const char *const __restrict path) __attribute__((nonnull(1))); --static uchar scan_lsb_headers(const char *const path) -+static uchar scan_lsb_headers(const char *const __restrict path, const boolean ignore) __attribute__((nonnull(1))); -+static uchar scan_lsb_headers(const char *const path, const boolean ignore) - { - regmatch_t subloc[SUBNUM_SHD+1], *val = &subloc[SUBNUM-1], *shl = &subloc[SUBNUM_SHD-1]; - FILE *script; -@@ -1244,7 +1254,8 @@ static uchar scan_lsb_headers(const char - if (*name == 'S' || *name == 'K') - name += 3; - warn("script %s is broken: missing end of LSB comment.\n", name); -- error("exiting now!\n"); -+ if (!ignore) -+ error("exiting now!\n"); - } - - #ifndef USE_STOP_TAGS -@@ -1341,8 +1352,9 @@ static char *scriptname(const char * pat - return script; - } - --static uchar load_overrides(const char *const __restrict dir, const char *const __restrict name) __attribute__((nonnull(1,2))); --static uchar load_overrides(const char *const dir, const char *const name) -+static uchar load_overrides(const char *const __restrict dir, -+ const char *const __restrict name, const boolean ignore) __attribute__((nonnull(1,2))); -+static uchar load_overrides(const char *const dir, const char *const name, const boolean ignore) - { - uchar ret = 0; - char fullpath[PATH_MAX+1]; -@@ -1354,14 +1366,16 @@ static uchar load_overrides(const char * - error("snprintf(): %s\n", strerror(errno)); - - if (stat(fullpath, &statbuf) == 0 && S_ISREG(statbuf.st_mode)) -- ret = scan_lsb_headers(fullpath); -+ ret = scan_lsb_headers(fullpath, ignore); - if (ret) - ret |= FOUND_LSB_OVERRIDE; - return ret; - } - --static uchar scan_script_defaults(const char *const __restrict path, const char *const __restrict override_path) __attribute__((nonnull(1,2))); --static uchar scan_script_defaults(const char *const path, const char *const override_path) -+static uchar scan_script_defaults(const char *const __restrict path, -+ const char *const __restrict override_path, const boolean ignore) __attribute__((nonnull(1,2))); -+static uchar scan_script_defaults(const char *const path, const char *const override_path, -+ const boolean ignore) - { - uchar ret = 0; - char *name = scriptname(path); -@@ -1393,10 +1407,10 @@ static uchar scan_script_defaults(const - #endif /* SUSE */ - - /* Replace with headers from the script itself */ -- ret |= scan_lsb_headers(path); -+ ret |= scan_lsb_headers(path, ignore); - - if (!ret) /* Load values if the override file exist */ -- ret |= load_overrides("/usr/share/insserv/overrides", name); -+ ret |= load_overrides("/usr/share/insserv/overrides", name, ignore); - else - ret |= FOUND_LSB_DEFAULT; - -@@ -1404,7 +1418,7 @@ static uchar scan_script_defaults(const - * Allow host-specific overrides to replace the content in the - * init.d scripts - */ -- ret |= load_overrides(override_path, name); -+ ret |= load_overrides(override_path, name, ignore); - #ifdef SUSE - out: - #endif /* SUSE */ -@@ -1510,8 +1524,11 @@ static int map_runlevel_to_seek(const in - * Scan current service structure - */ - static void scan_script_locations(const char *const __restrict path, -- const char *const __restrict override_path, char ** const __restrict iargv, const int icnt) __attribute__((nonnull(1,2))); --static void scan_script_locations(const char *const path, const char *const override_path, char ** const iargv, const int icnt) -+ const char *const __restrict override_path, -+ char ** const __restrict iargv, -+ const int icnt, const boolean ignore) __attribute__((nonnull(1,2))); -+static void scan_script_locations(const char *const path, const char *const override_path, -+ char ** const iargv, const int icnt, const boolean ignore) - { - int runlevel; - -@@ -1553,18 +1570,11 @@ static void scan_script_locations(const - xremove(d->d_name); /* dangling sym link */ - continue; - } --#ifdef SUSE -- /* -- * Ignore scripts if removed later to avoid not used depencies -- * in the makefiles depend.boot, .depend.start and .depend.stop -- */ -- if (iargv && chkfor(ptr, iargv, icnt)) -- continue; --#endif /* SUSE */ -- lsb = scan_script_defaults(d->d_name, override_path); - -+ lsb = scan_script_defaults(d->d_name, override_path, ignore); - if (!script_inf.provides || script_inf.provides == empty) - script_inf.provides = xstrdup(ptr); -+ - #ifndef SUSE - if (!lsb) { - script_inf.required_start = xstrdup(DEFAULT_DEPENDENCY); -@@ -1801,11 +1811,6 @@ static int cfgfile_filter(const struct d - return 0; - if ((*name == '.') && ((*(name+1) == '\0') || (*(name+1) == '.'))) - return 0; -- else { -- struct stat st; -- if ((stat(name,&st) < 0) || !S_ISREG(st.st_mode)) -- return 0; -- } - if ((end = strrchr(name, '.'))) { - end++; - if (!strncmp(end, "rpm", 3) || /* .rpmorig, .rpmnew, .rmpsave, ... */ -@@ -1859,6 +1864,7 @@ static void scan_conf(const char * file) - n = scandir(path, &namelist, cfgfile_filter, alphasort); - if(n > 0) { - while(n--) { -+ struct stat st; - char buf[PATH_MAX+1]; - int r; - -@@ -1866,6 +1872,9 @@ static void scan_conf(const char * file) - if (r >= sizeof(buf) || r < 0) - error("snprintf(): %s\n", strerror(errno)); - -+ if ((stat(buf, &st) < 0) || !S_ISREG(st.st_mode)) -+ continue; -+ - scan_conf_file(buf); - - free(namelist[n]); -@@ -1940,6 +1949,91 @@ static inline char * scan_for(DIR *const - return ret; - } - -+#ifdef SUSE -+/* -+ * A simple command line checker of the parent process to determine if this is -+ * a sub process "/bin/sh" forked off for executing a temporary file for %preun, -+ * %postun, %pre, or %post scriptlet. -+ */ -+static inline boolean underrpm(void) -+{ -+ boolean ret = false; -+ const pid_t pp = getppid(); -+ char buf[PATH_MAX], *argv[3], *ptr; -+# if defined(USE_RPMLIB) && (USE_RPMLIB > 0) -+ char *tmppath, *shell; -+# endif -+ int argc, fd; -+ ssize_t len; -+ -+ snprintf(buf, sizeof(buf)-1, "/proc/%lu/cmdline", (unsigned long)pp); -+ if ((fd = open(buf, O_NOCTTY|O_RDONLY)) < 0) -+ goto out; -+ -+ memset(buf, '\0', sizeof(buf)); -+ if ((len = read(fd , buf, sizeof(buf)-1)) < 0) -+ goto out; -+ -+ ptr = &buf[0]; -+ argc = 0; -+ do { -+ argv[argc++] = ptr; -+ if (argc > 2) -+ break; -+ if ((len = len - (ssize_t)(ptr - &buf[0])) < 0) -+ break; -+ } while ((ptr = memchr(ptr, '\0', len)) && *(++ptr)); -+ -+ if (argc != 3) -+ goto out; -+ -+# if defined(USE_RPMLIB) && (USE_RPMLIB > 0) -+ rpmReadConfigFiles(NULL, NULL); -+ rpmFreeRpmrc(); -+ -+ if ((shell = rpmExpand("%_buildshell", NULL)) == NULL) -+ shell = xstrdup("/bin/sh"); -+ -+ if (strncmp(argv[0], shell, strlen(shell)) != 0) { -+ free(shell); -+ goto out; -+ } -+ free(shell); -+ -+ if ((tmppath = rpmExpand("%_tmppath", NULL)) == NULL) -+ tmppath = xstrdup("/var/tmp"); -+ -+ if (strncmp(argv[1], tmppath, strlen(tmppath)) != 0) { -+ free(tmppath); -+ goto out; -+ } -+ -+ len = strlen(tmppath); -+ free(tmppath); -+ -+ ptr = argv[1]; -+ if (strncmp(ptr + len, "/rpm-tmp.", 9) != 0) -+ goto out; -+# else -+ if ((strcmp(argv[0], "/bin/sh") != 0) && -+ (strcmp(argv[0], "/bin/bash") != 0)) -+ goto out; -+ -+ if ((strncmp(argv[1], "/var/tmp/rpm-tmp.", 17) != 0) && -+ (strncmp(argv[1], "/usr/tmp/rpm-tmp.", 17) != 0) && -+ (strncmp(argv[1], "/tmp/rpm-tmp.", 13) != 0)) -+ goto out; -+# endif -+ if ((argc = atoi(argv[2])) >= 0 && argc <= 2) -+ ret = true; -+out: -+ if (fd >= 0) -+ close(fd); -+ -+ return ret; -+} -+#endif /* SUSE */ -+ - static struct option long_options[] = - { - {"verbose", 0, (int*)0, 'v'}, -@@ -2127,6 +2221,11 @@ int main (int argc, char *argv[]) - printf("Overwrite argument for %s is %s\n", argv[c], argr[c]); - #endif /* DEBUG */ - -+#ifdef SUSE -+ if (underrpm()) -+ ignore = true; -+#endif /* SUSE */ -+ - /* - * Scan and set our configuration for virtual services. - */ -@@ -2144,7 +2243,7 @@ int main (int argc, char *argv[]) - #if 0 - if (!defaults) - #endif -- scan_script_locations(path, override_path, (del ? argv : (char**)0), argc); -+ scan_script_locations(path, override_path, (del ? argv : (char**)0), argc, ignore); - - if ((initdir = opendir(path)) == (DIR*)0) - error("can not opendir(%s): %s\n", path, strerror(errno)); -@@ -2231,7 +2330,7 @@ int main (int argc, char *argv[]) - } - - /* main scanner for LSB comment in current script */ -- lsb = scan_script_defaults(d->d_name, override_path); -+ lsb = scan_script_defaults(d->d_name, override_path, ignore); - - if ((lsb & FOUND_LSB_HEADER) == 0) { - if ((lsb & (FOUND_LSB_DEFAULT | FOUND_LSB_OVERRIDE)) == 0) -@@ -2443,7 +2542,7 @@ int main (int argc, char *argv[]) - ok = chkdependencies(token); - else - ok = chkrequired(token); -- if (!ok) -+ if (!ok && !ignore) - error("exiting now!\n"); - } - ---- listing.h -+++ listing.h 2008-02-01 11:40:45.347748000 +0100 -@@ -97,11 +97,11 @@ extern int makeprov(const char *__restri - extern void setorder(const char *__restrict script, const int order, boolean recursive) __attribute__((nonnull(1))); - extern int getorder(const char *__restrict script) __attribute__((nonnull(1))); - extern boolean notincluded(const char *__restrict script, const int runlevel) __attribute__((nonnull(1))); --extern boolean foreach(const char **__restrict script, int *__restrict order, const int runlevel) __attribute__((nonnull(1,2))); --extern void virtprov(const char *__restrict virt, const char *__restrict real) __attribute__((nonnull(1,2))); -+extern boolean foreach(const char **__restrict script, int *__restrict order, const int runlevel) __attribute__((nonnull(2))); -+extern void virtprov(const char *__restrict virt, const char *__restrict real) __attribute__((nonnull(1))); - extern const char * getscript(const char *__restrict prov) __attribute__((nonnull(1))); - extern const char * getprovides(const char *__restrict script) __attribute__((nonnull(1))); --extern boolean listscripts(const char **__restrict script, const int lvl) __attribute__((nonnull(1))); -+extern boolean listscripts(const char **__restrict script, const int lvl); - extern int maxorder; - extern boolean is_loop_detected(void); - -@@ -116,7 +116,7 @@ extern int map_has_runlevels(void); - extern int map_runlevel_to_lvl (const int runlevel); - extern int map_key_to_lvl(const char key); - --static inline char * xstrdup(const char *__restrict s) __attribute__((always_inline,nonnull(1))); -+static inline char * xstrdup(const char *__restrict s) __attribute__((always_inline)); - static inline char * xstrdup(const char * s) - { - char * r; ++++ insserv.c 2008-07-31 18:08:21.737684067 +0200 +@@ -290,6 +290,8 @@ static void rememberreq(service_t * rest + requires(here, need, type); + break; + case '$': ++ if (strcasecmp(token, "$null") == 0) ++ break; + if (strcasecmp(token, "$all") == 0) { + serv->attr.flags |= SERV_ALL; + break; +@@ -2357,7 +2359,19 @@ int main (int argc, char *argv[]) + + if (strcmp(path, INITDIR) != 0) { + char * tmp; +- root = xstrdup(path); ++ if (*path != '/') { ++ char * pwd = getcwd((char*)0, 0); ++ size_t len = strlen(pwd)+1+strlen(path); ++ root = (char*)malloc(len); ++ if (!root) ++ error("%s", strerror(errno)); ++ strcpy(root, pwd); ++ if (pwd[1]) ++ strcat(root, "/"); ++ strcat(root, path); ++ free(pwd); ++ } else ++ root = xstrdup(path); + if ((tmp = strstr(root, INITDIR))) { + *tmp = '\0'; + } else {
++++++ insserv-1.11.0.tar.bz2 -> insserv-1.12.0.tar.bz2 ++++++ ++++ 6539 lines of diff (skipped)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org