Hello community, here is the log from the commit of package module-init-tools for openSUSE:Factory checked in at Sat Feb 7 09:18:05 CET 2009. -------- --- module-init-tools/module-init-tools.changes 2009-01-28 16:12:05.000000000 +0100 +++ module-init-tools/module-init-tools.changes 2009-02-06 14:17:45.000000000 +0100 @@ -1,0 +2,11 @@ +Fri Feb 6 14:16:57 CET 2009 - mmarek@suse.cz + +- weak-modules2: fix replacing of old weak-modules symlinks + (bnc#472523) + +------------------------------------------------------------------- +Fri Feb 6 09:38:51 CET 2009 - mmarek@suse.cz + +- depmod: fixed is_higher_priority() (bnc#472527) + +------------------------------------------------------------------- calling whatdependson for head-i586 New: ---- depmod-fix-is_higher_priority.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ module-init-tools.spec ++++++ --- /var/tmp/diff_new_pack.K27557/_old 2009-02-07 09:13:47.000000000 +0100 +++ /var/tmp/diff_new_pack.K27557/_new 2009-02-07 09:13:47.000000000 +0100 @@ -21,7 +21,7 @@ Name: module-init-tools BuildRequires: zlib-devel Version: 3.4 -Release: 65 +Release: 69 License: GPL v2 or later Group: System/Kernel # for grepping /etc/SUSE-release @@ -61,6 +61,7 @@ Patch10: module-options-from-kernel-cmdline.patch Patch11: depmod-abort-on-oom.patch Patch12: depmod-use-modules.order.patch +Patch13: depmod-fix-is_higher_priority.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -93,6 +94,7 @@ %patch10 -p1 %patch11 %patch12 +%patch13 # don't try to regenerate the patched manpages (patch7 and patch9) touch modprobe.conf.5 modprobe.8 @@ -171,6 +173,11 @@ /etc/modprobe.d %changelog +* Fri Feb 06 2009 mmarek@suse.cz +- weak-modules2: fix replacing of old weak-modules symlinks + (bnc#472523) +* Fri Feb 06 2009 mmarek@suse.cz +- depmod: fixed is_higher_priority() (bnc#472527) * Wed Jan 28 2009 mmarek@suse.cz - depmod.conf: extra/ takes precedence over weak-updates/ (bnc#470215) ++++++ depmod-fix-is_higher_priority.patch ++++++ if you have a 'search updates foo bar built-in' line in depmod.conf, is_higher_priority() will just check if the module paths contain any of the strings "updates", "foo" or "bar". This can of course match anywhere (eg: 'depmod -b /test/foo'). Attached patch fixes that by always comparing full paths in is_higher_priority(). --- depmod.c 2009-02-05 14:14:10.000000000 +0100 +++ depmod.c 2009-02-05 22:13:55.000000000 +0100 @@ -52,6 +52,7 @@ /* search path */ char *search_path; + size_t len; }; static int verbose; @@ -521,7 +522,6 @@ struct module_search *search, struct module_overrides *overrides) { - char *p, *q, *s; struct module_search *tmp; struct module_overrides *ovtmp; int i = 0; @@ -529,63 +529,31 @@ int prio_new = -1; int prio_old = -1; -/* The names already match, now we check for wildcard overrides and other - * high priority overrides we added to the config. +/* The names already match, now we check for overrides and directory search + * order */ - for (ovtmp=overrides;ovtmp!=NULL;ovtmp=ovtmp->next) { - - p = strstr(ovtmp->modfile,newpath); - if (p) + for (ovtmp = overrides; ovtmp != NULL; ovtmp = ovtmp->next) { + if (strcmp(ovtmp->modfile, newpath) == 0) return 1; - - q = strstr(ovtmp->modfile,"*"); - if (q) { - p = strstr(newpath, q+1); - if (p) - return 1; - - p = strstr(oldpath, q+1); - if (p) - return 0; - } - - p = strstr(ovtmp->modfile,oldpath); - if (p) + if (strcmp(ovtmp->modfile, oldpath) == 0) return 0; } - - for (i=0,tmp=search;tmp!=NULL;tmp=tmp->next,i++) { - - s = NOFAIL(malloc(strlen(tmp->search_path)+2)); - s[0] = '/'; - strncpy(s+1,tmp->search_path, strlen(tmp->search_path)+1); - - if (0 == strncmp(tmp->search_path,MODULE_BUILTIN_KEY, - strlen(MODULE_BUILTIN_KEY))) + for (i = 0, tmp = search; tmp != NULL; tmp = tmp->next, i++) { + if (strcmp(tmp->search_path, MODULE_BUILTIN_KEY) == 0) prio_builtin = i; - - p = strstr(newpath,s); - if ((p) && ((p[strlen(s)] == '/') - || (p[strlen(s)] == '\0'))) + else if (strncmp(tmp->search_path, newpath, tmp->len) == 0) prio_new = i; - - p = strstr(oldpath,s); - if ((p) && ((p[strlen(s)] == '/') - || (p[strlen(s)] == '\0'))) + else if (strncmp(tmp->search_path, oldpath, tmp->len) == 0) prio_old = i; - - free(s); - } - + if (prio_builtin < 0) + prio_builtin = i; if (prio_new < 0) prio_new = prio_builtin; - if (prio_old < 0) prio_old = prio_builtin; return prio_new > prio_old; - } @@ -943,6 +911,7 @@ } static struct module_search *add_search(const char *search_path, + size_t len, struct module_search *search) { @@ -950,6 +919,7 @@ new = NOFAIL(malloc(sizeof(*new))); new->search_path = NOFAIL(strdup(search_path)); + new->len = len; new->next = search; return new; @@ -973,11 +943,13 @@ /* Recursion */ static int read_config(const char *filename, const char *basedir, + const char *kernelversion, struct module_search **search, struct module_overrides **overrides); static int read_config_file(const char *filename, const char *basedir, + const char *kernelversion, struct module_search **search, struct module_overrides **overrides) { @@ -1005,25 +977,49 @@ if (strcmp(cmd, "search") == 0) { char *search_path; - while ((search_path = strsep_skipspace(&ptr, "\t "))) - *search = add_search(search_path, *search); + while ((search_path = strsep_skipspace(&ptr, "\t "))) { + char *dirname; + size_t len; + + if (strcmp(search_path, + MODULE_BUILTIN_KEY) == 0) { + *search = add_search(MODULE_BUILTIN_KEY, + 0, *search); + continue; + } + len = strlen(basedir) + + strlen(MODULE_DIR) + + strlen(kernelversion) + + 1 + + strlen(search_path); + dirname = NOFAIL(malloc(len + 1)); + sprintf(dirname, "%s%s%s/%s", basedir, + MODULE_DIR, kernelversion, search_path); + *search = add_search(dirname, len, *search); + free(dirname); + } } else if (strcmp(cmd, "override") == 0) { char *pathname = NULL, *version, *subdir; modname = strsep_skipspace(&ptr, "\t "); version = strsep_skipspace(&ptr, "\t "); subdir = strsep_skipspace(&ptr, "\t "); + if (strcmp(version, kernelversion) != 0 && + strcmp(version, "*") != 0) + continue; + pathname = NOFAIL(malloc(strlen(basedir) + strlen(MODULE_DIR) - + strlen(version) + + strlen(kernelversion) + strlen(subdir) + strlen(modname) + strlen(".ko") + 3)); sprintf(pathname, "%s%s%s/%s/%s.ko", basedir, - MODULE_DIR, version, subdir, modname); + MODULE_DIR, kernelversion, subdir, modname); *overrides = add_override(pathname, *overrides); + free(pathname); } else if (strcmp(cmd, "include") == 0) { char *newfilename; @@ -1032,6 +1028,7 @@ grammar(cmd, filename, linenum); else { if (!read_config(newfilename, basedir, + kernelversion, search, overrides)) warn("Failed to open included" " config file %s: %s\n", @@ -1050,6 +1047,7 @@ Returns true or false. */ static int read_config(const char *filename, const char *basedir, + const char *kernelversion, struct module_search **search, struct module_overrides **overrides) { @@ -1066,8 +1064,8 @@ + strlen(i->d_name) + 1]; sprintf(sub, "%s/%s", filename, i->d_name); - if (!read_config(sub, basedir, search, - overrides)) + if (!read_config(sub, basedir, kernelversion, + search, overrides)) warn("Failed to open" " config file %s: %s\n", sub, strerror(errno)); @@ -1076,7 +1074,8 @@ closedir(dir); ret = 1; } else { - if (read_config_file(filename, basedir, search, overrides)) + if (read_config_file(filename, basedir, kernelversion, search, + overrides)) ret = 1; } @@ -1091,13 +1090,15 @@ static void read_toplevel_config(const char *filename, const char *basedir, + const char *kernelversion, struct module_search **search, struct module_overrides **overrides) { unsigned int i; if (filename) { - if (!read_config(filename, basedir, search, overrides)) + if (!read_config(filename, basedir, kernelversion, search, + overrides)) fatal("Failed to open config file %s: %s\n", filename, strerror(errno)); return; @@ -1105,7 +1106,8 @@ /* Try defaults. */ for (i = 0; i < ARRAY_SIZE(default_configs); i++) { - if (read_config(default_configs[i], basedir, search, overrides)) + if (read_config(default_configs[i], basedir, kernelversion, + search, overrides)) return; } } @@ -1211,14 +1213,14 @@ all = 1; } - read_toplevel_config(config, basedir, &search, &overrides); + read_toplevel_config(config, basedir, version, &search, &overrides); /* For backward compatibility add "updates" to the head of the search * list here. But only if there was no "search" option specified. */ if (!search) - search = add_search("updates",search); + search = add_search("updates", strlen("updates"), search); if (!all) { /* Do command line args. */ ++++++ weak-modules2 ++++++ --- /var/tmp/diff_new_pack.K27557/_old 2009-02-07 09:13:47.000000000 +0100 +++ /var/tmp/diff_new_pack.K27557/_new 2009-02-07 09:13:47.000000000 +0100 @@ -202,9 +202,9 @@ # KMPs can only be added if none of the module basenames overlap basenames_are_unique() { - local kmp=$1 krel=$2 + local kmp=$1 krel=$2 basedir=$3 - local weak_updates=/lib/modules/$krel/weak-updates/ + local weak_updates=$basedir/lib/modules/$krel/weak-updates/ [ -d "$weak_updates" ] || return 0 [ -z "$(comm -1 -2 $tmpdir/basenames-$kmp \ @@ -225,7 +225,7 @@ # force doit() to execute the commands (in $tmpdir) doit=1 remove_kmp_modules "$old_kmp" "$krel" "$basedir" - if ! basenames_are_unique "$new_kmp" "$krel"; then + if ! basenames_are_unique "$new_kmp" "$krel" "$basedir"; then doit=1 add_kmp_modules "$old_kmp" "$krel" "$basedir" return 1 fi @@ -298,12 +298,14 @@ [ -e "$symlink" ] || continue [ -L "$symlink" ] || return - old_kmp=$(grep -l "$(readlink "$symlink")" $tmpdir/modules-*) || return + old_kmp=$(grep -l "$(readlink "$symlink")" $tmpdir/modules-* | sed 's:.*/modules-::' ) || return # The package %NAME must be the same - [ "${old_kmp%-*-*}" != "${new_kmp%-*-*}" ] || return + [ "${old_kmp%-*-*}" == "${new_kmp%-*-*}" ] || return # The other kmp must be older - [ "$(grep -n "$old_kmp" $tmpdir/kmps)" -gt \ - "$(grep -n "$new_kmp" $tmpdir/kmps)" ] || return + while read kmp; do + [ "$kmp" == "$old_kmp" ] && return + [ "$kmp" == "$new_kmp" ] && break + done <$tmpdir/kmps done < $tmpdir/modules-$new_kmp echo "$old_kmp" } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org