wok rev 1430

busybox/modprobe -l: add pattern support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Sep 29 18:12:27 2008 +0200 (2008-09-29)
parents e14946791c05
children cf789d7f5389
files busybox/stuff/busybox-1.12.0-modprobe.u
line diff
     1.1 --- a/busybox/stuff/busybox-1.12.0-modprobe.u	Sun Sep 28 23:14:14 2008 +0200
     1.2 +++ b/busybox/stuff/busybox-1.12.0-modprobe.u	Mon Sep 29 18:12:27 2008 +0200
     1.3 @@ -11,14 +11,15 @@
     1.4   	if (opt & (RESTRICT_DIR | CONFIG_FILE))
     1.5   		bb_error_msg_and_die("-t and -C not supported");
     1.6   
     1.7 -@@ -942,6 +943,14 @@
     1.8 +@@ -942,6 +943,15 @@
     1.9   	if (!depend)
    1.10   		bb_error_msg_and_die("cannot parse "CONFIG_DEFAULT_DEPMOD_FILE);
    1.11   
    1.12  +	if (opt & LIST_ALL) {
    1.13 -+	    struct dep_t *dt;
    1.14 -+	    for (dt = depend; dt && dt->m_path; dt = dt->m_next) {
    1.15 -+			printf("%s\n",dt->m_path);
    1.16 ++		struct dep_t *dt;
    1.17 ++		for (dt = depend; dt && dt->m_path; dt = dt->m_next) {
    1.18 ++			if (*argv && fnmatch(*argv,dt->m_name,0)) continue;
    1.19 ++			puts(dt->m_path);
    1.20  +		}
    1.21  +		return EXIT_SUCCESS;
    1.22  +	}