From cdc2a8419fb367c46447e183153e7f6ed2317be1 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Tue, 27 Jun 2006 20:20:58 +0000 Subject: - quilt/push.in: Fix a bug introduced with the -p ab support. - test/dir-a-b.test: Add a regression test case for this fix. --- po/de.po | 23 +++++++++++++---------- po/fr.po | 23 +++++++++++++---------- po/ja.po | 23 +++++++++++++---------- po/quilt.pot | 22 ++++++++++++---------- quilt.changes | 6 ++++++ quilt/patches.in | 7 +++++-- quilt/scripts/patchfns.in | 18 ++++++++++++++++-- test/dir-a-b.test | 43 +++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 121 insertions(+), 44 deletions(-) create mode 100644 test/dir-a-b.test diff --git a/po/de.po b/po/de.po index ec59c27..eb892c6 100644 --- a/po/de.po +++ b/po/de.po @@ -27,6 +27,7 @@ msgid "Commands are:" msgstr "Vorhandene Befehle:" #: bin/quilt.in:40 +#, fuzzy msgid "" "\n" "Global options:\n" @@ -37,7 +38,9 @@ msgid "" "--quiltrc file\n" "\tUse the specified configuration file instead of ~/.quiltrc (or\n" "\t/etc/quilt.quiltrc if ~/.quiltrc does not exist). See the pdf\n" -"\tdocumentation for details about its possible contents.\n" +"\tdocumentation for details about its possible contents. The\n" +"\tspecial value \\\"-\\\" causes quilt not to read any configuration\n" +"\tfile.\n" "\n" "--version\n" "\tPrint the version number and exit immediately." @@ -177,11 +180,11 @@ msgstr "" msgid "No next patch\\n" msgstr "Kein Patch %s\\n" -#: quilt/delete.in:95 quilt/scripts/patchfns.in:461 +#: quilt/delete.in:95 quilt/scripts/patchfns.in:475 msgid "No patches in series\\n" msgstr "Keine Patches in der series-Datei\\n" -#: quilt/delete.in:101 quilt/scripts/patchfns.in:559 +#: quilt/delete.in:101 quilt/scripts/patchfns.in:573 msgid "Patch %s is currently applied\\n" msgstr "Patch %s ist momentan angewandt\\n" @@ -946,7 +949,7 @@ msgstr "Patch %s muss zuerst aufgefrischt werden (Refresh).\\n" msgid "No patch removed\\n" msgstr "Kein Patch entfernt\\n" -#: quilt/pop.in:267 quilt/scripts/patchfns.in:474 +#: quilt/pop.in:267 quilt/scripts/patchfns.in:488 msgid "No patches applied\\n" msgstr "Keine Patches angewandt\\n" @@ -1289,23 +1292,23 @@ msgstr "Datei %s ist verschwunden\n" msgid "Failed to rename %s to %s: %s\n" msgstr "Konnte %s nicht auf %s umbenennen: %s\n" -#: quilt/scripts/patchfns.in:510 +#: quilt/scripts/patchfns.in:524 msgid "Patch %s is not in series\\n" msgstr "Patch %s ist nicht in der series-Datei\\n" -#: quilt/scripts/patchfns.in:538 +#: quilt/scripts/patchfns.in:552 msgid "Patch %s is not applied\\n" msgstr "Patch %s ist nicht angewandt\\n" -#: quilt/scripts/patchfns.in:575 +#: quilt/scripts/patchfns.in:589 msgid "File series fully applied, ends at patch %s\\n" msgstr "series-Datei vollständig angewandt, endet in Patch %s\\n" -#: quilt/scripts/patchfns.in:597 +#: quilt/scripts/patchfns.in:611 msgid "Patch %s does not exist\\n" msgstr "Patch %s existiert nicht\\n" -#: quilt/scripts/patchfns.in:857 +#: quilt/scripts/patchfns.in:871 msgid "" "The quilt meta-data in this tree has version %s, but this version of quilt " "can only handle meta-data formats up to and including version %s. Please pop " @@ -1318,7 +1321,7 @@ msgstr "" "quilt alle Patches mit der Version von quilt, die zur Erstellung des " "Arbeitsverzeichnisses verwendet wurde.\\n" -#: quilt/scripts/patchfns.in:942 +#: quilt/scripts/patchfns.in:956 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" diff --git a/po/fr.po b/po/fr.po index 47fc2fc..d465b3b 100644 --- a/po/fr.po +++ b/po/fr.po @@ -26,6 +26,7 @@ msgid "Commands are:" msgstr "Les commandes sont :" #: bin/quilt.in:40 +#, fuzzy msgid "" "\n" "Global options:\n" @@ -36,7 +37,9 @@ msgid "" "--quiltrc file\n" "\tUse the specified configuration file instead of ~/.quiltrc (or\n" "\t/etc/quilt.quiltrc if ~/.quiltrc does not exist). See the pdf\n" -"\tdocumentation for details about its possible contents.\n" +"\tdocumentation for details about its possible contents. The\n" +"\tspecial value \\\"-\\\" causes quilt not to read any configuration\n" +"\tfile.\n" "\n" "--version\n" "\tPrint the version number and exit immediately." @@ -177,11 +180,11 @@ msgstr "" msgid "No next patch\\n" msgstr "Pas de patch suivant\\n" -#: quilt/delete.in:95 quilt/scripts/patchfns.in:461 +#: quilt/delete.in:95 quilt/scripts/patchfns.in:475 msgid "No patches in series\\n" msgstr "Aucun patch dans la série\\n" -#: quilt/delete.in:101 quilt/scripts/patchfns.in:559 +#: quilt/delete.in:101 quilt/scripts/patchfns.in:573 msgid "Patch %s is currently applied\\n" msgstr "Le patch %s est actuellement appliqué\\n" @@ -958,7 +961,7 @@ msgstr "Le patch %s doit msgid "No patch removed\\n" msgstr "Aucun patch retiré\\n" -#: quilt/pop.in:267 quilt/scripts/patchfns.in:474 +#: quilt/pop.in:267 quilt/scripts/patchfns.in:488 msgid "No patches applied\\n" msgstr "Aucun patch n'est appliqué\\n" @@ -1304,23 +1307,23 @@ msgstr "Le fichier %s a disparu !\n" msgid "Failed to rename %s to %s: %s\n" msgstr "Impossible de renommer %s en %s : %s\n" -#: quilt/scripts/patchfns.in:510 +#: quilt/scripts/patchfns.in:524 msgid "Patch %s is not in series\\n" msgstr "Le patch %s n'est pas dans la série\\n" -#: quilt/scripts/patchfns.in:538 +#: quilt/scripts/patchfns.in:552 msgid "Patch %s is not applied\\n" msgstr "Le patch %s n'est pas appliqué\\n" -#: quilt/scripts/patchfns.in:575 +#: quilt/scripts/patchfns.in:589 msgid "File series fully applied, ends at patch %s\\n" msgstr "La série est complètement appliquée. Le dernier patch est %s.\\n" -#: quilt/scripts/patchfns.in:597 +#: quilt/scripts/patchfns.in:611 msgid "Patch %s does not exist\\n" msgstr "Le patch %s n'existe pas\\n" -#: quilt/scripts/patchfns.in:857 +#: quilt/scripts/patchfns.in:871 msgid "" "The quilt meta-data in this tree has version %s, but this version of quilt " "can only handle meta-data formats up to and including version %s. Please pop " @@ -1332,7 +1335,7 @@ msgstr "" "format %s (inclus). Veuillez retirer vos patches avec la version \n" "utilisée pour les appliquer avant d'installer une version plus ancienne.\\n" -#: quilt/scripts/patchfns.in:942 +#: quilt/scripts/patchfns.in:956 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" diff --git a/po/ja.po b/po/ja.po index 729ad87..f419e03 100644 --- a/po/ja.po +++ b/po/ja.po @@ -25,6 +25,7 @@ msgid "Commands are:" msgstr "コマンド一覧:" #: bin/quilt.in:40 +#, fuzzy msgid "" "\n" "Global options:\n" @@ -35,7 +36,9 @@ msgid "" "--quiltrc file\n" "\tUse the specified configuration file instead of ~/.quiltrc (or\n" "\t/etc/quilt.quiltrc if ~/.quiltrc does not exist). See the pdf\n" -"\tdocumentation for details about its possible contents.\n" +"\tdocumentation for details about its possible contents. The\n" +"\tspecial value \\\"-\\\" causes quilt not to read any configuration\n" +"\tfile.\n" "\n" "--version\n" "\tPrint the version number and exit immediately." @@ -174,11 +177,11 @@ msgstr "" msgid "No next patch\\n" msgstr "次ã®ãƒ‘ッãƒã¯ã‚ã‚Šã¾ã›ã‚“\\n" -#: quilt/delete.in:95 quilt/scripts/patchfns.in:461 +#: quilt/delete.in:95 quilt/scripts/patchfns.in:475 msgid "No patches in series\\n" msgstr "シリーズã«ç™»éŒ²ã•ã‚Œã¦ã„るパッãƒãŒã‚ã‚Šã¾ã›ã‚“\\n" -#: quilt/delete.in:101 quilt/scripts/patchfns.in:559 +#: quilt/delete.in:101 quilt/scripts/patchfns.in:573 msgid "Patch %s is currently applied\\n" msgstr "パッム%s ã¯ç¾åœ¨é©ç”¨ã•ã‚Œã¦ã„ã¾ã™\\n" @@ -924,7 +927,7 @@ msgstr "最åˆã«ã€ãƒ‘ッム%s ã®ãƒªãƒ•ãƒ¬ãƒƒã‚·ãƒ¥ãŒå¿…è¦ã§ã™ã€‚\\n" msgid "No patch removed\\n" msgstr "é©ç”¨ã•ã‚Œã¦ã„るパッãƒã¯ã‚ã‚Šã¾ã›ã‚“\\n" -#: quilt/pop.in:267 quilt/scripts/patchfns.in:474 +#: quilt/pop.in:267 quilt/scripts/patchfns.in:488 msgid "No patches applied\\n" msgstr "é©ç”¨ã•ã‚Œã¦ã„るパッãƒã¯ã‚ã‚Šã¾ã›ã‚“\\n" @@ -1259,24 +1262,24 @@ msgstr "ファイル %s ãŒæ¶ˆãˆã¾ã—ãŸ!\n" msgid "Failed to rename %s to %s: %s\n" msgstr "パッム%s ã‹ã‚‰ %sã¸ã®åå‰ã®å¤‰æ›´ã«å¤±æ•—ã—ã¾ã—ãŸ: %s\n" -#: quilt/scripts/patchfns.in:510 +#: quilt/scripts/patchfns.in:524 msgid "Patch %s is not in series\\n" msgstr "パッム%s 㯠seriesã®ä¸­ã«ã‚ã‚Šã¾ã›ã‚“\\n" -#: quilt/scripts/patchfns.in:538 +#: quilt/scripts/patchfns.in:552 msgid "Patch %s is not applied\\n" msgstr "パッム%s ã¯é©ç”¨ã•ã‚Œã¦ã„ã¾ã›ã‚“\\n" -#: quilt/scripts/patchfns.in:575 +#: quilt/scripts/patchfns.in:589 msgid "File series fully applied, ends at patch %s\\n" msgstr "" "seriesファイルã®ãƒ‘ッãƒã¯ã™ã¹ã¦é©ç”¨ã•ã‚Œã¦ã„ã¾ã™ã€‚最終パッãƒã¯ %s ã§ã™ã€‚\\n" -#: quilt/scripts/patchfns.in:597 +#: quilt/scripts/patchfns.in:611 msgid "Patch %s does not exist\\n" msgstr "パッム%s ãŒå­˜åœ¨ã—ã¾ã›ã‚“\\n" -#: quilt/scripts/patchfns.in:857 +#: quilt/scripts/patchfns.in:871 msgid "" "The quilt meta-data in this tree has version %s, but this version of quilt " "can only handle meta-data formats up to and including version %s. Please pop " @@ -1288,7 +1291,7 @@ msgstr "" "ã¦ã„ã¾ã›ã‚“。ダウングレードã™ã‚‹å‰ã«ã€pushã—ãŸãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® quiltを使ã£ã¦ã€\n" "ã™ã¹ã¦ã®ãƒ‘ッãƒã‚’ pop ã—ã¦ãã ã•ã„。\\n" -#: quilt/scripts/patchfns.in:942 +#: quilt/scripts/patchfns.in:956 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" diff --git a/po/quilt.pot b/po/quilt.pot index 2067d0c..78b5337 100644 --- a/po/quilt.pot +++ b/po/quilt.pot @@ -21,7 +21,9 @@ msgid "" "--quiltrc file\n" "\tUse the specified configuration file instead of ~/.quiltrc (or\n" "\t/etc/quilt.quiltrc if ~/.quiltrc does not exist). See the pdf\n" -"\tdocumentation for details about its possible contents.\n" +"\tdocumentation for details about its possible contents. The\n" +"\tspecial value \\\"-\\\" causes quilt not to read any configuration\n" +"\tfile.\n" "\n" "--version\n" "\tPrint the version number and exit immediately." @@ -117,11 +119,11 @@ msgstr "" msgid "No next patch\\n" msgstr "" -#: quilt/delete.in:95 quilt/scripts/patchfns.in:461 +#: quilt/delete.in:95 quilt/scripts/patchfns.in:475 msgid "No patches in series\\n" msgstr "" -#: quilt/delete.in:101 quilt/scripts/patchfns.in:559 +#: quilt/delete.in:101 quilt/scripts/patchfns.in:573 msgid "Patch %s is currently applied\\n" msgstr "" @@ -641,7 +643,7 @@ msgstr "" msgid "No patch removed\\n" msgstr "" -#: quilt/pop.in:267 quilt/scripts/patchfns.in:474 +#: quilt/pop.in:267 quilt/scripts/patchfns.in:488 msgid "No patches applied\\n" msgstr "" @@ -885,23 +887,23 @@ msgstr "" msgid "Failed to rename %s to %s: %s\n" msgstr "" -#: quilt/scripts/patchfns.in:510 +#: quilt/scripts/patchfns.in:524 msgid "Patch %s is not in series\\n" msgstr "" -#: quilt/scripts/patchfns.in:538 +#: quilt/scripts/patchfns.in:552 msgid "Patch %s is not applied\\n" msgstr "" -#: quilt/scripts/patchfns.in:575 +#: quilt/scripts/patchfns.in:589 msgid "File series fully applied, ends at patch %s\\n" msgstr "" -#: quilt/scripts/patchfns.in:597 +#: quilt/scripts/patchfns.in:611 msgid "Patch %s does not exist\\n" msgstr "" -#: quilt/scripts/patchfns.in:857 +#: quilt/scripts/patchfns.in:871 msgid "" "The quilt meta-data in this tree has version %s, but this version of quilt " "can only handle meta-data formats up to and including version %s. Please pop " @@ -909,7 +911,7 @@ msgid "" "downgrading.\\n" msgstr "" -#: quilt/scripts/patchfns.in:942 +#: quilt/scripts/patchfns.in:956 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" diff --git a/quilt.changes b/quilt.changes index 5673e3c..c3c8a64 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jun 27 22:22:15 CEST 2006 - agruen@suse.de + +- quilt/push.in: Fix a bug introduced with the -p ab support. +- test/dir-a-b.test: Add a regression test case for this fix. + ------------------------------------------------------------------- Tue Jun 27 21:30:19 CEST 2006 - agruen@suse.de diff --git a/quilt/patches.in b/quilt/patches.in index 3172a16..1b1662a 100644 --- a/quilt/patches.in +++ b/quilt/patches.in @@ -68,13 +68,16 @@ touched_by_patch() scan_unapplied() { - local prefix=$1 file=$2 + local prefix=$1 file=$2 strip shift 2 local file_bre="$(quote_bre $file)" patch for patch in "$@" do - if touched_by_patch $(patch_strip_level $patch) $patch \ + strip=$(patch_strip_level $patch) + [ "$strip" = ab ] && strip=1 + + if touched_by_patch $strip $patch \ | grep -q "^$file_bre\$" then echo "$prefix$(print_patch $patch)" diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in index 394d26b..05a6072 100644 --- a/quilt/scripts/patchfns.in +++ b/quilt/scripts/patchfns.in @@ -127,7 +127,7 @@ patch_file_name() } # The -pN option and possibly others that should be passed to patch. -patch_args() +real_patch_args() { local patch=$1 @@ -147,10 +147,24 @@ patch_args() fi } +patch_args() { + local patch=$1 i + + for i in $(real_patch_args $patch) + do + if [ "$i" = -pab ] + then + echo -p1 + else + echo "$i" + fi + done +} + patch_strip_level() { local patch=$1 i - for i in $(patch_args $patch) + for i in $(real_patch_args $patch) do case $i in -p) diff --git a/test/dir-a-b.test b/test/dir-a-b.test new file mode 100644 index 0000000..01f0287 --- /dev/null +++ b/test/dir-a-b.test @@ -0,0 +1,43 @@ + $ rm -rf d + $ mkdir -p d/patches + $ cd d + + $ echo a > test.txt + + $ cat > patches/ab.diff + < --- a/test.txt + < +++ b/test.txt + < @@ -1 +1 @@ + < -a + < +b + + $ echo "ab.diff -pab" > patches/series + + $ quilt push -q + > Applying patch patches/ab.diff + > Now at patch patches/ab.diff + + $ quilt diff --no-index + > --- a/test.txt + > +++ b/test.txt + > @@ -1 +1 @@ + > -a + > +b + + $ rm patches/ab.diff + $ quilt refresh --no-index + > Refreshed patch patches/ab.diff + + $ cat patches/ab.diff + > --- a/test.txt + > +++ b/test.txt + > @@ -1 +1 @@ + > -a + > +b + + $ quilt pop -qR + > Removing patch patches/ab.diff + > No patches applied + + $ cd .. + $ rm -rf d -- cgit