summaryrefslogtreecommitdiffstats
path: root/scripts
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
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')
-rw-r--r--scripts/patchfns.in21
-rwxr-xr-xscripts/rpatch.in3
2 files changed, 23 insertions, 1 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
diff --git a/scripts/rpatch.in b/scripts/rpatch.in
index e3882a9..9b5d6e7 100755
--- a/scripts/rpatch.in
+++ b/scripts/rpatch.in
@@ -130,7 +130,8 @@ rpatch()
then
echo $"Removing $patch"
rm -f "$QUILT_PC/$patch/.timestamp"
- @LIB@/backup-files $silent -f $pc_file -B $QUILT_PC/$patch/ -r
+ @LIB@/backup-files $silent -r -L -f $pc_file \
+ -B $QUILT_PC/$patch/
status=$?
remove_from_db $patch
rm -f $QUILT_PC/$patch~refresh