wok view busybox/stuff/busybox-1.12.0-modprobe.u @ 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 a4138e62dd41
children 85fbd04c1fd6
line source
1 --- busybox-1.12.0/modutils/modprobe.c
2 +++ busybox-1.12.0/modutils/modprobe.c
3 @@ -932,8 +932,9 @@
4 opt = getopt32(argv, MAIN_OPT_STR, &unused, &unused);
5 argv += optind;
7 - if (opt & (DUMP_CONF_EXIT | LIST_ALL))
8 + if (opt & DUMP_CONF_EXIT)
9 return EXIT_SUCCESS;
10 +
11 if (opt & (RESTRICT_DIR | CONFIG_FILE))
12 bb_error_msg_and_die("-t and -C not supported");
14 @@ -942,6 +943,15 @@
15 if (!depend)
16 bb_error_msg_and_die("cannot parse "CONFIG_DEFAULT_DEPMOD_FILE);
18 + if (opt & LIST_ALL) {
19 + struct dep_t *dt;
20 + for (dt = depend; dt && dt->m_path; dt = dt->m_next) {
21 + if (*argv && fnmatch(*argv,dt->m_name,0)) continue;
22 + puts(dt->m_path);
23 + }
24 + return EXIT_SUCCESS;
25 + }
26 +
27 if (remove_opt) {
28 do {
29 /* (*argv) can be NULL here */