summaryrefslogtreecommitdiffstats
path: root/quilt
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2008-06-13 09:53:49 +0000
committerAndreas Gruenbacher <agruen@suse.de>2008-06-13 09:53:49 +0000
commitb634242a6a11012e45660e6579a0299cf1271ece (patch)
treec8cb115c4d3f32dd3541b1e78be009c0260917f9 /quilt
parent96ac24c4b7712a4db846efd682459dd8dd30732c (diff)
downloadquilt-b634242a6a11012e45660e6579a0299cf1271ece.tar.gz
- quilt/import.in: When importing multiple patches at once, make
sure that they won't end up in the series file in reverse order. This happened because each new patch was inserted before the "next" patch, which made it the new "next" patch.
Diffstat (limited to 'quilt')
-rw-r--r--quilt/import.in3
-rw-r--r--quilt/scripts/patchfns.in6
2 files changed, 5 insertions, 4 deletions
diff --git a/quilt/import.in b/quilt/import.in
index 85160ab..07cb95d 100644
--- a/quilt/import.in
+++ b/quilt/import.in
@@ -151,6 +151,7 @@ then
fi
fi
+before=$(patch_after "$(top_patch)")
for patch_file in "$@"
do
if [ -n "$opt_patch" ]
@@ -217,7 +218,7 @@ do
[ "$merged_patch_file" != "$patch_file" ] && rm -f "$merged_patch_file"
if ! patch_in_series $patch &&
- ! insert_in_series $patch "$patch_args"
+ ! insert_in_series $patch "$patch_args" "$before"
then
printf $"Failed to insert patch %s into file series\n" \
"$(print_patch $patch)" >&2
diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in
index cd27ec9..e299aa1 100644
--- a/quilt/scripts/patchfns.in
+++ b/quilt/scripts/patchfns.in
@@ -238,7 +238,7 @@ patch_in_series()
insert_in_series()
{
local patch=$1 patch_args=$2
- local next=$(patch_after "$(top_patch)") tmpfile
+ local before=${3-$(patch_after "$(top_patch)")} tmpfile
if [ -n "$patch_args" ]
then
@@ -247,10 +247,10 @@ insert_in_series()
tmpfile=$(gen_tempfile) || return 1
mkdir -p $(dirname $SERIES)
- if [ -n "$next" ]
+ if [ -n "$before" ]
then
awk '
- /^'"$(quote_re $next)"'([ \t]|$)/ \
+ /^'"$(quote_re $before)"'([ \t]|$)/ \
{ print "'"$patch$patch_args"'" }
{ print }
' $SERIES > $tmpfile