summaryrefslogtreecommitdiffstats
path: root/scripts/patchfns.in
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2005-08-26 09:58:02 +0000
committerAndreas Gruenbacher <agruen@suse.de>2005-08-26 09:58:02 +0000
commit398320a0614fca46140cd715dcdf7dd370357d28 (patch)
treeded517b5b67699f3fe4f77fddc38e6601f57fd51 /scripts/patchfns.in
parent75e9d92478697b476c651825130532b7c3d18f67 (diff)
downloadquilt-398320a0614fca46140cd715dcdf7dd370357d28.tar.gz
- scripts/patchfns.in: insert_in_series(): Insert new patches
before the following patch instead of after the top patch. When no patch is in the series file, insert the new patch at the end (i.e., after comments from setup, etc.) instead of at the top.
Diffstat (limited to 'scripts/patchfns.in')
-rw-r--r--scripts/patchfns.in12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/patchfns.in b/scripts/patchfns.in
index 0738a1b..c5156e2 100644
--- a/scripts/patchfns.in
+++ b/scripts/patchfns.in
@@ -191,7 +191,7 @@ patch_in_series()
insert_in_series()
{
local patch=$1 patch_args=$2
- local top=$(top_patch) tmpfile
+ local next=$(patches_after "$(top_patch)" | head -n 1) tmpfile
if [ -n "$patch_args" ]
then
@@ -200,12 +200,12 @@ insert_in_series()
tmpfile=$(gen_tempfile) || return 1
mkdir -p $(dirname $SERIES)
- if [ -n "$top" ]
+ if [ -n "$next" ]
then
@AWK@ '
- { print }
- /^'"$(quote_re $top)"'([ \t]|$)/ \
+ /^'"$(quote_re $next)"'([ \t]|$)/ \
{ print "'"$patch$patch_args"'" }
+ { print }
' $SERIES > $tmpfile
status=$?
if [ $status -ne 0 ]
@@ -214,11 +214,11 @@ insert_in_series()
return 1
fi
else
- echo "$patch$patch_args" > $tmpfile
if [ -e $SERIES ]
then
- cat $SERIES >> $tmpfile
+ cat $SERIES > $tmpfile
fi
+ echo "$patch$patch_args" >> $tmpfile
fi
cat $tmpfile > $SERIES
rm -f $tmpfile