Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/debianutils/run_parts.c

    r2725 r3232  
    55 * Copyright (C) 2007 Bernhard Reutner-Fischer
    66 *
    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.
    88 *   Copyright (C) 2001 by Emanuele Aina <emanuele.aina@tiscali.it>
    99 *
     
    1111 *   Copyright (C) 1996 Jeff Noxon <jeff@router.patch.net>,
    1212 *   Copyright (C) 1996-1999 Guy Maor <maor@debian.org>
    13  *
    1413 *
    1514 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
     
    2019
    2120/* 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 a the
     21 * taken from debian-utils. I've only removed the long options and the
    2322 * report mode. As the original run-parts support only long options, I've
    2423 * broken compatibility because the BusyBox policy doesn't allow them.
     
    3029 * -u MASK      umask. Set the umask of the program executed to MASK.
    3130 */
     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"
    3256
    3357#include "libbb.h"
     
    4266#define cur   (G.cur  )
    4367#define cmd   (G.cmd  )
     68#define INIT_G() do { } while (0)
    4469
    4570enum { NUM_CMD = (COMMON_BUFSIZE - sizeof(G)) / sizeof(cmd[0]) - 1 };
     
    119144    int ret;
    120145
     146    INIT_G();
     147
    121148#if ENABLE_FEATURE_RUN_PARTS_LONG_OPTIONS
    122149    applet_long_options = runparts_longopts;
Note: See TracChangeset for help on using the changeset viewer.