summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2022-09-09 10:10:37 +0200
committerJean Delvare <jdelvare@suse.de>2022-09-09 10:10:37 +0200
commitb01a73783d9e1e2592d3a4c5d95a377ec13d8339 (patch)
tree41b9368b3011366fdbb4c3d97261b3e297af8e97
parentf73f8d7f71de2878d3f92881a5fcb8eafd78cb5f (diff)
downloadquilt-b01a73783d9e1e2592d3a4c5d95a377ec13d8339.tar.gz
patchfns: Rename quote_re() to quote_awk_re()
Now that quote_bre() has been split into quote_re_grep() and quote_re_sed(), rename quote_re() to quote_awk_re() for consistency. Signed-off-by: Jean Delvare <jdelvare@suse.de>
-rw-r--r--quilt/scripts/patchfns.in18
1 files changed, 9 insertions, 9 deletions
diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in
index 1bd7233..1fbf0d8 100644
--- a/quilt/scripts/patchfns.in
+++ b/quilt/scripts/patchfns.in
@@ -90,8 +90,8 @@ quote_sed_re()
echo "$1" | sed -e 's:\([][^$/.*\\]\):\\\1:g'
}
-# Quote a string for use in an extended regular expression.
-quote_re()
+# Quote a string for use in a regular expression for an awk pattern.
+quote_awk_re()
{
echo "$1" | sed -e 's:\([][?{(|)}^$/.+*\\]\):\\\1:g'
}
@@ -184,7 +184,7 @@ change_db_strip_level()
$nr=value
}
- /^'"$(quote_re $patch)"'([ \t]|$)/ \
+ /^'"$(quote_awk_re $patch)"'([ \t]|$)/ \
{ p_printed=0
for (i=2; i<=NF && $i !~ /^#/; i++) {
if ($i ~ /^-p/) {
@@ -250,7 +250,7 @@ insert_in_series()
if [ -n "$before" ]
then
awk '
- /^'"$(quote_re $before)"'([ \t]|$)/ \
+ /^'"$(quote_awk_re $before)"'([ \t]|$)/ \
{ print "'"$patch$patch_args"'" }
{ print }
' "$SERIES" > $tmpfile
@@ -280,7 +280,7 @@ remove_from_series()
tmpfile=$(gen_tempfile) || return 1
awk '
- ! /^'"$(quote_re $patch)"'([ \t]|$)/ \
+ ! /^'"$(quote_awk_re $patch)"'([ \t]|$)/ \
{ print }
' "$SERIES" > $tmpfile
if [ $? -ne 0 ]
@@ -298,8 +298,8 @@ rename_in_series()
tmpfile=$(gen_tempfile) || return 1
awk '
- /^'"$(quote_re $from)"'([ \t]|$)/ \
- { sub(/'"$(quote_re $from)"'/, "'"${to//\"/\\\"}"'")
+ /^'"$(quote_awk_re $from)"'([ \t]|$)/ \
+ { sub(/'"$(quote_awk_re $from)"'/, "'"${to//\"/\\\"}"'")
good=1 }
{ print }
END { exit(! good) }
@@ -319,8 +319,8 @@ rename_in_db()
local tmpfile
tmpfile=$(gen_tempfile) || return 1
awk '
- /^'"$(quote_re $from)"'$/ \
- { sub(/'"$(quote_re $from)"'/, "'"${to//\"/\\\"}"'")
+ /^'"$(quote_awk_re $from)"'$/ \
+ { sub(/'"$(quote_awk_re $from)"'/, "'"${to//\"/\\\"}"'")
good=1 }
{ print }
END { exit(! good) }