Added a generator for CPAN expressions. Expressions often require manual editing, but still something..
svn path=/nixpkgs/trunk/; revision=11947
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
|
||||
# First argument: command to run
|
||||
# Second argument: cache name
|
||||
# Third argument: argument to command
|
||||
# Fourth argument: cache type
|
||||
cached_output () {
|
||||
cmd="$1";
|
||||
basename="$2";
|
||||
arg="$3";
|
||||
ext="$4";
|
||||
|
||||
if ! [ -e "cache-${ext//./-}/${basename}.${ext}" ]; then
|
||||
mkdir -p "cache-${ext//./-}";
|
||||
$cmd $arg > "cache-${ext//./-}/${basename}.${ext}";
|
||||
fi;
|
||||
|
||||
cat "cache-${ext//./-}/${basename}.${ext}";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user