summaryrefslogtreecommitdiffstats
path: root/scripts/patchfns.in
diff options
context:
space:
mode:
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