3 # run-parts - concept taken from Debian
5 # modified for PLD Linux by Pawel Wilk <siefca@pld-linux.org>
8 # 1.) run-parts is now able to get arguments!
9 # 2.) relative pathname of the invoked directory can be
10 # obtained by reading RUNPARTS_DIR env. variable
11 # 3.) absolute pathname of the invoked directory can be
12 # obtained by reading RUNPARTS_ADIR env. variable
15 # keep going when something fails
18 if [ "$1" = "--test" ]; then
23 if [ "$1" = "--" ]; then
29 echo "Usage: run-parts [-u] [--test] <dir> <args...>"
34 echo "Is not a directory: $1"
35 echo "Usage: run-parts [-u] [--test] <dir> <args...>"
39 # assign passed dir name
42 # assign absolute dir name
49 # export directories for our descendants
50 export RUNPARTS_ADIR RUNPARTS_DIR
55 # Ignore *~ and *, scripts
56 for i in $RUNPARTS_DIR/*[!~,] ; do
57 [ -d "$i" ] && continue
58 # Don't run *.{rpmsave,rpmorig,rpmnew,swp} scripts
59 [ "${i%.rpmsave}" != "${i}" ] && continue
60 [ "${i%.rpmorig}" != "${i}" ] && continue
61 [ "${i%.rpmnew}" != "${i}" ] && continue
62 [ "${i%.swp}" != "${i}" ] && continue
63 [ "${i%,v}" != "${i}" ] && continue
67 if [ "$test" = yes ]; then
71 $runprog 2>&1 | awk -v "progname=$i" \