diff options
-rw-r--r-- | Makefile.in | 3 | ||||
-rw-r--r-- | bash_completion | 5 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | lib/backup-files.c | 10 | ||||
-rw-r--r-- | po/de.po | 207 | ||||
-rw-r--r-- | po/fr.po | 156 | ||||
-rw-r--r-- | po/quilt.pot | 125 | ||||
-rw-r--r-- | quilt.changes | 45 | ||||
-rw-r--r-- | quilt/add.in | 2 | ||||
-rw-r--r-- | quilt/diff.in | 115 | ||||
-rw-r--r-- | quilt/edit.in | 68 | ||||
-rw-r--r-- | quilt/patches.in | 66 | ||||
-rw-r--r-- | quilt/setup.in | 121 | ||||
-rw-r--r-- | quilt/snapshot.in | 98 | ||||
-rw-r--r-- | scripts/patchfns.in | 161 | ||||
-rw-r--r-- | test/snapshot.test | 61 |
16 files changed, 821 insertions, 426 deletions
diff --git a/Makefile.in b/Makefile.in index 8c440a4..72242a3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -56,7 +56,8 @@ SRC += $(BIN_SRC:%=bin/%) DIRT += $(BIN_IN:%=bin/%) QUILT_IN := add applied delete diff files import new next patches \ - pop previous push refresh remove series setup top unapplied + pop previous push refresh remove series setup top unapplied \ + fork snapshot edit gendiff QUILT_SRC := $(QUILT_IN:%=%.in) QUILT := $(QUILT_IN) diff --git a/bash_completion b/bash_completion index b26d8d4..2a3c7c3 100644 --- a/bash_completion +++ b/bash_completion @@ -26,8 +26,9 @@ _quilt() prev=${COMP_WORDS[COMP_CWORD-1]} # commands (added to patches) - cmds='add applied delete diff files import new next patches pop \ - previous push refresh remove series setup top unapplied' + cmds='add applied delete diff edit files fork import new next \ + patches pop previous push refresh remove series setup \ + snapshot top unapplied' patches=`cat_series` pcount=`cat_series | wc -l` diff --git a/configure.ac b/configure.ac index 4477850..6934ca6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,8 +1,8 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([quilt],[0.25_CFS4],[quilt-dev@nongnu.org]) +AC_INIT([quilt],[0.26_CFS5],[quilt-dev@nongnu.org]) AC_CONFIG_AUX_DIR(config) AC_PREREQ(2.53) -AC_REVISION ($Revision: 1.17.2.2 $) +AC_REVISION ($Revision: 1.17.2.3 $) PACKAGE_RELEASE=1 AC_SUBST(PACKAGE_RELEASE) diff --git a/lib/backup-files.c b/lib/backup-files.c index 36996c7..e4cd45a 100644 --- a/lib/backup-files.c +++ b/lib/backup-files.c @@ -202,12 +202,10 @@ process_file(char *file) if (!opt_silent) printf("Restoring %s\n", file); unlink(file); - if (link(backup, file) == -1) { - if (link_or_copy(backup, file) != 0) - return 1; - unlink(backup); - remove_parents(backup); - } + if (link_or_copy(backup, file) != 0) + return 1; + unlink(backup); + remove_parents(backup); } return 0; } else if (opt_what == what_remove) { @@ -45,11 +45,12 @@ msgstr "" "\tDer Patch, zu dem die Dateien hinzugefügt werden sollen." #: ../quilt/add.in:75 ../quilt/delete.in:69 ../quilt/files.in:74 -#: ../quilt/push.in:175 ../quilt/remove.in:75 +#: ../quilt/push.in:176 ../quilt/remove.in:75 msgid "No patch applied" msgstr "Kein Patch angewandt" -#: ../quilt/add.in:80 ../quilt/refresh.in:113 ../quilt/remove.in:80 +#: ../quilt/add.in:80 ../quilt/applied.in:71 ../quilt/refresh.in:182 +#: ../quilt/remove.in:80 msgid "Patch $patch is not applied" msgstr "Patch $patch ist nicht angewandt" @@ -70,17 +71,20 @@ msgid "File $file added to patch $patch" msgstr "Datei $file zu Patch $patch hinzugefügt" #: ../quilt/applied.in:22 -msgid "Usage: quilt applied [patch]" +#, fuzzy +msgid "Usage: quilt applied [-n] [patch]" msgstr "Verwendung: quilt applied [patch]" #: ../quilt/applied.in:25 +#, fuzzy msgid "" "\n" "\n" "Print a list of applied patches, or all patches up to and including the\n" "specified patch in the file series.\n" "\n" -"-n\tPrint patch file names instead of patch names." +"-n\tPrint patch file names instead of patch names.\n" +"\n" msgstr "" "\n" "\n" @@ -125,6 +129,7 @@ msgstr "" "Verwendung: quilt diff [-p n] [-c patch|-z] [-R] [-P patch] [datei ...]" #: ../quilt/diff.in:31 +#, fuzzy msgid "" "\n" "\n" @@ -140,7 +145,8 @@ msgid "" "\n" "-c patch\n" "\tCreate a combined diff for all patches between this patch and\n" -"\tthe patch specified with -P.\n" +"\tthe patch specified with -P. A patch name of \\\"-\\\" is equivalent\n" +"\tto specifying the first applied patch.\n" "\n" "-R\tCreate a reverse diff.\n" "\n" @@ -169,62 +175,60 @@ msgstr "" "-z\tÄnderungen relativ zum angewandten Patch ausgeben.\n" "\n" -#: ../quilt/diff.in:131 -msgid "Options \\`-c patch' and \\`-z' cannot be combined." +#: ../quilt/diff.in:138 +#, fuzzy +msgid "Options \\`-c patch', \\`--snapshot', and \\`-z' cannot be combined." msgstr "Die Optionen \\`-c patch' and \\`-z' können nicht kombiniert werden." -#: ../quilt/diff.in:140 ../quilt/refresh.in:106 +#: ../quilt/diff.in:147 ../quilt/refresh.in:175 msgid "No patch seem to be applied" msgstr "Es ist kein Patch angewandt" -#: ../quilt/diff.in:147 +#: ../quilt/diff.in:154 msgid "Patch $last_patch is not applied" msgstr "Patch $last_patch ist nicht angewandt" -#: ../quilt/diff.in:157 +#: ../quilt/diff.in:164 msgid "" "Cannot diff patches with -p$opt_strip_level, please specify -p0 or -p1 " "instead" msgstr "" "Kann kein Diff mit -p$opt_strip_level erzeugen, bitte -p0 oder -p1 verwenden." -#: ../quilt/diff.in:165 -msgid "refresh_patches_per_file failed." -msgstr "Fehler in refresh_patches_per_file." - -#: ../quilt/diff.in:178 -msgid "Patch $opt_combine not applied before $last_patch." +#: ../quilt/diff.in:198 +#, fuzzy +msgid "Patch $first_patch not applied before $last_patch." msgstr "Patch $opt_combine ist nicht vor Patch $last_patch angewandt." -#: ../quilt/diff.in:212 -msgid "File $file is not being modified." -msgstr "Datei $file wird nicht verändert." - -#: ../quilt/diff.in:229 +#: ../quilt/diff.in:233 msgid "Cannot change into .pc/$last_patch" msgstr "Kann nicht in Verzeichnis .pc/$last_patch wechseln." -#: ../quilt/diff.in:234 +#: ../quilt/diff.in:238 msgid "Failed to copy files to temporary directory" msgstr "Konnte Dateien nicht in ein temporäres Verzeichnis kopieren" -#: ../quilt/diff.in:239 +#: ../quilt/diff.in:243 msgid "Cannot change to temporary directory" msgstr "Kann nicht in temporäres Verzeichnis wechseln" -#: ../quilt/diff.in:256 +#: ../quilt/diff.in:260 msgid "Failed to patch temporary files" msgstr "Konnte temporäre Dateien nicht patchen" -#: ../quilt/diff.in:263 +#: ../quilt/diff.in:267 msgid "Cannot change to source directory" msgstr "Kann nicht in Quellverzeichnis wechseln" -#: ../quilt/diff.in:292 ../quilt/refresh.in:144 +#: ../quilt/diff.in:285 +msgid "File $file is not being modified." +msgstr "Datei $file wird nicht verändert." + +#: ../quilt/diff.in:304 ../quilt/refresh.in:215 msgid "Diff failed, aborting." msgstr "Diff fehlgeschlagen, Abbruch." -#: ../quilt/diff.in:299 +#: ../quilt/diff.in:311 msgid "More recent patches modify files in $last_patch." msgstr "Später angewandte Patches verändern Dateien von $last_patch." @@ -408,10 +412,13 @@ msgid "Usage: quilt patches {file}" msgstr "Verwendung: quilt patches {file}" #: ../quilt/patches.in:25 +#, fuzzy msgid "" "\n" "\n" -"Print the list of patches that modify the specified file.\n" +"Print the list of patches that modify the specified file. (Uses a\n" +"heuristic to determine which files are modified by unapplied patches.\n" +"Note that this heuristic is much slower than scanning applied patches.)\n" "\n" "-n\tPrint the patch file names instead of the patch names.\n" "\n" @@ -474,32 +481,29 @@ msgstr "" "-v\tViele Meldungen ausgeben.\n" "\n" -#: ../quilt/pop.in:83 ../quilt/push.in:86 -msgid "Patch $stop_at_patch not found in file series" -msgstr "Patch $stop_at_patch in series-Datei nicht gefunden" - -#: ../quilt/pop.in:156 +#: ../quilt/pop.in:146 msgid "Patch $stop_at_patch is not applied." msgstr "Patch $stop_at_patch ist nicht angewandt." -#: ../quilt/pop.in:166 +#: ../quilt/pop.in:156 msgid "No patch removed" msgstr "Kein Patch entfernt" -#: ../quilt/pop.in:180 ../quilt/push.in:192 +#: ../quilt/pop.in:170 ../quilt/push.in:201 msgid "Interrupted by user" msgstr "Unterbrechung durch Benutzer" -#: ../quilt/pop.in:189 ../quilt/push.in:201 +#: ../quilt/pop.in:179 ../quilt/push.in:210 msgid "No patches applied" msgstr "Keine Patches angewandt" -#: ../quilt/pop.in:191 ../quilt/push.in:203 +#: ../quilt/pop.in:181 ../quilt/push.in:212 msgid "Now at patch $patch" msgstr "Jetzt in Patch $patch" #: ../quilt/previous.in:22 -msgid "Usage: quilt previous [patch]" +#, fuzzy +msgid "Usage: quilt previous [-n] [patch]" msgstr "Verwendung: quilt previous [patch]" #: ../quilt/previous.in:25 @@ -547,8 +551,9 @@ msgid "" "\tis not actually applied.\n" "\n" "--interactive\n" -"\tAllow the patch utility to ask hwo to deal with conflicts. If\n" -"\tthis option is not given, the -f patch optionch will be used.\n" +"\tAllow the patch utility to ask how to deal with conflicts. If\n" +"\tthis option is not given, the option -f will be passed to the \n" +"\tpatch program.\n" "\n" msgstr "" "\n" @@ -572,19 +577,32 @@ msgstr "" "\tnicht sauber angewandt werden kann.\n" "\t\n" -#: ../quilt/push.in:162 +#: ../quilt/push.in:87 +msgid "Patch $stop_at_patch not found in file series" +msgstr "Patch $stop_at_patch in series-Datei nicht gefunden" + +#: ../quilt/push.in:163 msgid "Patch $stop_at_patch is already applied." msgstr "Patch $stop_at_patch ist bereits angewandt." -#: ../quilt/push.in:177 +#: ../quilt/push.in:180 +msgid "" +"The topmost patch $top is not in the series file anymore;\n" +"cannot determine the next patch from the series file.\n" +"Please pop -f the top patch and check your series file." +msgstr "" + +#: ../quilt/push.in:186 msgid "File series fully applied, ends at patch $top" msgstr "series-Datei vollständig angewandt, endet in Patch $top" -#: ../quilt/refresh.in:27 -msgid "Usage: quilt refresh [-p n] [-f] [patch]" +#: ../quilt/refresh.in:26 +#, fuzzy +msgid "Usage: quilt refresh [-p n] [-f] [k|o] [patch]" msgstr "Verwendung: quilt refresh [-p n] [-f] [patch]" -#: ../quilt/refresh.in:31 +#: ../quilt/refresh.in:30 +#, fuzzy msgid "" "\n" "\n" @@ -604,7 +622,10 @@ msgid "" "\t\n" "-f\tForce refresh, even if more recent patches modify\n" "\tsome of the same files.\n" +"-O \tOverwrite the quilt save patches (for gendiff)\n" +"-K\tKeep the quilt save patches unchanged (for gendiff)\n" "\n" +"\t\n" msgstr "" "\n" "\n" @@ -627,7 +648,7 @@ msgstr "" "\teinige der selben Dateien verändern.\n" "\n" -#: ../quilt/refresh.in:123 +#: ../quilt/refresh.in:192 msgid "" "Cannot refresh patches with -p$opt_strip_level, please specify -p0 or -p1 " "instead" @@ -635,17 +656,17 @@ msgstr "" "Kann Patches mit Level -p$opt_strip_level nicht auffrischen, bitte -p0 oder -" "p1 angeben" -#: ../quilt/refresh.in:150 +#: ../quilt/refresh.in:221 msgid "More recent patches modify files in $patch. Enforce refresh with -f." msgstr "" "Später angewandte Patches verändern Dateien von $patch. Auffrischen mit -f " "erzwingen." -#: ../quilt/refresh.in:157 +#: ../quilt/refresh.in:228 msgid "Nothing in patch $patch" msgstr "Patch $patch is leer" -#: ../quilt/refresh.in:197 +#: ../quilt/refresh.in:268 msgid "Refreshed patch $patch" msgstr "Patch $patch aufgefrischt." @@ -710,11 +731,13 @@ msgstr "" "-v\tAusführlichere, benutzerfreundliche Ausgabe.\n" "\n" -#: ../quilt/setup.in:22 -msgid "Usage: quilt setup [-d sourcedir] {seriesfile|specfile}" +#: ../quilt/setup.in:21 +#, fuzzy +msgid "" +"Usage: quilt setup [-d sourcedir] [-l seriesfile] {seriesfile|specfile}" msgstr "Verwendung: quilt setup [-d quellvz.] {seriesdatei|specdatei}" -#: ../quilt/setup.in:25 +#: ../quilt/setup.in:24 msgid "" "\n" "\n" @@ -722,43 +745,59 @@ msgid "" "file must contain the name of the relevant tar archive, in addition to\n" "the list of patches.\n" "\n" -msgstr "" -"\n" -"\n" -"Baut einen Quellen-Baum aus einer series-Datei auf. Die series-Datei\n" -"muß neben der Liste der Patches auch den Namen der entsprechenden\n" -"Tar-Datei enthalten.\n" +"-d\tThe directory that contains the archives and patches. Defaults\n" +"\tto the directory of the series/spec file.\n" "\n" +"-l\tMake the patches directory a symbolic link. If a series file is\n" +"\tspecified, also create a symlink to the series file.\n" +msgstr "" -#: ../quilt/setup.in:100 +#: ../quilt/setup.in:126 msgid "Series file $series_file not found" msgstr "Seriendatei $series_file nicht gefunden" -#: ../quilt/setup.in:125 +#: ../quilt/setup.in:152 msgid "Reading sources from $arg" msgstr "Quellen werden von $arg gelesen" -#: ../quilt/setup.in:128 +#: ../quilt/setup.in:156 msgid "Unpacking archive $source/$arg" msgstr "Entpacke Archiv source/$arg" -#: ../quilt/setup.in:138 +#: ../quilt/setup.in:166 msgid "Directory $packagedir exists already." msgstr "Verzeichnis $packagedir existiert bereits." -#: ../quilt/setup.in:143 +#: ../quilt/setup.in:171 msgid "File $packagedir exists." msgstr "Datei $packagedir existiert." -#: ../quilt/setup.in:149 +#: ../quilt/setup.in:186 +msgid "Creating link to patches directory $arg" +msgstr "" + +#: ../quilt/setup.in:190 +msgid "$packagedir/patches exist, but not symlink" +msgstr "" + +#: ../quilt/setup.in:195 msgid "Copying patch $source/$arg" msgstr "Kopiere Patch $source/$arg" -#: ../quilt/setup.in:154 +#: ../quilt/setup.in:208 +#, fuzzy +msgid "File $packagedir/series exists; will not override." +msgstr "Datei $packagedir existiert." + +#: ../quilt/setup.in:215 ../quilt/setup.in:229 msgid "Copying series file" msgstr "Kopiere Seriendatei" -#: ../quilt/setup.in:178 +#: ../quilt/setup.in:225 +msgid "Creatig link to series file $arg" +msgstr "" + +#: ../quilt/setup.in:259 msgid "Directory $packagedir set up." msgstr "Verzeichnis $packagedir aufgebaut." @@ -808,7 +847,7 @@ msgstr "Verwendung: $0 [-fqv] patchname" msgid "Interrupted by user; patch $patch was not applied." msgstr "Unterbrechung durch Benutzer; Patch $patch wurde nicht angewandt." -#: ../scripts/apatch.in:51 ../scripts/rpatch.in:113 +#: ../scripts/apatch.in:51 ../scripts/rpatch.in:128 msgid "Patch file $patch_file appears to be empty" msgstr "Patch-Datei $patch_file scheint leer zu sein" @@ -836,38 +875,56 @@ msgstr "Patch $patch angewandt (erzwungen, muß aufgefrischt werden (Refresh))" msgid "Patch $patch does not apply (enforce with -f)" msgstr "Patch $patch läßt sich nicht anwenden (erzwingen mit -f)" -#: ../scripts/apatch.in:186 ../scripts/rpatch.in:238 +#: ../scripts/apatch.in:186 ../scripts/rpatch.in:257 msgid "The topmost patch $top needs to be refreshed first." msgstr "Der oberste Patch $top muss zuerst aufgefrischt werden (Refresh)." -#: ../scripts/rpatch.in:22 +#: ../scripts/rpatch.in:21 msgid "Usage: $0 [-fRq] patchname" msgstr "Verwendung: $0 [-fRq] patchname" -#: ../scripts/rpatch.in:44 +#: ../scripts/rpatch.in:43 msgid "Patch does not remove changes:" msgstr "Patch entfernt folgende Änderungen nicht:" -#: ../scripts/rpatch.in:102 +#: ../scripts/rpatch.in:117 msgid "Interrupted by user; patch $patch was not removed." msgstr "Unterbrechung durch Benutzer; Patch $patch wurde nicht entfernt." -#: ../scripts/rpatch.in:139 +#: ../scripts/rpatch.in:153 msgid "Patch $patch appears to be empty, removed" msgstr "Patch $patch scheint leer zu sein, entfernt" -#: ../scripts/rpatch.in:144 +#: ../scripts/rpatch.in:158 msgid "Removing $patch" msgstr "Entferne $patch" -#: ../scripts/rpatch.in:165 +#: ../scripts/rpatch.in:183 msgid "Failed to create temporary files" msgstr "Konnte temporäres Verzeichnis nicht erstellen" -#: ../scripts/rpatch.in:186 +#: ../scripts/rpatch.in:204 msgid "Patch $patch does not remove (enforce with -f)" msgstr "Patch $patch kann nicht entfernt werden (erzwingen mit -f)" #: ../scripts/spec2series.in:100 ../scripts/spec2series.in:192 msgid " done" msgstr " fertig" + +#~ msgid "refresh_patches_per_file failed." +#~ msgstr "Fehler in refresh_patches_per_file." + +#~ msgid "" +#~ "\n" +#~ "\n" +#~ "Initializes a source tree from a patch series file. The patch series\n" +#~ "file must contain the name of the relevant tar archive, in addition to\n" +#~ "the list of patches.\n" +#~ "\n" +#~ msgstr "" +#~ "\n" +#~ "\n" +#~ "Baut einen Quellen-Baum aus einer series-Datei auf. Die series-Datei\n" +#~ "muß neben der Liste der Patches auch den Namen der entsprechenden\n" +#~ "Tar-Datei enthalten.\n" +#~ "\n" @@ -50,7 +50,7 @@ msgstr "" msgid "No patch applied" msgstr "Aucun patch n'est appliqué" -#: ../quilt/add.in:80 ../quilt/applied.in:71 ../quilt/refresh.in:113 +#: ../quilt/add.in:80 ../quilt/applied.in:71 ../quilt/refresh.in:182 #: ../quilt/remove.in:80 msgid "Patch $patch is not applied" msgstr "Le patch $patch n'est pas appliqué" @@ -175,19 +175,20 @@ msgstr "" "\tau patch spécifié.\n" "\n" -#: ../quilt/diff.in:132 -msgid "Options \\`-c patch' and \\`-z' cannot be combined." +#: ../quilt/diff.in:138 +#, fuzzy +msgid "Options \\`-c patch', \\`--snapshot', and \\`-z' cannot be combined." msgstr "Les options \\`-c patch' et \\`-z' ne peuvent pas être combinées." -#: ../quilt/diff.in:141 ../quilt/refresh.in:106 +#: ../quilt/diff.in:147 ../quilt/refresh.in:175 msgid "No patch seem to be applied" msgstr "Aucun patch ne semble appliqué" -#: ../quilt/diff.in:148 +#: ../quilt/diff.in:154 msgid "Patch $last_patch is not applied" msgstr "Le patch $last_patch ne semble pas appliqué" -#: ../quilt/diff.in:158 +#: ../quilt/diff.in:164 msgid "" "Cannot diff patches with -p$opt_strip_level, please specify -p0 or -p1 " "instead" @@ -195,43 +196,40 @@ msgstr "" "Impossible de créer des patches avec -p$opt_strip_level. Veuillez spécifier -" "p0 ou -p1 à la place" -#: ../quilt/diff.in:166 -msgid "refresh_patches_per_file failed." -msgstr "refresh_patches_per_file a échoué." - -#: ../quilt/diff.in:179 -msgid "Patch $opt_combine not applied before $last_patch." +#: ../quilt/diff.in:198 +#, fuzzy +msgid "Patch $first_patch not applied before $last_patch." msgstr "Le patch $opt_combine n'est pas appliqué avant $last_patch." -#: ../quilt/diff.in:213 -msgid "File $file is not being modified." -msgstr "Le fichier $file n'est pas modifié." - -#: ../quilt/diff.in:230 +#: ../quilt/diff.in:233 msgid "Cannot change into .pc/$last_patch" msgstr "Impossible d'entrer dans .pc/$last_patch" -#: ../quilt/diff.in:235 +#: ../quilt/diff.in:238 msgid "Failed to copy files to temporary directory" msgstr "Impossible de copier les fichiers dans le répertoire temporaire" -#: ../quilt/diff.in:240 +#: ../quilt/diff.in:243 msgid "Cannot change to temporary directory" msgstr "Impossible d'entrer dans le répertoire temporaire" -#: ../quilt/diff.in:257 +#: ../quilt/diff.in:260 msgid "Failed to patch temporary files" msgstr "Impossible de patcher les fichiers temporaires" -#: ../quilt/diff.in:264 +#: ../quilt/diff.in:267 msgid "Cannot change to source directory" msgstr "Impossible d'entrer dans le répertoire source" -#: ../quilt/diff.in:293 ../quilt/refresh.in:144 +#: ../quilt/diff.in:285 +msgid "File $file is not being modified." +msgstr "Le fichier $file n'est pas modifié." + +#: ../quilt/diff.in:304 ../quilt/refresh.in:215 msgid "Diff failed, aborting." msgstr "Le diff a échoué. Abandon." -#: ../quilt/diff.in:300 +#: ../quilt/diff.in:311 msgid "More recent patches modify files in $last_patch." msgstr "Un patch plus recent modifie des fichiers communs à $last_patch." @@ -414,10 +412,13 @@ msgid "Usage: quilt patches {file}" msgstr "Usage : quilt patches {fichier}" #: ../quilt/patches.in:25 +#, fuzzy msgid "" "\n" "\n" -"Print the list of patches that modify the specified file.\n" +"Print the list of patches that modify the specified file. (Uses a\n" +"heuristic to determine which files are modified by unapplied patches.\n" +"Note that this heuristic is much slower than scanning applied patches.)\n" "\n" "-n\tPrint the patch file names instead of the patch names.\n" "\n" @@ -600,11 +601,13 @@ msgstr "" msgid "File series fully applied, ends at patch $top" msgstr "La série est complètement appliquée. Le dernier patch est $top." -#: ../quilt/refresh.in:27 -msgid "Usage: quilt refresh [-p n] [-f] [patch]" +#: ../quilt/refresh.in:26 +#, fuzzy +msgid "Usage: quilt refresh [-p n] [-f] [k|o] [patch]" msgstr "Usage : quilt refresh [-p n] [-f] [patch]" -#: ../quilt/refresh.in:31 +#: ../quilt/refresh.in:30 +#, fuzzy msgid "" "\n" "\n" @@ -624,7 +627,10 @@ msgid "" "\t\n" "-f\tForce refresh, even if more recent patches modify\n" "\tsome of the same files.\n" +"-O \tOverwrite the quilt save patches (for gendiff)\n" +"-K\tKeep the quilt save patches unchanged (for gendiff)\n" "\n" +"\t\n" msgstr "" "\n" "\n" @@ -646,7 +652,7 @@ msgstr "" "-f\tForce le rafraîchissement, même si des patches plus haut changent \n" "\tles mêmes fichiers.\n" -#: ../quilt/refresh.in:123 +#: ../quilt/refresh.in:192 msgid "" "Cannot refresh patches with -p$opt_strip_level, please specify -p0 or -p1 " "instead" @@ -654,17 +660,17 @@ msgstr "" "Impossible de rafraîchir des patchs avec -p$opt_strip_level. Veuillez\n" "spécifier -p0 ou -p1 à la place." -#: ../quilt/refresh.in:150 +#: ../quilt/refresh.in:221 msgid "More recent patches modify files in $patch. Enforce refresh with -f." msgstr "" "Des fichiers plus récents modifient les mêmes fichiers que $patch.\n" "Forcez le rafraîchissement avec -f." -#: ../quilt/refresh.in:157 +#: ../quilt/refresh.in:228 msgid "Nothing in patch $patch" msgstr "Le patch $patch ne contient rien" -#: ../quilt/refresh.in:197 +#: ../quilt/refresh.in:268 msgid "Refreshed patch $patch" msgstr "Le patch $patch a été rafraichi." @@ -729,12 +735,14 @@ msgstr "" "-v\tAffichage verbeux, plus simple à lire.\n" "\n" -#: ../quilt/setup.in:22 -msgid "Usage: quilt setup [-d sourcedir] {seriesfile|specfile}" +#: ../quilt/setup.in:21 +#, fuzzy +msgid "" +"Usage: quilt setup [-d sourcedir] [-l seriesfile] {seriesfile|specfile}" msgstr "" "Usage : quilt setup [-d répertoire_source] {fichier_séries|fichier_spec}" -#: ../quilt/setup.in:25 +#: ../quilt/setup.in:24 msgid "" "\n" "\n" @@ -742,43 +750,59 @@ msgid "" "file must contain the name of the relevant tar archive, in addition to\n" "the list of patches.\n" "\n" -msgstr "" -"\n" -"\n" -"Initialise une arborescence source depuis un fichier de série. Ce fichier " -"doit contenir le nom de l'archive tar à utiliser, ainsi que la liste des " -"patches.\n" +"-d\tThe directory that contains the archives and patches. Defaults\n" +"\tto the directory of the series/spec file.\n" "\n" +"-l\tMake the patches directory a symbolic link. If a series file is\n" +"\tspecified, also create a symlink to the series file.\n" +msgstr "" -#: ../quilt/setup.in:100 +#: ../quilt/setup.in:126 msgid "Series file $series_file not found" msgstr "Fichier de série $series_file introuvable" -#: ../quilt/setup.in:125 +#: ../quilt/setup.in:152 msgid "Reading sources from $arg" msgstr "Lecture des sources depuis $arg" -#: ../quilt/setup.in:128 +#: ../quilt/setup.in:156 msgid "Unpacking archive $source/$arg" msgstr "Désarchivage depuis $source/$arg" -#: ../quilt/setup.in:138 +#: ../quilt/setup.in:166 msgid "Directory $packagedir exists already." msgstr "Le répertoire $packagedir existe déjà." -#: ../quilt/setup.in:143 +#: ../quilt/setup.in:171 msgid "File $packagedir exists." msgstr "Le fichier $packagedir existe." -#: ../quilt/setup.in:149 +#: ../quilt/setup.in:186 +msgid "Creating link to patches directory $arg" +msgstr "" + +#: ../quilt/setup.in:190 +msgid "$packagedir/patches exist, but not symlink" +msgstr "" + +#: ../quilt/setup.in:195 msgid "Copying patch $source/$arg" msgstr "Copie du patch $source/$arg" -#: ../quilt/setup.in:154 +#: ../quilt/setup.in:208 +#, fuzzy +msgid "File $packagedir/series exists; will not override." +msgstr "Le fichier $packagedir existe." + +#: ../quilt/setup.in:215 ../quilt/setup.in:229 msgid "Copying series file" msgstr "Copie du fichier de série" -#: ../quilt/setup.in:178 +#: ../quilt/setup.in:225 +msgid "Creatig link to series file $arg" +msgstr "" + +#: ../quilt/setup.in:259 msgid "Directory $packagedir set up." msgstr "Le répertoire $packagedir est configuré." @@ -830,7 +854,7 @@ msgstr "Usage : $0 [-fqv] patchname" msgid "Interrupted by user; patch $patch was not applied." msgstr "Interrompu par l'utilisateur ; le patch $patch n'a pas été appliqué." -#: ../scripts/apatch.in:51 ../scripts/rpatch.in:113 +#: ../scripts/apatch.in:51 ../scripts/rpatch.in:128 msgid "Patch file $patch_file appears to be empty" msgstr "Le fichier de patch $patch_file semble vide" @@ -859,38 +883,56 @@ msgid "Patch $patch does not apply (enforce with -f)" msgstr "" "Le patch $patch ne s'applique pas proprement (forcez l'application avec -f)" -#: ../scripts/apatch.in:186 ../scripts/rpatch.in:238 +#: ../scripts/apatch.in:186 ../scripts/rpatch.in:257 msgid "The topmost patch $top needs to be refreshed first." msgstr "Le patch au sommet $top doit être rafraichi au préalable." -#: ../scripts/rpatch.in:22 +#: ../scripts/rpatch.in:21 msgid "Usage: $0 [-fRq] patchname" msgstr "Usage: $0 [-fRq] nom_de_patch" -#: ../scripts/rpatch.in:44 +#: ../scripts/rpatch.in:43 msgid "Patch does not remove changes:" msgstr "Le patch d'enlève pas les changements :" -#: ../scripts/rpatch.in:102 +#: ../scripts/rpatch.in:117 msgid "Interrupted by user; patch $patch was not removed." msgstr "Interrompu par l'utilisateur ; le patch $patch n'a pas été retiré;" -#: ../scripts/rpatch.in:139 +#: ../scripts/rpatch.in:153 msgid "Patch $patch appears to be empty, removed" msgstr "Le patch $patch semble vide. Il a été retiré." -#: ../scripts/rpatch.in:144 +#: ../scripts/rpatch.in:158 msgid "Removing $patch" msgstr "Retrait de $patch" -#: ../scripts/rpatch.in:165 +#: ../scripts/rpatch.in:183 msgid "Failed to create temporary files" msgstr "Impossible de créer les fichiers temporaires" -#: ../scripts/rpatch.in:186 +#: ../scripts/rpatch.in:204 msgid "Patch $patch does not remove (enforce with -f)" msgstr "Le patch $patch ne se retire pas proprement (forcez avec -f)" #: ../scripts/spec2series.in:100 ../scripts/spec2series.in:192 msgid " done" msgstr " fini" + +#~ msgid "refresh_patches_per_file failed." +#~ msgstr "refresh_patches_per_file a échoué." + +#~ msgid "" +#~ "\n" +#~ "\n" +#~ "Initializes a source tree from a patch series file. The patch series\n" +#~ "file must contain the name of the relevant tar archive, in addition to\n" +#~ "the list of patches.\n" +#~ "\n" +#~ msgstr "" +#~ "\n" +#~ "\n" +#~ "Initialise une arborescence source depuis un fichier de série. Ce fichier " +#~ "doit contenir le nom de l'archive tar à utiliser, ainsi que la liste des " +#~ "patches.\n" +#~ "\n" diff --git a/po/quilt.pot b/po/quilt.pot index 6367028..45a0187 100644 --- a/po/quilt.pot +++ b/po/quilt.pot @@ -27,7 +27,7 @@ msgstr "" msgid "No patch applied" msgstr "" -#: ../quilt/add.in:80 ../quilt/applied.in:71 ../quilt/refresh.in:113 +#: ../quilt/add.in:80 ../quilt/applied.in:71 ../quilt/refresh.in:182 #: ../quilt/remove.in:80 msgid "Patch $patch is not applied" msgstr "" @@ -118,61 +118,57 @@ msgid "" "\n" msgstr "" -#: ../quilt/diff.in:132 -msgid "Options \\`-c patch' and \\`-z' cannot be combined." +#: ../quilt/diff.in:138 +msgid "Options \\`-c patch', \\`--snapshot', and \\`-z' cannot be combined." msgstr "" -#: ../quilt/diff.in:141 ../quilt/refresh.in:106 +#: ../quilt/diff.in:147 ../quilt/refresh.in:175 msgid "No patch seem to be applied" msgstr "" -#: ../quilt/diff.in:148 +#: ../quilt/diff.in:154 msgid "Patch $last_patch is not applied" msgstr "" -#: ../quilt/diff.in:158 +#: ../quilt/diff.in:164 msgid "" "Cannot diff patches with -p$opt_strip_level, please specify -p0 or -p1 " "instead" msgstr "" -#: ../quilt/diff.in:166 -msgid "refresh_patches_per_file failed." +#: ../quilt/diff.in:198 +msgid "Patch $first_patch not applied before $last_patch." msgstr "" -#: ../quilt/diff.in:179 -msgid "Patch $opt_combine not applied before $last_patch." -msgstr "" - -#: ../quilt/diff.in:213 -msgid "File $file is not being modified." -msgstr "" - -#: ../quilt/diff.in:230 +#: ../quilt/diff.in:233 msgid "Cannot change into .pc/$last_patch" msgstr "" -#: ../quilt/diff.in:235 +#: ../quilt/diff.in:238 msgid "Failed to copy files to temporary directory" msgstr "" -#: ../quilt/diff.in:240 +#: ../quilt/diff.in:243 msgid "Cannot change to temporary directory" msgstr "" -#: ../quilt/diff.in:257 +#: ../quilt/diff.in:260 msgid "Failed to patch temporary files" msgstr "" -#: ../quilt/diff.in:264 +#: ../quilt/diff.in:267 msgid "Cannot change to source directory" msgstr "" -#: ../quilt/diff.in:293 ../quilt/refresh.in:144 +#: ../quilt/diff.in:285 +msgid "File $file is not being modified." +msgstr "" + +#: ../quilt/diff.in:304 ../quilt/refresh.in:215 msgid "Diff failed, aborting." msgstr "" -#: ../quilt/diff.in:300 +#: ../quilt/diff.in:311 msgid "More recent patches modify files in $last_patch." msgstr "" @@ -324,7 +320,9 @@ msgstr "" msgid "" "\n" "\n" -"Print the list of patches that modify the specified file.\n" +"Print the list of patches that modify the specified file. (Uses a\n" +"heuristic to determine which files are modified by unapplied patches.\n" +"Note that this heuristic is much slower than scanning applied patches.)\n" "\n" "-n\tPrint the patch file names instead of the patch names.\n" "\n" @@ -445,11 +443,11 @@ msgstr "" msgid "File series fully applied, ends at patch $top" msgstr "" -#: ../quilt/refresh.in:27 -msgid "Usage: quilt refresh [-p n] [-f] [patch]" +#: ../quilt/refresh.in:26 +msgid "Usage: quilt refresh [-p n] [-f] [k|o] [patch]" msgstr "" -#: ../quilt/refresh.in:31 +#: ../quilt/refresh.in:30 msgid "" "\n" "\n" @@ -469,24 +467,27 @@ msgid "" "\t\n" "-f\tForce refresh, even if more recent patches modify\n" "\tsome of the same files.\n" +"-O \tOverwrite the quilt save patches (for gendiff)\n" +"-K\tKeep the quilt save patches unchanged (for gendiff)\n" "\n" +"\t\n" msgstr "" -#: ../quilt/refresh.in:123 +#: ../quilt/refresh.in:192 msgid "" "Cannot refresh patches with -p$opt_strip_level, please specify -p0 or -p1 " "instead" msgstr "" -#: ../quilt/refresh.in:150 +#: ../quilt/refresh.in:221 msgid "More recent patches modify files in $patch. Enforce refresh with -f." msgstr "" -#: ../quilt/refresh.in:157 +#: ../quilt/refresh.in:228 msgid "Nothing in patch $patch" msgstr "" -#: ../quilt/refresh.in:197 +#: ../quilt/refresh.in:268 msgid "Refreshed patch $patch" msgstr "" @@ -534,11 +535,12 @@ msgid "" "\n" msgstr "" -#: ../quilt/setup.in:22 -msgid "Usage: quilt setup [-d sourcedir] {seriesfile|specfile}" +#: ../quilt/setup.in:21 +msgid "" +"Usage: quilt setup [-d sourcedir] [-l seriesfile] {seriesfile|specfile}" msgstr "" -#: ../quilt/setup.in:25 +#: ../quilt/setup.in:24 msgid "" "\n" "\n" @@ -546,37 +548,58 @@ msgid "" "file must contain the name of the relevant tar archive, in addition to\n" "the list of patches.\n" "\n" +"-d\tThe directory that contains the archives and patches. Defaults\n" +"\tto the directory of the series/spec file.\n" +"\n" +"-l\tMake the patches directory a symbolic link. If a series file is\n" +"\tspecified, also create a symlink to the series file.\n" msgstr "" -#: ../quilt/setup.in:100 +#: ../quilt/setup.in:126 msgid "Series file $series_file not found" msgstr "" -#: ../quilt/setup.in:125 +#: ../quilt/setup.in:152 msgid "Reading sources from $arg" msgstr "" -#: ../quilt/setup.in:128 +#: ../quilt/setup.in:156 msgid "Unpacking archive $source/$arg" msgstr "" -#: ../quilt/setup.in:138 +#: ../quilt/setup.in:166 msgid "Directory $packagedir exists already." msgstr "" -#: ../quilt/setup.in:143 +#: ../quilt/setup.in:171 msgid "File $packagedir exists." msgstr "" -#: ../quilt/setup.in:149 +#: ../quilt/setup.in:186 +msgid "Creating link to patches directory $arg" +msgstr "" + +#: ../quilt/setup.in:190 +msgid "$packagedir/patches exist, but not symlink" +msgstr "" + +#: ../quilt/setup.in:195 msgid "Copying patch $source/$arg" msgstr "" -#: ../quilt/setup.in:154 +#: ../quilt/setup.in:208 +msgid "File $packagedir/series exists; will not override." +msgstr "" + +#: ../quilt/setup.in:215 ../quilt/setup.in:229 msgid "Copying series file" msgstr "" -#: ../quilt/setup.in:178 +#: ../quilt/setup.in:225 +msgid "Creatig link to series file $arg" +msgstr "" + +#: ../quilt/setup.in:259 msgid "Directory $packagedir set up." msgstr "" @@ -616,7 +639,7 @@ msgstr "" msgid "Interrupted by user; patch $patch was not applied." msgstr "" -#: ../scripts/apatch.in:51 ../scripts/rpatch.in:113 +#: ../scripts/apatch.in:51 ../scripts/rpatch.in:128 msgid "Patch file $patch_file appears to be empty" msgstr "" @@ -644,35 +667,35 @@ msgstr "" msgid "Patch $patch does not apply (enforce with -f)" msgstr "" -#: ../scripts/apatch.in:186 ../scripts/rpatch.in:238 +#: ../scripts/apatch.in:186 ../scripts/rpatch.in:257 msgid "The topmost patch $top needs to be refreshed first." msgstr "" -#: ../scripts/rpatch.in:22 +#: ../scripts/rpatch.in:21 msgid "Usage: $0 [-fRq] patchname" msgstr "" -#: ../scripts/rpatch.in:44 +#: ../scripts/rpatch.in:43 msgid "Patch does not remove changes:" msgstr "" -#: ../scripts/rpatch.in:102 +#: ../scripts/rpatch.in:117 msgid "Interrupted by user; patch $patch was not removed." msgstr "" -#: ../scripts/rpatch.in:139 +#: ../scripts/rpatch.in:153 msgid "Patch $patch appears to be empty, removed" msgstr "" -#: ../scripts/rpatch.in:144 +#: ../scripts/rpatch.in:158 msgid "Removing $patch" msgstr "" -#: ../scripts/rpatch.in:165 +#: ../scripts/rpatch.in:183 msgid "Failed to create temporary files" msgstr "" -#: ../scripts/rpatch.in:186 +#: ../scripts/rpatch.in:204 msgid "Patch $patch does not remove (enforce with -f)" msgstr "" diff --git a/quilt.changes b/quilt.changes index 5eb0a38..650bca2 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,4 +1,45 @@ ------------------------------------------------------------------- +Sun Oct 26 17:53:53 CET 2003 - agruen@suse.de + +- Get rid of patches_per cache_in `quilt patches'. Remove + patches_per_file and associated functions. `quilt patches' + now is a bit slow for unapplied patches. + +------------------------------------------------------------------- +Sun Oct 26 14:45:08 CET 2003 - agruen@suse.de + +- Rename snapshot directory from ".snap0" to ".snap". +- `quilt diff: Speed up file list generation in `quilt diff'. + Don't use modified_files anymore. Instead, add first_modified_by + function. I want to get rid of the patches_per_file cache; + it sometimes was not brought up to date. Some cleanups. +- Add test/snapshot.test. +- Fix two errors in the date format in quilt.changes. + +------------------------------------------------------------------- +Fri Oct 24 00:50:08 CEST 2003 - agruen@suse.de + +- `quilt add': Return exit code 2 when a file has already been + added. +- Add `quilt edit' command: Does a `quilt add' and then invokes + $EDITOR (fallback is `vi'). Files that don't exist after editing + are again removed from the patch. + +------------------------------------------------------------------- +Wed Oct 22 01:44:04 CEST 2003 - agruen@suse.de + +- `Quilt fork' should better fork the next patch instead of the + topmost one. Also fix a bug in updating the series file when + forking. The rename_in_db() function is no longer needed. + +------------------------------------------------------------------- +Tue Oct 21 20:44:00 CEST 2003 - agruen@suse.de + +- Add `quilt fork' command. +- Add `quilt snapshot' command and `quilt diff --snapshot' option. +- Bump the version number to 0.26. + +------------------------------------------------------------------- Tue Sep 9 08:44:12 CEST 2003 - martin.quinson@tuxfamily.org - fix LC_ALL to C during building the reference so that the @@ -53,13 +94,13 @@ Sun Jul 20 00:31:53 CEST 2003 - agruen@suse.de e.g., because the backups go to a ram disc, etc. ------------------------------------------------------------------- -Wed 26 Jun 15:35:55 CEST 2003 - martin.quinson@tuxfamily.org +Wed Jun 26 15:35:55 CEST 2003 - martin.quinson@tuxfamily.org - Add what needed to have inteligent bash completion when using quilt - Bump version to 0.24 ------------------------------------------------------------------- -Wed 25 Jun 15:35:55 CEST 2003 - martin.quinson@tuxfamily.org +Wed Jun 25 15:35:55 CEST 2003 - martin.quinson@tuxfamily.org - Make clean before dist to avoid to put cruft in tarballs - remove po/*mo on make clean diff --git a/quilt/add.in b/quilt/add.in index 5b1d932..b6074f7 100644 --- a/quilt/add.in +++ b/quilt/add.in @@ -87,7 +87,7 @@ do if file_in_patch $file $patch then echo $"File $file is already in patch $patch" - status=1 + status=2 continue fi next_patch=$(next_patch_for_file $patch $file) diff --git a/quilt/diff.in b/quilt/diff.in index 8d721ec..2603f0b 100644 --- a/quilt/diff.in +++ b/quilt/diff.in @@ -83,11 +83,12 @@ do_diff() die () { local status=$1 + [ -e "$tmp_files" ] && rm -f $tmp_files [ -n "$workdir" ] && rm -rf $workdir exit $status } -options=`getopt -o p:P:c:Rzh --long diff: -- "$@"` +options=`getopt -o p:P:c:Rzh --long diff:,snapshot -- "$@"` if [ $? -ne 0 ] then @@ -106,7 +107,8 @@ do last_patch=$(stripit $2) shift 2 ;; -c) - opt_combine=$(stripit $2) + opt_combine=1 + first_patch=$(stripit $2) shift 2 ;; -R) opt_reverse=1 @@ -116,8 +118,12 @@ do shift ;; -h) usage -h ;; + --snapshot) + opt_snapshot=1 + snap_subdir=.snap + shift ;; --diff) - opt_diff=$2 + opt_diff="$2" shift 2 ;; --) shift @@ -127,9 +133,9 @@ done opt_files=( "$@" ) -if [ -n "$opt_combine" -a -n "$opt_relative" ] +if [ $[0$opt_combine + 0$opt_snapshot + 0$opt_relative] -gt 1 ] then - echo $"Options \`-c patch' and \`-z' cannot be combined." + echo $"Options \`-c patch', \`--snapshot', and \`-z' cannot be combined." die 1 fi @@ -159,63 +165,60 @@ then die 1 fi +trap "die 1" SIGTERM + +tmp_files=$(gen_tempfile) +exec 4> $tmp_files # open $tmp_files + +if [ -n "$opt_snapshot" -a ${#opt_files[@]} -eq 0 ] +then + # Add all files in the snapshot into the file list (they may all + # have changed). + while read file + do + echo "${file#.pc/$snap_subdir/}" >&4 + done \ + < <(find .pc/$snap_subdir -type f) + # Also look at all patches that are currently applied. + opt_combine=1 + first_patch="$(applied_patches | head -n 1)" +fi + if [ -n "$opt_combine" ] then - if ! refresh_patches_per_file - then - echo $"refresh_patches_per_file failed." - die 1 - fi - set -- $(patches_before $last_patch) $last_patch - if [ "x$opt_combine" != "x-" ] + if [ "$first_patch" != "-" ] then - while [ $# -ge 1 -a "$1" != "$opt_combine" ] + while [ $# -ge 1 -a "$1" != "$first_patch" ] do shift done if [ $# -eq 0 ] then - echo $"Patch $opt_combine not applied before $last_patch." + echo $"Patch $first_patch not applied before $last_patch." die 1 fi fi - - while read file first garbage - do - if [ ${#opt_files[@]} -gt 0 ] && \ - ! in_array "$file" "${opt_files[@]}" - then - continue - fi - patches[${#patches[@]}]="$first" - files[${#files[@]}]="$file" - done \ - < <(modified_files -- "$@") + patches=( $@ ) else - for file in $(files_in_patch $last_patch) + patches=( $last_patch ) +fi + +for patch in ${patches[@]} +do + for file in $(files_in_patch $patch) do if [ ${#opt_files[@]} -gt 0 ] && \ ! in_array "$file" "${opt_files[@]}" then continue fi - files[${#files[@]}]="$file" - done -fi - -if [ ${#opt_files[@]} -gt 0 ] -then - for file in "${opt_files[@]}" - do - if ! in_array "$file" "${files[@]}" - then - echo $"File $file is not being modified." - fi - done -fi + echo "$file" >&4 + done < <(files_in_patch $patch) +done -trap "die 1" SIGTERM +exec 4>&- # close $tmp_files +files=( $(sort -u $tmp_files) ) if [ -n "$opt_relative" ] then @@ -266,10 +269,24 @@ then fi fi -for ((i=0; i<${#files[@]}; i++)) +for file in "${files[@]}" do - file="${files[$i]}" - first_patch=${patches[$i]:-$last_patch} + if [ -n "$opt_snapshot" -a -e ".pc/$snap_subdir/$file" ] + then + old_file=".pc/$snap_subdir/$file" + elif [ -n "$opt_relative" ] + then + old_file="$workdir/$file" + else + patch="$(first_modified_by $file ${patches[@]})" + if [ -z "$patch" ] + then + [ -z "$opt_snapshot" ] \ + && echo $"File $file is not being modified." + continue + fi + old_file="$(backup_file_name $patch $file)" + fi next_patch=$(next_patch_for_file $last_patch $file) if [ -z "$next_patch" ] @@ -280,13 +297,7 @@ do files_were_shadowed=1 fi - if [ -z "$opt_relative" ] - then - old_file=$(backup_file_name $first_patch $file) - do_diff $file $old_file $new_file - else - do_diff $file "$workdir/$file" $new_file - fi + do_diff "$file" "$old_file" "$new_file" if [ $? -ne 0 ] then diff --git a/quilt/edit.in b/quilt/edit.in new file mode 100644 index 0000000..4385015 --- /dev/null +++ b/quilt/edit.in @@ -0,0 +1,68 @@ +#! @BASH@ + +# This script is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# See the COPYING and AUTHORS files for more details. + +: ${EDITOR:=vi} + +usage() +{ + echo $"Usage: quilt edit file ..." + if [ x$1 = x-h ] + then + echo $" + +Edit the specified file(s) in $EDITOR after adding it (them) to the +topmost patch. +" + exit 0 + else + exit 1 + fi +} + +options=`getopt -o h -- "$@"` + +if [ $? -ne 0 ] +then + usage +fi + +eval set -- "$options" + +while true +do + case "$1" in + -h) + usage -h ;; + --) + shift + break ;; + esac +done + +if [ $# -eq 0 ] +then + usage +fi + +bash -c ". @QUILT@/add" "quilt add" "$@" +$EDITOR "$@" +status=$? +for file in "$@" +do + if ! [ -e "$file" ] + then + bash -c ". @QUILT@/remove" "quilt remove" "$file" + status=1 + fi +done + +exit $status +### Local Variables: +### mode: shell-script +### End: +# vim:filetype=sh diff --git a/quilt/patches.in b/quilt/patches.in index fd1b1fa..ad05cc4 100644 --- a/quilt/patches.in +++ b/quilt/patches.in @@ -24,7 +24,9 @@ usage() then echo $" -Print the list of patches that modify the specified file. +Print the list of patches that modify the specified file. (Uses a +heuristic to determine which files are modified by unapplied patches. +Note that this heuristic is much slower than scanning applied patches.) -n Print the patch file names instead of the patch names. @@ -37,18 +39,38 @@ Print the list of patches that modify the specified file. fi } -scan_patches() +scan_applied() { local prefix=$1 file=$2 shift 2 local patch - for patch in $(modified_files $file -- "$@" \ - | cut -d $'\t' -f2) + for patch in "$@" do - [ -n "$opt_filenames" ] && patch=$(patch_file_name $patch) - - echo "$prefix$patch" + if [ -f ".pc/$patch/$file" ] + then + [ -n "$opt_filenames" ] && \ + patch=$(patch_file_name $patch) + echo "$prefix$patch" + fi + done +} + +scan_unapplied() +{ + local prefix=$1 file=$2 + shift 2 + local file_bre="$(quote_bre $file)" patch + + for patch in "$@" + do + if touched_by_patch $(patch_strip_level $patch) $patch \ + | grep -q "^$file_bre\$" + then + [ -n "$opt_filenames" ] && \ + patch=$(patch_file_name $patch) + echo "$prefix$patch" + fi done } @@ -84,29 +106,23 @@ then fi opt_file=$1 -if ! refresh_patches_per_file -then - exit 1 -fi +top=$(top_patch) if [ -n "$opt_verbose" ] then - top=$(top_patch) - if [ -n "$top" ] - then - patches_before="$(patches_before $top)" - [ -n "$patches_before" ] && - scan_patches "+ " $opt_file $patches_before - scan_patches "= " $opt_file $top - patches_after="$(patches_after $top)" - [ -n "$patches_after" ] && - scan_patches " " $opt_file $(patches_after $top) - else - scan_patches " " $opt_file - fi + applied="+ " + current="= " + unapplied=" " else - scan_patches "" $opt_file + applied="" + current="" + unapplied="" fi + +scan_applied "$applied" $opt_file $(patches_before $top) +[ -n "$top" ] && \ + scan_applied "$current" $opt_file $top +scan_unapplied "$unapplied" $opt_file $(patches_after $top) ### Local Variables: ### mode: shell-script ### End: diff --git a/quilt/setup.in b/quilt/setup.in index 5cfd4ab..f4efdc7 100644 --- a/quilt/setup.in +++ b/quilt/setup.in @@ -26,8 +26,12 @@ usage() Initializes a source tree from a patch series file. The patch series file must contain the name of the relevant tar archive, in addition to the list of patches. - -d Copy the patch and series files to this directory - -l Create the link to the patches and the series file (quilt setup -l seriesfile). + +-d The directory that contains the archives and patches. Defaults + to the directory of the series/spec file. + +-l Make the patches directory a symbolic link. If a series file is + specified, also create a symlink to the series file. " exit 0 else @@ -55,7 +59,7 @@ parse_series() echo "SERIES $series" } -options=`getopt -o d:l:h -- "$@"` +options=`getopt -o d:lh -- "$@"` if [ $? -ne 0 ] then @@ -70,10 +74,9 @@ do -d) opt_source=$2 shift 2 ;; - -l) - link_opt=1 - series_file=$2 - shift 2 ;; + -l) + opt_link=1 + shift ;; -h) usage -h ;; --) @@ -85,31 +88,6 @@ done status=0 packagedir=. -if [ $link_opt -eq 1 ] -then - if [ $# -ne 0 ] - then - usage - fi - if ! [ -e "$series_file" ] - then - echo $"Series file $series_file not found" - exit 1 - fi - if ! [ -e "$opt_source" ] - then - source=$(dirname $(dirname $series_file))/patches - else - source=$opt_source - fi - echo $"create link patch $packagedir/patches to $source" - ln -s "$source" "${packagedir}/patches" - rm -rf "${packagedir}/series" - echo $"creat link of $series_file" - ln -s "$series_file" "${packagedir}/series" - exit 0 -fi - if [ $# -ne 1 ] then usage @@ -142,17 +120,21 @@ elif [ -n "$spec_file" ] then source="$(dirname "$spec_file")" else - source="$(dirname "$series_file")" + source="$(dirname $(dirname $series_file))/patches" fi -while read cmd arg arg2 && \ - [ $status -eq 0 ] +status=0 +packagedir=. +while read cmd arg arg2 do case $cmd in SOURCEDIR) # Directory for package sources - source="$arg" - echo $"Reading sources from $arg" + if [ -z "$source" ] + then + source="$arg" + echo $"Reading sources from $arg" + fi ;; SOURCE) echo $"Unpacking archive $source/$arg" @@ -176,20 +158,73 @@ do fi ;; PATCH) - echo $"Copying patch $source/$arg" - mkdir -p "$packagedir/patches/" && \ - cp "$source/$arg" "$packagedir/patches/" \ + if [ -n "$opt_link" ] + then + if ! [ -e "$packagedir/patches" ] + then + arg="$source" + if [ "${arg:0:1}" != "/" ] + then + arg="$PWD/$arg" + fi + echo $"Creating link to patches directory $arg" + ln -s "$arg" "$packagedir/patches" + elif [ -z "`readlink $packagedir/patches`" ] + then + echo $"$packagedir/patches exist, but not symlink" >&2 + status=1 + break + fi + else + echo $"Copying patch $source/$arg" + mkdir -p "$packagedir/patches/" && \ + cp "$source/$arg" "$packagedir/patches/" + fi ;; SERIES) - echo $"Copying series file" - cp "$arg" "$packagedir/patches/series" + if [ -n "$opt_link" ] + then + # The patches dir is a symlink to the directory + # containing the patches. Don't write the series + # file into that directory. + if [ -e "$packagedir/series" ] + then + echo $"File $packagedir/series exists; will not override." >&2 + status=1 + elif [ -n "$spec_file" ] + then + # There is no series file to link to; the + # series file we are reading from is a + # temporary file. + echo $"Copying series file" + cp "$arg" "$packagedir/series" + else + # Create a symlink to the series file. We don't + # want to mess with changing relative symlink + # targets... + if [ "${arg:0:1}" != "/" ] + then + arg="$PWD/$arg" + fi + echo $"Creatig link to series file $arg" + ln -s "$arg" "$packagedir/series" + fi + else + echo $"Copying series file" + cp "$arg" "$packagedir/patches/series" + fi ;; *) status=1 break ;; esac - status=$? + s=$? + if [ $status -eq 0 ] + then + status=$s + [ $status != 0 ] && break + fi done \ < <(parse_series "$series_file") diff --git a/quilt/snapshot.in b/quilt/snapshot.in new file mode 100644 index 0000000..6883a59 --- /dev/null +++ b/quilt/snapshot.in @@ -0,0 +1,98 @@ +#! @BASH@ + +# This script is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# See the COPYING and AUTHORS files for more details. + +# Read in library functions +if [ "$(type -t patch_file_name)" != function ] +then + if ! [ -r @SCRIPTS@/patchfns ] + then + echo "Cannot read library @SCRIPTS@/patchfns" >&2 + exit 1 + fi + . @SCRIPTS@/patchfns +fi + +usage() +{ + echo $"Usage: quilt snapshot [-d]" + if [ x$1 = x-h ] + then + echo $" + +Take a snapshot of the current working state. + +-d Remove current snapshot. + +" + exit 0 + else + exit 1 + fi +} + +options=`getopt -o dh -- "$@"` + +if [ $? -ne 0 ] +then + usage +fi + +eval set -- "$options" + +while true +do + case "$1" in + -d) + opt_remove=1 + shift ;; + -h) + usage -h ;; + --) + shift + break ;; + esac +done + +if [ $# -ne 0 ] +then + usage +fi + +snap_dir=.pc/.snap + +# Clean up from previous snapshot +rm -rf $snap_dir +mkdir -p $snap_dir + +if [ -n "$opt_remove" ] +then + exit 0 +fi + +# Save current working state +for patch in $(applied_patches | tac) +do + for file in $(files_in_patch $patch) + do + if ! [ -e "$snap_dir/$file" ] + then + mkdir -p "$snap_dir/$(dirname $file)" + if [ -e "$file" ] + then + ln "$file" "$snap_dir/$file" + else + touch "$snap_dir/$file" + fi + fi + done +done + +### Local Variables: +### mode: shell-script +### End: +# vim:filetype=sh diff --git a/scripts/patchfns.in b/scripts/patchfns.in index 60f855e..d1118eb 100644 --- a/scripts/patchfns.in +++ b/scripts/patchfns.in @@ -139,12 +139,11 @@ change_db_strip_level() } { print } ' $SERIES > $tmpfile - if cmp $SERIES $tmpfile >/dev/null 2>/dev/null + if ! cmp $SERIES $tmpfile >/dev/null 2>/dev/null then - rm -f $tmpfile - else - mv -f $tmpfile $SERIES + cat $tmpfile > $SERIES fi + rm -f $tmpfile else return 1 fi @@ -189,13 +188,14 @@ insert_in_series() return 1 fi else - echo $patch$patch_args > $tmpfile + echo "$patch$patch_args" > $tmpfile if [ -e $SERIES ] then cat $SERIES >> $tmpfile fi fi - mv -f $tmpfile $SERIES + cat $tmpfile > $SERIES + rm -f $tmpfile } remove_from_series() @@ -207,13 +207,35 @@ remove_from_series() ! /^'"$(quote_re $patch)"'(|\.patch|\.diff?)(|\.gz|\.bz2)([ \t]|$)/ \ { print } ' $SERIES > $tmpfile - if [ $? -eq 0 ] + if [ $? -ne 0 ] then - mv -f $tmpfile $SERIES - else rm -f $tmpfile return 1 fi + cat $tmpfile > $SERIES + rm -f $tmpfile +} + +rename_in_series() +{ + local from=$1 to=$2 + + tmpfile=$(gen_tempfile) || return 1 + /usr/bin/gawk ' + /^'"$(quote_re $from)"'(|\.patch|\.diff?)(|\.gz|\.bz2)([ \t]|$)/ \ + { sub(/'"$(quote_re $from)(|\.patch|\.diff?)(|\.gz|\.bz2)"'/, + "'"${to//\"/\\\"}"'") + good=1 } + { print } + END { exit(! good) } + ' $SERIES > $tmpfile + if [ $? -ne 0 ] + then + rm -f $tmpfile + return 1 + fi + cat $tmpfile > $SERIES + rm -f $tmpfile } save_patch_name() { @@ -353,106 +375,6 @@ next_patch_for_file() | head -n 1 \ | @SED@ -e 's:^\.pc/::' -e 's:/\.pc$::' fi - - #modified_files $file -- $patches_on_top \ - #| cut -d $'\t' -f2 \ - #| cut -d ' ' -f1 -} - -# Create a list of files and the patches that modify them. -refresh_patches_per_file() -{ - local pc_files=$(pc_file_name $(cat_series)) - local ex_pc_files pc_file - - if [ -e .pc/patches-per-file ] - then - local needs_refresh - for pc_file in pc_files - do - if [ .pc/patches-per-file -ot $pc_file ] - then - needs_refresh=1 - break - fi - done - if [ -z "$needs_refresh" ] - then - return 0 - fi - fi - - for pc_file in $pc_files - do - if [ -e $pc_file ] - then - ex_pc_files[${#ex_pc_files[@]}]=$pc_file - fi - done - - if [ ${#ex_pc_files[@]} -eq 0 ] - then - rm -f .pc/patches-per-file - return 0 - fi - - @AWK@ ' - ARGIND!=saved { sub(/^.pc\//, "", FILENAME) - sub(/\/\.pc/, "", FILENAME) - saved=ARGIND - } - { if (files[$0]) - files[$0]=files[$0] " " FILENAME - else - files[$0]=FILENAME - } - END { for (file in files) - printf "%s\t%s\n", file, files[file] - } - ' "${ex_pc_files[@]}" > .pc/patches-per-file -} - -# For a lists of patches and a list of files, compute which patches -# modify which files. Invoked as -# modified_files file ... [-- patch ...] -# -modified_files() -{ - if ! refresh_patches_per_file - then - return 1 - fi - - @AWK@ ' - BEGIN { no_files=1 - no_patches=1 - for (i=1; i<ARGC; i++) { - if (ARGV[i]=="--") - break - files[ARGV[i]]=1 - no_files=0 - } - for (i++; i<ARGC; i++) { - patches[ARGV[i]]=1 - no_patches=0 - } - split("", ARGV) # read from standard input - } - no_files || files[$1] { - if (no_patches) { - print - next - } - for (i=2; i<=NF; i++) - if ($i in patches) { - printf "%s\t%s", $1, $i - for (i++; i<=NF; i++) - if ($i in patches) - printf " %s", $i - printf "\n" - } - } - ' "$@" < .pc/patches-per-file } add_to_db() @@ -704,6 +626,27 @@ gen_tempfile() fi @MKTEMP@ $dir ${1:-${TMPDIR:-/tmp}/quilt}.XXXXXX } + +first_modified_by() +{ + local file=$1 patch + local -a patches + if [ $# -eq 0 ] + then + patches=( $(applied_patches) ) + else + shift + patches=( "$@" ) + fi + for patch in ${patches[@]} + do + if [ -f ".pc/$patch/$file" ] + then + echo $patch + fi + done + return 1 +} ### Local Variables: ### mode: shell-script ### End: diff --git a/test/snapshot.test b/test/snapshot.test new file mode 100644 index 0000000..8ae8d29 --- /dev/null +++ b/test/snapshot.test @@ -0,0 +1,61 @@ + $ mkdir d + $ cd d + + $ quilt new snapshot + > Patch snapshot is now on top + $ quilt add f.txt + > File f.txt added to patch snapshot + $ cat > f.txt + < f.txt + + $ quilt add g.txt + > File g.txt added to patch snapshot + $ cat > g.txt + < g.txt + + $ quilt refresh + > Refreshed patch snapshot + $ quilt snapshot + $ quilt pop -q + > Removing snapshot + > No patches applied + + $ quilt fork + > Fork of patches/snapshot created as patches/snapshot-2 + + $ quilt push -q + > Applying snapshot-2 + > Now at patch snapshot-2 + + $ quilt remove g.txt + > File g.txt removed from patch snapshot-2 + + $ quilt add h.txt + > File h.txt added to patch snapshot-2 + + $ cat > h.txt + < h.txt + + $ cat >> f.txt + < more changes + + $ quilt refresh + > Refreshed patch snapshot-2 + + $ quilt diff --snapshot | grep -v "^\\(---\\|+++\\)" + > Index: d/f.txt + > =================================================================== + > @@ -1 +1,2 @@ + > f.txt + > +more changes + > Index: d/g.txt + > =================================================================== + > @@ -1 +0,0 @@ + > -g.txt + > Index: d/h.txt + > =================================================================== + > @@ -0,0 +1 @@ + > +h.txt + + $ cd .. + $ rm -rf d |