Created
January 10, 2011 12:32
-
-
Save wvl/772719 to your computer and use it in GitHub Desktop.
map reduce with redo: apenwarr #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ -n "$OK_TO_STAMP" ] || exit 99 | |
redo-ifchange $1.data | |
date # make sure the file is nonempty so redo-targets remembers it | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo $ARGV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filelist() | |
{ | |
# FIXME: maybe delete .stamp files where the corresponding .data | |
# has been deleted, before running redo-ood | |
redo-ood | grep '.stamp$' || true | |
for d in *.data; do | |
echo "${d%.data}.stamp" | |
done | sort >all-targets | |
redo-targets | sort >known-targets | |
comm -2 -3 all-targets known-targets | |
} | |
targets=$(filelist | sort | uniq) | |
sh do-reduce $targets | |
# only stamp them *after* reduce-files succeeds! | |
OK_TO_STAMP=1 redo-ifchange $targets | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment