wok-4.x view busybox/stuff/busybox-1.12.0-modprobe.u @ rev 5120
Fix: gettext dep (issue 272)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat Mar 20 20:21:18 2010 +0100 (2010-03-20) |
parents | 6e89af8c5f82 |
children |
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 */
31 --- busybox-1.12.0/modutils/modprobe.c
32 +++ busybox-1.12.0/modutils/modprobe.c
33 @@ -921,6 +921,20 @@
34 return rc;
35 }
37 +void mod_walk(void (*action)(char *name, char *path, void *env), void *data);
38 +void mod_walk(void (*action)(char *name, char *path, void *env), void *data)
39 +{
40 + struct dep_t *dt;
41 +
42 + depend = build_dep();
43 + if (!depend)
44 + bb_error_msg_and_die("cannot parse "CONFIG_DEFAULT_DEPMOD_FILE);
45 +
46 + for (dt = depend; dt && dt->m_path; dt = dt->m_next) {
47 + action(dt->m_name, dt->m_path, data);
48 + }
49 +}
50 +
51 int modprobe_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
52 int modprobe_main(int argc UNUSED_PARAM, char **argv)
53 {