[PATCH] guilt-export exports guards
[guilt/mob.git] / guilt-export
blobc4b1c4950b40da84e62df3cf3b1282378df0213c
1 #!/bin/sh
3 # Copyright (c) Pierre Habouzit, 2007
6 USAGE="[<target_dir>]"
7 . `dirname $0`/guilt
9 if [ $# -gt 1 ]; then
10 usage
12 target_dir=${1:-"patches"}
14 if [ -e "$target_dir" ]; then
15 die "Specified directory already exists"
18 trap "rm -rf \"$target_dir\"" 0
19 mkdir -p "$target_dir"
21 get_full_series | tee "$target_dir/series" | while read p; do
22 silent mkdir -p "`dirname $target_dir/$p`" || true
23 cp "$GUILT_DIR/$branch/$p" "$target_dir/$p"
24 get_guards "$p" | while read g ; do
25 [ "$g" != "" ] && echo -n "$g " >> "$target_dir/series.guards"
26 done
27 echo "$p" >> "$target_dir/series.guards"
28 done
30 trap - 0
31 disp "Series exported to \"$target_dir\" sucessfully."