|
| From: | Joe Green |
| Subject: | [Quilt-dev] Re: Bugfix for insertion of patch at beginning of series |
| Date: | Thu, 25 Aug 2005 15:13:55 -0700 |
| User-agent: | Mozilla Thunderbird 1.0.2 (X11/20050317) |
Joe Green wrote:
Yes, this seems to be a simpler fix. I've implemented this alternative in the attached patch. -- Joe Green <address@hidden> MontaVista Software, Inc. |
Source: MontaVista Software, Inc. <address@hidden>
Type: Defect Fix
Disposition: submit to http://savannah.nongnu.org/projects/quilt
Don't insert first patch before any initial directives or comments.
Index: quilt-0.42/scripts/patchfns.in
===================================================================
--- quilt-0.42.orig/scripts/patchfns.in
+++ quilt-0.42/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
| [Prev in Thread] | Current Thread | [Next in Thread] |