diff options
author | Michał Masłowski <mtjm@mtjm.eu> | 2012-02-07 15:10:29 +0100 |
---|---|---|
committer | Michał Masłowski <mtjm@mtjm.eu> | 2012-02-07 15:10:29 +0100 |
commit | 4c4400925b792b694511bbbf2f645fb34495d5cf (patch) | |
tree | 86a3b3c62e75fdf9c536306d195bbbcbc7ac974c /testing/kmod/0007-modinfo-handle-arguments-more-carefully.patch | |
parent | 08adec2ac14efea1ef452e79ff86f024b9becaf3 (diff) | |
parent | 1fa6edfba8d1e31ca1c0d59e8202cd3c62ccf393 (diff) |
Merge branch 'master' of ssh://parabolagnulinux.org:1863/home/parabola/abslibre-pre-mips64el
Conflicts:
community/bwbar/PKGBUILD
community/directfb/PKGBUILD
community/extremetuxracer/PKGBUILD
community/freedroidrpg/PKGBUILD
community/gnash/PKGBUILD
community/guake/PKGBUILD
community/pidgin-libnotify/PKGBUILD
community/png2ico/PKGBUILD
community/ruby-gtk2/PKGBUILD
community/torcs/PKGBUILD
community/virtualbox/PKGBUILD
extra/abiword/PKGBUILD
extra/alsaplayer/PKGBUILD
extra/automoc4/PKGBUILD
extra/cagibi/PKGBUILD
extra/fltk/PKGBUILD
extra/gnome-desktop2/PKGBUILD
extra/gnome-python/PKGBUILD
extra/gnome-sharp/PKGBUILD
extra/gnugo/PKGBUILD
extra/gstreamer0.10-good/PKGBUILD
extra/gtk2/PKGBUILD
extra/gtkmm/PKGBUILD
extra/imlib2/PKGBUILD
extra/koffice/PKGBUILD
extra/lcms/PKGBUILD
extra/libao/PKGBUILD
extra/libcue/PKGBUILD
extra/libdaemon/PKGBUILD
extra/libgnome-media-profiles/PKGBUILD
extra/libotf/PKGBUILD
extra/libotr/PKGBUILD
extra/libots/PKGBUILD
extra/libreoffice/PKGBUILD
extra/libtiff/PKGBUILD
extra/libwebkit/PKGBUILD
extra/libwmf/PKGBUILD
extra/libxfcegui4/PKGBUILD
extra/mjpegtools/PKGBUILD
extra/netpbm/PKGBUILD
extra/php/PKGBUILD
extra/plotutils/PKGBUILD
extra/poppler/PKGBUILD
extra/qrencode/PKGBUILD
extra/qt/PKGBUILD
extra/qtiplot/PKGBUILD
extra/rssh/PKGBUILD
extra/scim-chewing/PKGBUILD
extra/scim-m17n/PKGBUILD
extra/scim-pinyin/PKGBUILD
extra/scim-tables/PKGBUILD
extra/scim-uim/PKGBUILD
extra/tsocks/PKGBUILD
extra/vigra/PKGBUILD
extra/w3m/PKGBUILD
extra/wv/PKGBUILD
extra/xclip/PKGBUILD
extra/xfce4-datetime-plugin/PKGBUILD
extra/xfce4-notes-plugin/PKGBUILD
extra/xfce4-quicklauncher-plugin/PKGBUILD
extra/xfce4-sensors-plugin/PKGBUILD
extra/xorg-font-util/PKGBUILD
extra/xorg-setxkbmap/PKGBUILD
extra/xorg-xev/PKGBUILD
extra/xsane/PKGBUILD
extra/yakuake/PKGBUILD
extra/zvbi/PKGBUILD
multilib/lib32-cairo/PKGBUILD
multilib/lib32-gdk-pixbuf2/PKGBUILD
multilib/lib32-libcanberra/PKGBUILD
multilib/lib32-libcups/PKGBUILD
multilib/lib32-libglade/PKGBUILD
multilib/lib32-libpng/PKGBUILD
multilib/lib32-libtiff/PKGBUILD
multilib/lib32-pango/PKGBUILD
multilib/lib32-qt/PKGBUILD
multilib/lib32-sdl_image/PKGBUILD
multilib/wine/PKGBUILD
testing/vlc/PKGBUILD
testing/xulrunner/PKGBUILD
Diffstat (limited to 'testing/kmod/0007-modinfo-handle-arguments-more-carefully.patch')
-rw-r--r-- | testing/kmod/0007-modinfo-handle-arguments-more-carefully.patch | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/testing/kmod/0007-modinfo-handle-arguments-more-carefully.patch b/testing/kmod/0007-modinfo-handle-arguments-more-carefully.patch deleted file mode 100644 index 389008414..000000000 --- a/testing/kmod/0007-modinfo-handle-arguments-more-carefully.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 2b77a48833818feb8cf35ffac3adcba8de503aec Mon Sep 17 00:00:00 2001 -From: Dan McGee <dan@archlinux.org> -Date: Fri, 3 Feb 2012 20:20:21 -0600 -Subject: [PATCH 7/8] modinfo: handle arguments more carefully - -A simple case of breakage before this commit: - - $ touch aes - $ modinfo aes - filename: /tmp/aes - ERROR: could not get modinfo from 'aes': Invalid argument - -Add a new is_module_filename() function that attempts to do more than -just check if the passed argument is a regular file. We look at the name -for a '.ko' string, and if that is found, ensure it is either at the end -of the string or followed by another '.' (for .gz and .xz modules, for -instance). We don't make this second option conditional on the way the -tools are built with compression support; the file is a module file -regardless and should always be treated that way. - -When doing this, and noticed in the test suite output, we open the -system modules index unconditionally, even if it is never going to be -used during the modinfo call, which is the case when passing module -filenames directly. Delay the opening of the index file until we get an -argument that is not a module filename. - -With-help-from: Dave Reisner <dreisner@archlinux.org> -Signed-off-by: Dan McGee <dan@archlinux.org> ---- - tools/kmod-modinfo.c | 20 +++++++++++++++++--- - 1 files changed, 17 insertions(+), 3 deletions(-) - -diff --git a/tools/kmod-modinfo.c b/tools/kmod-modinfo.c -index 87483a5..ace5d3f 100644 ---- a/tools/kmod-modinfo.c -+++ b/tools/kmod-modinfo.c -@@ -19,6 +19,7 @@ - - #include <stdio.h> - #include <stdlib.h> -+#include <stdbool.h> - #include <getopt.h> - #include <errno.h> - #include <string.h> -@@ -332,6 +333,21 @@ static void help(const char *progname) - progname); - } - -+static bool is_module_filename(const char *name) -+{ -+ struct stat st; -+ const char *ptr; -+ if (stat(name, &st) == 0 && S_ISREG(st.st_mode) && -+ (ptr = strstr(name, ".ko")) != NULL) { -+ /* we screened for .ko; make sure this is either at the end of the name -+ * or followed by another '.' (e.g. gz or xz modules) */ -+ if(ptr[3] != '\0' && ptr[3] != '.') -+ return false; -+ return true; -+ } -+ return false; -+} -+ - static int do_modinfo(int argc, char *argv[]) - { - struct kmod_ctx *ctx; -@@ -418,15 +434,13 @@ static int do_modinfo(int argc, char *argv[]) - fputs("Error: kmod_new() failed!\n", stderr); - return EXIT_FAILURE; - } -- kmod_load_resources(ctx); - - err = 0; - for (i = optind; i < argc; i++) { - const char *name = argv[i]; -- struct stat st; - int r; - -- if (stat(name, &st) == 0 && S_ISREG(st.st_mode)) -+ if (is_module_filename(name)) - r = modinfo_path_do(ctx, name); - else - r = modinfo_alias_do(ctx, name); --- -1.7.9 - |