parallel rule generation

svn path=/trunk/; revision=31276
This commit is contained in:
2015-05-28 14:55:27 +00:00
parent 08e51a9000
commit 78efe8bd06
5 changed files with 106 additions and 100 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/bin/sh
inc_logging=true
logname(){
name="$1"
if [ -w "$statusdir" ] && touch "$statusdir/$name"; then
echo "$statusdir/$name"
elif echo "$forcedlog" |egrep -q "^${name}=.+"; then
echo "$forcedlog" \
| sed -rn "s;^${name}=;;p"
else
echo /dev/null
fi
}
forcelog(){
name="$1"
[ "$(logname "$name")" = "/dev/null" ] \
&& forcedlog="$forcedlog\n${name}=$(tempfile -p w3bld -s $$)"
}
trap "trap - 0 2 3 6 9 15; find \"${TMPDIR:-/tmp}/\" -maxdepth 1 -user \"$USER\" -name \"w3bld*$$\" -delete" 0 2 3 6 9 15
logstatus(){
# pipeline atom to write data streams into a log file
tee "$(logname "$1")"
}