diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2003-10-21 11:33:11 +0000 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2003-10-21 11:33:11 +0000 |
commit | 4da3ae45ac708347d0c5a375d1ab51095934c971 (patch) | |
tree | f9d3a8348970fceb36cac6b4177c6e5ba5b6b25f /scripts/patchfns.in | |
parent | fce8ac4e187976d47de98fdf30fca3e9f0475208 (diff) | |
download | quilt-4da3ae45ac708347d0c5a375d1ab51095934c971.tar.gz |
Add fork command
Diffstat (limited to 'scripts/patchfns.in')
-rw-r--r-- | scripts/patchfns.in | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/scripts/patchfns.in b/scripts/patchfns.in index f16ad4e..1aab136 100644 --- a/scripts/patchfns.in +++ b/scripts/patchfns.in @@ -217,6 +217,28 @@ remove_from_series() fi } +rename_in_series() +{ + local from=$1 to=$2 + + tmpfile=$(gen_tempfile) || return 1 + /usr/bin/gawk ' + /^'"$(quote_re $from)"'(|\.patch|\.diff?)(|\.gz|\.bz2)([ \t]|$)/ \ + { sub(/'"$(quote_re $from)(|\.patch|\.diff?)(|\.gz|\.bz2)"'/, + "'"${to//\"/\\\"}"'") + print + good=1 } + END { exit(! good) } + ' $SERIES > $tmpfile + if [ $? -eq 0 ] + then + mv -f $tmpfile $SERIES + else + rm -f $tmpfile + return 1 + fi +} + pc_file_name() { while [ $# -gt 0 ] @@ -465,6 +487,27 @@ remove_from_db() fi } +rename_in_db() +{ + local from=$1 to=$2 + local tmpfile + tmpfile=$(gen_tempfile) || return 1 + /usr/bin/gawk ' + /^'"$(quote_re $from)"'$/ \ + { sub(/'"$(quote_re $from)"'/, "'"${to//\"/\\\"}"'") + print + good=1 } + END { exit(! good) } + ' $DB > $tmpfile + if [ $? -eq 0 ] + then + mv -f $tmpfile $DB + else + rm -f $tmpfile + return 1 + fi +} + stripit() { if [ -n "$1" ] |