From brandon@ifup.org Mon Jan 29 19:15:20 2007 Date: Mon, 29 Jan 2007 19:15:20 -0800 From: Brandon Philips To: quilt-dev@nongnu.org Subject: [PATCH] handle quilt import -f -p* and update series Message-ID: <20070130031520.GM5474@plankton.ifup.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) Status: RO Content-Length: 924 Handle the case where the patch that is being replaced with quilt import -f has a different strip level than the one in the series. We don't want this happening: $ quilt import ratings-menu-4762.patch new patch comes with -p0 patch level $ quilt import -f -p0 ratings-menu-4762.patch $ cat series ratings-menu-4762.patch Signed-off-by: Brandon Philips --- quilt/import.in | 3 +++ 1 file changed, 3 insertions(+) Index: quilt/quilt/import.in =================================================================== --- quilt.orig/quilt/import.in +++ quilt/quilt/import.in @@ -178,6 +178,9 @@ do fi printf $"Replacing patch %s with new version\n" \ "$(print_patch $patch)" >&2 + + [ "$opt_strip" != $(patch_strip_level $patch_file) ] \ + && change_db_strip_level "$patch_args" "$patch_file" elif [ -e "$dest" ] then printf $"Importing patch %s\n" "$(print_patch $patch)" From agruen@suse.de Wed Jan 31 11:59:33 2007 Return-Path: From: Andreas Gruenbacher To: quilt-dev@nongnu.org Subject: Re: [Quilt-dev] [PATCH] handle quilt import -f -p* and update series Date: Wed, 31 Jan 2007 11:42:06 -0800 Cc: Brandon Philips References: <20070131183030.GA15576@plankton.ifup.org> In-Reply-To: <20070131183030.GA15576@plankton.ifup.org> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_OEPwFcdPrh80XyC" Message-Id: <200701311142.06954.agruen@suse.de> Content-Length: 2643 --Boundary-00=_OEPwFcdPrh80XyC Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, On Wednesday 31 January 2007 10:30, Brandon Philips wrote: > Handle the case where the patch that is being replaced with quilt import -f > has a different strip level than the one in the series. this always calls change_db_strip_level. How about the attached version instead? (Could you please give it a try to see if it breaks something?) Thanks, Andreas --Boundary-00=_OEPwFcdPrh80XyC Content-Type: text/x-diff; charset="iso-8859-1"; name="import-fix.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="import-fix.diff" ? fix ? import-fix.diff ? quilt/scripts/.patchfns.in.swp Index: quilt.changes =================================================================== RCS file: /sources/quilt/quilt/quilt.changes,v retrieving revision 1.484 diff -u -r1.484 quilt.changes --- quilt.changes 31 Jan 2007 18:47:09 -0000 1.484 +++ quilt.changes 31 Jan 2007 19:40:27 -0000 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Jan 31 11:37:58 PST 2007 - agruen@suse.de + +- quilt import: From Brandon Philips : When + reimporting an existing patch, update the patch strip level in + the series file where necessary. + +------------------------------------------------------------------- Wed Jan 31 10:46:32 PST 2007 - agruen@suse.de - Update the German translation. Index: quilt/import.in =================================================================== RCS file: /sources/quilt/quilt/quilt/import.in,v retrieving revision 1.40 diff -u -r1.40 import.in --- quilt/import.in 1 Jun 2006 10:01:21 -0000 1.40 +++ quilt/import.in 31 Jan 2007 19:40:27 -0000 @@ -102,6 +102,7 @@ eval set -- "$options" +opt_strip=1 while true do case "$1" in @@ -134,8 +135,6 @@ exit 1 fi -[ -n "$opt_strip" ] && patch_args="-p$opt_strip" - for patch_file in "$@" do if [ -n "$opt_patch" ] @@ -178,6 +177,9 @@ fi printf $"Replacing patch %s with new version\n" \ "$(print_patch $patch)" >&2 + + [ "$opt_strip" = "$(patch_strip_level "$patch_file")" ] \ + || change_db_strip_level "-p$opt_strip" "$patch_file" elif [ -e "$dest" ] then printf $"Importing patch %s\n" "$(print_patch $patch)" @@ -201,6 +203,9 @@ [ "$merged_patch_file" != "$patch_file" ] && rm -f "$merged_patch_file" + patch_args= + [ "$opt_strip" = 1 ] || patch_args="-p$opt_strip" + if ! patch_in_series $patch && ! insert_in_series $patch "$patch_args" then --Boundary-00=_OEPwFcdPrh80XyC-- From brandon@ifup.org Mon Feb 12 21:26:44 2007 Date: Mon, 12 Feb 2007 21:26:44 -0800 From: Brandon Philips To: Andreas Gruenbacher Cc: quilt-dev@nongnu.org Subject: Re: [Quilt-dev] [PATCH] handle quilt import -f -p* and update series Message-ID: <20070213052644.GA31608@ifup.org> References: <20070131183030.GA15576@plankton.ifup.org> <200701311142.06954.agruen@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200701311142.06954.agruen@suse.de> User-Agent: Mutt/1.5.13 (2006-08-11) Status: RO Content-Length: 1631 On 11:42 Wed 31 Jan 2007, Andreas Gruenbacher wrote: > Hi, > > On Wednesday 31 January 2007 10:30, Brandon Philips wrote: > > Handle the case where the patch that is being replaced with quilt import -f > > has a different strip level than the one in the series. > > this always calls change_db_strip_level. How about the attached version > instead? (Could you please give it a try to see if it breaks something?) That patch didn't work for me if the argument had a path. eg. /home/philips/import-fix.diff This new patch fixes all of the issues, hopefully. :-) Cheers, Brandon --- quilt/import.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) Index: quilt/import.in =================================================================== --- quilt/import.in.orig +++ quilt/import.in @@ -102,6 +102,7 @@ fi eval set -- "$options" +opt_strip=1 while true do case "$1" in @@ -134,8 +135,6 @@ then exit 1 fi -[ -n "$opt_strip" ] && patch_args="-p$opt_strip" - for patch_file in "$@" do if [ -n "$opt_patch" ] @@ -178,6 +177,9 @@ do fi printf $"Replacing patch %s with new version\n" \ "$(print_patch $patch)" >&2 + + [ "$opt_strip" = "$(patch_strip_level "$patch")" ] \ + || change_db_strip_level "-p$opt_strip" "$patch" elif [ -e "$dest" ] then printf $"Importing patch %s\n" "$(print_patch $patch)" @@ -201,6 +203,9 @@ do [ "$merged_patch_file" != "$patch_file" ] && rm -f "$merged_patch_file" + patch_args= + [ "$opt_strip" = 1 ] || patch_args="-p$opt_strip" + if ! patch_in_series $patch && ! insert_in_series $patch "$patch_args" then