3 # run-parts - concept taken from Debian
5 # modified for PLD 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
20 echo "Usage: run-parts <dir> <args...>"
25 echo "Is not a directory: $1"
26 echo "Usage: run-parts <dir> <args...>"
30 # assign passed dir name
33 # assign absolute dir name
40 # export directories for our descendants
41 export RUNPARTS_ADIR RUNPARTS_DIR
46 # Ignore *~ and *, scripts
47 for i in $RUNPARTS_DIR/*[!~,] ; do
49 # Don't run *.{rpmsave,rpmorig,rpmnew,swp} scripts
50 [ "${i%.rpmsave}" != "${i}" ] && continue
51 [ "${i%.rpmorig}" != "${i}" ] && continue
52 [ "${i%.rpmnew}" != "${i}" ] && continue
53 [ "${i%.swp}" != "${i}" ] && continue
54 [ "${i%,v}" != "${i}" ] && continue
57 $i $* 2>&1 | awk -v "progname=$i" \