Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/debianutils/run_parts.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/debianutils/run_parts.c
r2725 r3232 5 5 * Copyright (C) 2007 Bernhard Reutner-Fischer 6 6 * 7 * Based on a older version that was in busybox which was 1k big. .7 * Based on a older version that was in busybox which was 1k big. 8 8 * Copyright (C) 2001 by Emanuele Aina <emanuele.aina@tiscali.it> 9 9 * … … 11 11 * Copyright (C) 1996 Jeff Noxon <jeff@router.patch.net>, 12 12 * Copyright (C) 1996-1999 Guy Maor <maor@debian.org> 13 *14 13 * 15 14 * Licensed under GPLv2 or later, see file LICENSE in this source tree. … … 20 19 21 20 /* This piece of code is heavily based on the original version of run-parts, 22 * taken from debian-utils. I've only removed the long options and athe21 * taken from debian-utils. I've only removed the long options and the 23 22 * report mode. As the original run-parts support only long options, I've 24 23 * broken compatibility because the BusyBox policy doesn't allow them. … … 30 29 * -u MASK umask. Set the umask of the program executed to MASK. 31 30 */ 31 32 //usage:#define run_parts_trivial_usage 33 //usage: "[-t"IF_FEATURE_RUN_PARTS_FANCY("l")"] [-a ARG]... [-u MASK] DIRECTORY" 34 //usage:#define run_parts_full_usage "\n\n" 35 //usage: "Run a bunch of scripts in DIRECTORY\n" 36 //usage: "\n -t Dry run" 37 //usage: IF_FEATURE_RUN_PARTS_FANCY( 38 //usage: "\n -l Print names of matching files even if they are not executable" 39 //usage: ) 40 //usage: "\n -a ARG Pass ARG as argument to programs" 41 //usage: "\n -u MASK Set umask to MASK before running programs" 42 //usage: 43 //usage:#define run_parts_example_usage 44 //usage: "$ run-parts -a start /etc/init.d\n" 45 //usage: "$ run-parts -a stop=now /etc/init.d\n\n" 46 //usage: "Let's assume you have a script foo/dosomething:\n" 47 //usage: "#!/bin/sh\n" 48 //usage: "for i in $*; do eval $i; done; unset i\n" 49 //usage: "case \"$1\" in\n" 50 //usage: "start*) echo starting something;;\n" 51 //usage: "stop*) set -x; shutdown -h $stop;;\n" 52 //usage: "esac\n\n" 53 //usage: "Running this yields:\n" 54 //usage: "$run-parts -a stop=+4m foo/\n" 55 //usage: "+ shutdown -h +4m" 32 56 33 57 #include "libbb.h" … … 42 66 #define cur (G.cur ) 43 67 #define cmd (G.cmd ) 68 #define INIT_G() do { } while (0) 44 69 45 70 enum { NUM_CMD = (COMMON_BUFSIZE - sizeof(G)) / sizeof(cmd[0]) - 1 }; … … 119 144 int ret; 120 145 146 INIT_G(); 147 121 148 #if ENABLE_FEATURE_RUN_PARTS_LONG_OPTIONS 122 149 applet_long_options = runparts_longopts;
Note:
See TracChangeset
for help on using the changeset viewer.