descfile=$indir/datadesc
outdir=data
filter=$1
+force_update=false
process()
{
fi
}
+for arg; do
+ case "$arg" in
+ -f)
+ force=true
+ ;;
+ esac
+done
+
if [ -z "$filter" ]; then
filter='.*'
fi
fname=$(basename $path)
op=$(echo $line | awk -F : '{ print $2; }' | xargs)
- if [ "$op" = nop ]; then
- echo copying $fname
- mkdir -p $outdir/$(dirname $path)
- copy $indir/$path $outdir/$path
- else
- echo processing $fname
- mkdir -p $outdir/$(dirname $path)
- process $indir/$path $outdir/$path "$op"
- fi
+ infile=$indir/$path
+ outfile=$outdir/$path
+
+ if $force_update; then
+ touch "$infile"
+ fi
+
+ if [ "$infile" -nt "$outfile" ]; then
+ if [ "$op" = nop ]; then
+ echo copying $fname
+ mkdir -p $outdir/$(dirname $path)
+ copy $indir/$path $outdir/$path
+ else
+ echo processing $fname
+ mkdir -p $outdir/$(dirname $path)
+ process $indir/$path $outdir/$path "$op"
+ fi
+ fi
fi
done <$descfile