5 echo "Usage: $0 NNN <file>..."
11 [0-9][0-9][0-9]) return 0;;
19 /^(---|\*\*\*|Index:)[ \t][^ \t]|^diff -/ \
31 /^#? .* files? changed(, .* insertions?\(\+\))?(, .* deletions?\(-\))?/ \
39 strip_trailing_whitespace() {
40 sed -e 's:[ '$'\t'']*$::'
47 sub("Subject: \\[[^\]]*\\]", "Subject: [PATCH]")
53 check_number "$BASE" || usage
55 quilt series > /dev/null || {
56 echo "Not in quilt directory"
62 quilt series | while read CUR; do
63 [ -n "$CUR" ] || break
65 check_number "$CUR" || continue
66 [ "$CUR" -lt "$NEW" ] && continue
67 [ "$CUR" -ge "$(($BASE + 100))" ] && continue
78 NAME="$(basename $FILE)"
79 NAME="${NAME#[0-9]*-}"
80 echo -n "Processing patch $NAME: "
83 echo "file $FILE not found"
87 grep -qE "$NAME$" patches/series && {
88 echo "already applied"
92 quilt new "$CUR-$NAME" || exit 1
93 patch_header < "$FILE" |
95 strip_trailing_whitespace |
96 fixup_header > "patches/$CUR-$NAME"
98 quilt fold < "$FILE" || {
99 cp "$FILE" ./cur_patch
100 echo "patch $FILE failed to apply, copied to ./cur_patch"
104 quilt refresh -p ab --no-index --no-timestamps