summaryrefslogtreecommitdiffstats
path: root/scripts/patchfns.in
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2004-03-13 23:25:46 +0000
committerAndreas Gruenbacher <agruen@suse.de>2004-03-13 23:25:46 +0000
commita8592ac4467b34abd9b0ffae9192163dc68112bc (patch)
tree6665dfb526098395d8631e057a44474c6dea2d31 /scripts/patchfns.in
parent8f761704d62fccdf2829c5b3e0203161231f3901 (diff)
downloadquilt-a8592ac4467b34abd9b0ffae9192163dc68112bc.tar.gz
- Revert `quilt fork' to how it originally worked: fork the
*topmost* patch, not the next unapplied patch. Adapt the test suite accordingly. - Add flag to backup-files.c to make sure that files in the working tree have a link count of at most one. Use this where appropriate. - Fix a bug in `quilt snapshot': Taking snapshots caused files to get link counts bigger than one, so modifying them could cause multiple files to get modified. Speed up the command, too. - Update the documentation. Add example1.test from the documentation.
Diffstat (limited to 'scripts/patchfns.in')
-rw-r--r--scripts/patchfns.in21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/patchfns.in b/scripts/patchfns.in
index 38d08a9..5f5bcde 100644
--- a/scripts/patchfns.in
+++ b/scripts/patchfns.in
@@ -267,6 +267,27 @@ rename_in_series()
rm -f $tmpfile
}
+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
+}
+
backup_file_name()
{
local patch=$1