diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2006-01-21 18:46:54 +0000 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2006-01-21 18:46:54 +0000 |
commit | 3a6c8c1edcac481e7a13cf9c976edd17a4c92219 (patch) | |
tree | f916c66195d7d3f740cb86357e3e23d8900f8c41 | |
parent | 92401e6ef4284e7228be4faff2915a7d210d3897 (diff) | |
download | quilt-3a6c8c1edcac481e7a13cf9c976edd17a4c92219.tar.gz |
- import command: catch several error conditions. Patches in
QUILT_PATCHES can now e imported. A minor fix in the output.
-rw-r--r-- | po/de.po | 43 | ||||
-rw-r--r-- | po/fr.po | 43 | ||||
-rw-r--r-- | po/ja.po | 43 | ||||
-rw-r--r-- | po/quilt.pot | 40 | ||||
-rw-r--r-- | quilt.changes | 6 | ||||
-rw-r--r-- | quilt/import.in | 26 | ||||
-rw-r--r-- | quilt/scripts/patchfns.in | 22 | ||||
-rw-r--r-- | test/import.test | 27 |
8 files changed, 167 insertions, 83 deletions
@@ -177,12 +177,12 @@ msgstr "" msgid "No next patch\\n" msgstr "Kein Patch %s\\n" -#: quilt/delete.in:95 quilt/scripts/patchfns.in:448 +#: quilt/delete.in:95 quilt/scripts/patchfns.in:442 #, fuzzy msgid "No patches in series\\n" msgstr "Keine Patches in der series-Datei\\n" -#: quilt/delete.in:101 quilt/scripts/patchfns.in:545 +#: quilt/delete.in:101 quilt/scripts/patchfns.in:539 msgid "Patch %s is currently applied\\n" msgstr "Patch %s ist momentan angewandt\\n" @@ -651,27 +651,37 @@ msgstr "" "Die Option \\`-n' kann nur beim Importieren eines einzelnen Patches " "verwendet werden\\n" -#: quilt/import.in:92 +#: quilt/import.in:94 msgid "Patch %s is applied\\n" msgstr "Patch %s ist angewandt\\n" -#: quilt/import.in:100 +#: quilt/import.in:103 +#, fuzzy +msgid "Patch %s already exists in series.\\n" +msgstr "Patch %s ist nicht in der series-Datei\\n" + +#: quilt/import.in:109 msgid "Patch %s exists. Replace with -f.\\n" msgstr "Patch %s existiert bereits. Ersetzen mit -f.\\n" -#: quilt/import.in:104 +#: quilt/import.in:113 msgid "Replacing patch %s with new version\\n" msgstr "Ersetze Patch %s durch neuere Version\\n" -#: quilt/import.in:107 +#: quilt/import.in:117 +#, fuzzy +msgid "Importing patch %s\\n" +msgstr "Entferne patch %s\\n" + +#: quilt/import.in:119 msgid "Importing patch %s (stored as %s)\\n" msgstr "Importiere Patch %s (abgelegt als %s)\\n" -#: quilt/import.in:115 +#: quilt/import.in:128 msgid "Failed to import patch %s\\n" msgstr "Konnte Patch %s nicht importieren\\n" -#: quilt/import.in:122 +#: quilt/import.in:136 msgid "Failed to insert patch %s into file series\\n" msgstr "Konnte Patch %s nicht in die series-Datei einfügen\\n" @@ -865,7 +875,7 @@ msgstr "Patch %s muss zuerst aufgefrischt werden (Refresh).\\n" msgid "No patch removed\\n" msgstr "Kein Patch entfernt\\n" -#: quilt/pop.in:269 quilt/scripts/patchfns.in:461 +#: quilt/pop.in:269 quilt/scripts/patchfns.in:455 msgid "No patches applied\\n" msgstr "Keine Patches angewandt\\n" @@ -1207,19 +1217,24 @@ 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:497 +#: quilt/scripts/patchfns.in:491 msgid "Patch %s is not in series\\n" msgstr "Patch %s ist nicht in der series-Datei\\n" -#: quilt/scripts/patchfns.in:524 +#: quilt/scripts/patchfns.in:518 msgid "Patch %s is not applied\\n" msgstr "Patch %s ist nicht angewandt\\n" -#: quilt/scripts/patchfns.in:561 +#: quilt/scripts/patchfns.in:555 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:801 +#: quilt/scripts/patchfns.in:577 +#, fuzzy +msgid "Patch %s does not exist\\n" +msgstr "Patch %s ist nicht in der series-Datei\\n" + +#: quilt/scripts/patchfns.in:817 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 " @@ -1232,7 +1247,7 @@ msgstr "" "quilt alle Patches mit der Version von quilt, die zur Erstellung des " "Arbeitsverzeichnisses verwendet wurde.\\n" -#: quilt/scripts/patchfns.in:886 +#: quilt/scripts/patchfns.in:902 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" @@ -177,12 +177,12 @@ msgstr "" msgid "No next patch\\n" msgstr "Pas de patch suivant\\n" -#: quilt/delete.in:95 quilt/scripts/patchfns.in:448 +#: quilt/delete.in:95 quilt/scripts/patchfns.in:442 #, fuzzy msgid "No patches in series\\n" msgstr "Aucun patch n'est appliqué\\n" -#: quilt/delete.in:101 quilt/scripts/patchfns.in:545 +#: quilt/delete.in:101 quilt/scripts/patchfns.in:539 msgid "Patch %s is currently applied\\n" msgstr "Le patch %s est actuellement appliqué\\n" @@ -656,27 +656,37 @@ msgid "Option \\`-n' can only be used when importing a single patch\\n" msgstr "" "L'option « -n » ne peut être utilisé que lors de l'import d'un seul patch.\\n" -#: quilt/import.in:92 +#: quilt/import.in:94 msgid "Patch %s is applied\\n" msgstr "Le patch %s n'est pas appliqué\\n" -#: quilt/import.in:100 +#: quilt/import.in:103 +#, fuzzy +msgid "Patch %s already exists in series.\\n" +msgstr "Le patch %s n'est pas dans la série\\n" + +#: quilt/import.in:109 msgid "Patch %s exists. Replace with -f.\\n" msgstr "Le patch %s existe. Utilisez -f pour le remplacer.\\n" -#: quilt/import.in:104 +#: quilt/import.in:113 msgid "Replacing patch %s with new version\\n" msgstr "Remplacement du patch %s avec la nouvelle version\\n" -#: quilt/import.in:107 +#: quilt/import.in:117 +#, fuzzy +msgid "Importing patch %s\\n" +msgstr "Retrait de %s\\n" + +#: quilt/import.in:119 msgid "Importing patch %s (stored as %s)\\n" msgstr "Import du patch %s (enregistré dans %s)\\n" -#: quilt/import.in:115 +#: quilt/import.in:128 msgid "Failed to import patch %s\\n" msgstr "Impossible d'importer le patch %s\\n" -#: quilt/import.in:122 +#: quilt/import.in:136 msgid "Failed to insert patch %s into file series\\n" msgstr "Impossible d'inserer %s dans le fichier de série.\\n" @@ -874,7 +884,7 @@ msgstr "Le patch %s doit être rafraichi au préalable.\\n" msgid "No patch removed\\n" msgstr "Aucun patch retiré\\n" -#: quilt/pop.in:269 quilt/scripts/patchfns.in:461 +#: quilt/pop.in:269 quilt/scripts/patchfns.in:455 msgid "No patches applied\\n" msgstr "Aucun patch n'est appliqué\\n" @@ -1219,19 +1229,24 @@ 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:497 +#: quilt/scripts/patchfns.in:491 msgid "Patch %s is not in series\\n" msgstr "Le patch %s n'est pas dans la série\\n" -#: quilt/scripts/patchfns.in:524 +#: quilt/scripts/patchfns.in:518 msgid "Patch %s is not applied\\n" msgstr "Le patch %s n'est pas appliqué\\n" -#: quilt/scripts/patchfns.in:561 +#: quilt/scripts/patchfns.in:555 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:801 +#: quilt/scripts/patchfns.in:577 +#, fuzzy +msgid "Patch %s does not exist\\n" +msgstr "Le patch %s n'est pas dans la série\\n" + +#: quilt/scripts/patchfns.in:817 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 " @@ -1243,7 +1258,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:886 +#: quilt/scripts/patchfns.in:902 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" @@ -174,12 +174,12 @@ msgstr "" msgid "No next patch\\n" msgstr "次ã®ãƒ‘ッãƒã¯ã‚ã‚Šã¾ã›ã‚“\\n" -#: quilt/delete.in:95 quilt/scripts/patchfns.in:448 +#: quilt/delete.in:95 quilt/scripts/patchfns.in:442 #, fuzzy msgid "No patches in series\\n" msgstr "é©ç”¨ã•ã‚Œã¦ã„るパッãƒã¯ã‚ã‚Šã¾ã›ã‚“\\n" -#: quilt/delete.in:101 quilt/scripts/patchfns.in:545 +#: quilt/delete.in:101 quilt/scripts/patchfns.in:539 msgid "Patch %s is currently applied\\n" msgstr "パッム%s ã¯ç¾åœ¨é©ç”¨ã•ã‚Œã¦ã„ã¾ã™\\n" @@ -631,27 +631,37 @@ msgstr "" msgid "Option \\`-n' can only be used when importing a single patch\\n" msgstr "オプション \\`-n'ã¯ã€ãƒ‘ッãƒã‚’一ã¤ã ã‘å–り込むã¨ãã®ã¿æœ‰åŠ¹ã§ã™ã€‚\\n" -#: quilt/import.in:92 +#: quilt/import.in:94 msgid "Patch %s is applied\\n" msgstr "パッム%s ã¯ã€ã™ã§ã«é©ç”¨ã•ã‚Œã¦ã„ã¾ã™\\n" -#: quilt/import.in:100 +#: quilt/import.in:103 +#, fuzzy +msgid "Patch %s already exists in series.\\n" +msgstr "パッム%s 㯠seriesã®ä¸ã«ã‚ã‚Šã¾ã›ã‚“\\n" + +#: quilt/import.in:109 msgid "Patch %s exists. Replace with -f.\\n" msgstr "パッム%s ã¯ã€ã™ã§ã«å˜åœ¨ã—ã¾ã™ã€‚-fã§ç½®ãæ›ãˆã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚\\n" -#: quilt/import.in:104 +#: quilt/import.in:113 msgid "Replacing patch %s with new version\\n" msgstr "パッム%s ã‚’æ–°ã—ã„ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã«ç½®ãæ›ãˆã¾ã™\\n" -#: quilt/import.in:107 +#: quilt/import.in:117 +#, fuzzy +msgid "Importing patch %s\\n" +msgstr "パッム%s ã‚’ã¯ãšã—ã¾ã™\\n" + +#: quilt/import.in:119 msgid "Importing patch %s (stored as %s)\\n" msgstr "パッム%s ã‚’å–り込んã§ã„ã¾ã™ (%s ã¨ã—ã¦ä¿å˜ã•ã‚Œã¾ã™)\\n" -#: quilt/import.in:115 +#: quilt/import.in:128 msgid "Failed to import patch %s\\n" msgstr "パッム%s ã®å–ã‚Šè¾¼ã¿ã«å¤±æ•—ã—ã¾ã—ãŸ\\n" -#: quilt/import.in:122 +#: quilt/import.in:136 msgid "Failed to insert patch %s into file series\\n" msgstr "seriesファイルã¸ã®ãƒ‘ッム%s ã®æ›¸ãè¾¼ã¿ã«å¤±æ•—ã—ã¾ã—ãŸ\\n" @@ -848,7 +858,7 @@ msgstr "最åˆã«ã€ãƒ‘ッム%s ã®ãƒªãƒ•ãƒ¬ãƒƒã‚·ãƒ¥ãŒå¿…è¦ã§ã™ã€‚\\n" msgid "No patch removed\\n" msgstr "é©ç”¨ã•ã‚Œã¦ã„るパッãƒã¯ã‚ã‚Šã¾ã›ã‚“\\n" -#: quilt/pop.in:269 quilt/scripts/patchfns.in:461 +#: quilt/pop.in:269 quilt/scripts/patchfns.in:455 msgid "No patches applied\\n" msgstr "é©ç”¨ã•ã‚Œã¦ã„るパッãƒã¯ã‚ã‚Šã¾ã›ã‚“\\n" @@ -1182,20 +1192,25 @@ msgstr "ファイル %s ãŒæ¶ˆãˆã¾ã—ãŸ!\n" msgid "Failed to rename %s to %s: %s\n" msgstr "パッム%s ã‹ã‚‰ %sã¸ã®åå‰ã®å¤‰æ›´ã«å¤±æ•—ã—ã¾ã—ãŸ: %s\n" -#: quilt/scripts/patchfns.in:497 +#: quilt/scripts/patchfns.in:491 msgid "Patch %s is not in series\\n" msgstr "パッム%s 㯠seriesã®ä¸ã«ã‚ã‚Šã¾ã›ã‚“\\n" -#: quilt/scripts/patchfns.in:524 +#: quilt/scripts/patchfns.in:518 msgid "Patch %s is not applied\\n" msgstr "パッム%s ã¯é©ç”¨ã•ã‚Œã¦ã„ã¾ã›ã‚“\\n" -#: quilt/scripts/patchfns.in:561 +#: quilt/scripts/patchfns.in:555 msgid "File series fully applied, ends at patch %s\\n" msgstr "" "seriesファイルã®ãƒ‘ッãƒã¯ã™ã¹ã¦é©ç”¨ã•ã‚Œã¦ã„ã¾ã™ã€‚最終パッãƒã¯ %s ã§ã™ã€‚\\n" -#: quilt/scripts/patchfns.in:801 +#: quilt/scripts/patchfns.in:577 +#, fuzzy +msgid "Patch %s does not exist\\n" +msgstr "パッム%s 㯠seriesã®ä¸ã«ã‚ã‚Šã¾ã›ã‚“\\n" + +#: quilt/scripts/patchfns.in:817 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 " @@ -1207,7 +1222,7 @@ msgstr "" "ã¦ã„ã¾ã›ã‚“。ダウングレードã™ã‚‹å‰ã«ã€pushã—ãŸãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® quiltを使ã£ã¦ã€\n" "ã™ã¹ã¦ã®ãƒ‘ッãƒã‚’ pop ã—ã¦ãã ã•ã„。\\n" -#: quilt/scripts/patchfns.in:886 +#: quilt/scripts/patchfns.in:902 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 c2263ec..a29a82a 100644 --- a/po/quilt.pot +++ b/po/quilt.pot @@ -117,11 +117,11 @@ msgstr "" msgid "No next patch\\n" msgstr "" -#: quilt/delete.in:95 quilt/scripts/patchfns.in:448 +#: quilt/delete.in:95 quilt/scripts/patchfns.in:442 msgid "No patches in series\\n" msgstr "" -#: quilt/delete.in:101 quilt/scripts/patchfns.in:545 +#: quilt/delete.in:101 quilt/scripts/patchfns.in:539 msgid "Patch %s is currently applied\\n" msgstr "" @@ -429,27 +429,35 @@ msgstr "" msgid "Option \\`-n' can only be used when importing a single patch\\n" msgstr "" -#: quilt/import.in:92 +#: quilt/import.in:94 msgid "Patch %s is applied\\n" msgstr "" -#: quilt/import.in:100 +#: quilt/import.in:103 +msgid "Patch %s already exists in series.\\n" +msgstr "" + +#: quilt/import.in:109 msgid "Patch %s exists. Replace with -f.\\n" msgstr "" -#: quilt/import.in:104 +#: quilt/import.in:113 msgid "Replacing patch %s with new version\\n" msgstr "" -#: quilt/import.in:107 +#: quilt/import.in:117 +msgid "Importing patch %s\\n" +msgstr "" + +#: quilt/import.in:119 msgid "Importing patch %s (stored as %s)\\n" msgstr "" -#: quilt/import.in:115 +#: quilt/import.in:128 msgid "Failed to import patch %s\\n" msgstr "" -#: quilt/import.in:122 +#: quilt/import.in:136 msgid "Failed to insert patch %s into file series\\n" msgstr "" @@ -585,7 +593,7 @@ msgstr "" msgid "No patch removed\\n" msgstr "" -#: quilt/pop.in:269 quilt/scripts/patchfns.in:461 +#: quilt/pop.in:269 quilt/scripts/patchfns.in:455 msgid "No patches applied\\n" msgstr "" @@ -830,19 +838,23 @@ msgstr "" msgid "Failed to rename %s to %s: %s\n" msgstr "" -#: quilt/scripts/patchfns.in:497 +#: quilt/scripts/patchfns.in:491 msgid "Patch %s is not in series\\n" msgstr "" -#: quilt/scripts/patchfns.in:524 +#: quilt/scripts/patchfns.in:518 msgid "Patch %s is not applied\\n" msgstr "" -#: quilt/scripts/patchfns.in:561 +#: quilt/scripts/patchfns.in:555 msgid "File series fully applied, ends at patch %s\\n" msgstr "" -#: quilt/scripts/patchfns.in:801 +#: quilt/scripts/patchfns.in:577 +msgid "Patch %s does not exist\\n" +msgstr "" + +#: quilt/scripts/patchfns.in:817 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 " @@ -850,7 +862,7 @@ msgid "" "downgrading.\\n" msgstr "" -#: quilt/scripts/patchfns.in:886 +#: quilt/scripts/patchfns.in:902 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 7693e60..c42ce5d 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Sat Jan 21 19:44:35 CET 2006 - jayvdb@gmail.com + +- import command: catch several error conditions. Patches in + QUILT_PATCHES can now e imported. A minor fix in the output. + +------------------------------------------------------------------- Sat Jan 21 19:23:19 CET 2006 - agruen@suse.de - Fix delete -n when no patches are applied. diff --git a/quilt/import.in b/quilt/import.in index 6af47a4..fde4c3d 100644 --- a/quilt/import.in +++ b/quilt/import.in @@ -87,14 +87,23 @@ do patch=${patch_file##*/} fi + patch_file=$(find_patch_file $patch_file) || exit 1 + if is_applied $patch then printf $"Patch %s is applied\n" "$patch" >&2 exit 1 fi - if [ -e "$QUILT_PATCHES/$patch" ] + dest=$(patch_file_name $patch) + if patch_in_series "$patch" then + if [ "$patch_file" = "$dest" ] + then + printf $"Patch %s already exists in series.\n" \ + "$(print_patch $patch)" >&2 + exit 1 + fi if [ -z "$opt_force" ] then printf $"Patch %s exists. Replace with -f.\n" \ @@ -103,16 +112,21 @@ do fi printf $"Replacing patch %s with new version\n" \ "$(print_patch $patch)" >&2 + elif [ -e "$dest" ] + then + printf $"Importing patch %s\n" "$(print_patch $patch)" else printf $"Importing patch %s (stored as %s)\n" \ - "$(print_patch $patch_file)" \ + "$patch_file" \ "$(print_patch $patch)" + + mkdir -p "${dest%/*}" fi - dest=$QUILT_PATCHES/$patch - mkdir -p "${dest%/*}" - if ! cp "$patch_file" "$dest" + + if [ "$patch_file" != "$dest" ] && ! cp "$patch_file" "$dest" then - printf $"Failed to import patch %s\n" "$(print_patch $patch)" >&2 + printf $"Failed to import patch %s\n" \ + "$(print_patch $patch)" >&2 exit 1 fi diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in index a269fc4..ba5d37a 100644 --- a/quilt/scripts/patchfns.in +++ b/quilt/scripts/patchfns.in @@ -559,6 +559,28 @@ find_unapplied_patch() fi } +find_patch_file() +{ + local name="$1" + + if [ -r "$name" ] + then + echo "$name" + return + fi + + local patch file + + patch=$(find_patch_in_series "$name" 2>/dev/null) + if [ -z "$patch" ] + then + printf $"Patch %s does not exist\n" "$name" >&2 + return 1 + fi + + echo $(patch_file_name "$patch") +} + file_in_patch() { local file=$1 patch=$2 diff --git a/test/import.test b/test/import.test index 000b8ca..7820b06 100644 --- a/test/import.test +++ b/test/import.test @@ -27,7 +27,7 @@ $ rm -rf patches/ .pc/ $ mkdir patches $ quilt import t/patch1.diff - > Importing patch patches/t/patch1.diff (stored as patches/patch1.diff) + > Importing patch t/patch1.diff (stored as patches/patch1.diff) $ quilt push > Applying patch patches/patch1.diff @@ -71,28 +71,13 @@ # test a few error cases $ quilt import missing.diff - > Importing patch patches/missing.diff (stored as patches/missing.diff) - > cp: cannot stat `missing.diff': No such file or directory - > Failed to import patch patches/missing.diff + > Patch missing.diff does not exist $ quilt import patches/patch1.diff - > Patch patches/patch1.diff exists. Replace with -f. - - $ quilt import -f patches/patch1.diff - > Replacing patch patches/patch1.diff with new version - > cp: `patches/patch1.diff' and `patches/patch1.diff' are the same file - > Failed to import patch patches/patch1.diff - - # no real damage has been done + > Importing patch patches/patch1.diff - $ cat patches/patch1.diff - > original description - > Index: d/f - > =================================================================== - > --- /dev/null - > +++ d/f - > @@ -0,0 +1 @@ - > +f + $ quilt import patches/patch2.diff + > Patch patches/patch2.diff already exists in series. # a simple use of import @@ -119,7 +104,7 @@ $ cp patches/patch1.diff t/patch1.patch $ quilt import t/patch1.patch - > Importing patch patches/t/patch1.patch (stored as patches/patch1.patch) + > Importing patch t/patch1.patch (stored as patches/patch1.patch) $ ls patches/ > patch1.diff |