summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2004-11-15 22:43:19 +0000
committerAndreas Gruenbacher <agruen@suse.de>2004-11-15 22:43:19 +0000
commit3277df52256cfb00d32580fa8519fa2a428a9a92 (patch)
tree081f89ab7a697cf462dd2d393acd50f22619c852
parentacf7a65fb03114102d1d46302d9d221a3acd0c5a (diff)
downloadquilt-3277df52256cfb00d32580fa8519fa2a428a9a92.tar.gz
- Get rid of the apatch and rpatch helper scripts: Integrate them
in the push and pop commands. This should bring a small performance improvement.
-rw-r--r--BUGS10
-rw-r--r--Makefile.in2
-rw-r--r--doc/README.in6
-rw-r--r--po/Makefile2
-rw-r--r--po/de.po132
-rw-r--r--po/fr.po136
-rw-r--r--po/ja.po134
-rw-r--r--po/quilt.pot111
-rw-r--r--quilt.changes7
-rw-r--r--quilt/delete.in2
-rw-r--r--quilt/pop.in137
-rw-r--r--quilt/push.in173
-rwxr-xr-xscripts/apatch.in205
-rwxr-xr-xscripts/rpatch.in188
-rw-r--r--test/example1.test2
15 files changed, 513 insertions, 734 deletions
diff --git a/BUGS b/BUGS
index 0e30f43..e03c135 100644
--- a/BUGS
+++ b/BUGS
@@ -1,16 +1,6 @@
-* Patch is less sensitive to the file names in the diff headers than
- the scripts are. It tries both filenames specified and apparently
- checks if the file exists. We only look at the `+++ file ...' header,
- and ignore the other. Other than patch we cannot simply look at the
- file system to determine which one is the imput file.
-
* Patch destroys the backup files it generates if a file appears more
than once in a patch. This is the reason why we use the backup-files
utility instead.
-* quilt setup doesn't detect if the source file doesn't exist.
-
-* Blank and commented out lines in series file cause problems.
-
* rpatch should only look at .pc/applied-patches, not at the series
file.
diff --git a/Makefile.in b/Makefile.in
index 51ad0e9..06ba25b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -64,7 +64,7 @@ QUILT := $(QUILT_IN)
SRC += $(QUILT_SRC:%=quilt/%)
DIRT += $(QUILT_IN:%=quilt/%)
-SCRIPTS_IN := apatch rpatch patchfns parse-patch inspect dependency-graph
+SCRIPTS_IN := patchfns parse-patch inspect dependency-graph
SCRIPTS_SRC := $(SCRIPTS_IN:%=%.in)
SCRIPTS := $(SCRIPTS_IN)
SRC += $(SCRIPTS_SRC:%=scripts/%)
diff --git a/doc/README.in b/doc/README.in
index 0f080d2..446574c 100644
--- a/doc/README.in
+++ b/doc/README.in
@@ -22,12 +22,6 @@ Helper files/scripts
patchfns
A collection of functions.
-apatch
- Add a patch. Used by pushpatch.
-
-rpatch
- Remove a patch. Used by poppatch.
-
parse-patch {-s|-u} section file [< replacement]
Select a %section from a patch (-s) or replace a
%section with the text from standard input (-u).
diff --git a/po/Makefile b/po/Makefile
index f18dcda..667765a 100644
--- a/po/Makefile
+++ b/po/Makefile
@@ -1,7 +1,7 @@
QUILT_IN := add applied delete diff files import new next patches \
pop previous push refresh remove series setup top unapplied \
fold fork snapshot edit upgrade
-SCRIPTS_IN := apatch rpatch patchfns inspect patchfns
+SCRIPTS_IN := patchfns inspect patchfns
# scripts/parse-patch is perl based
# LINGUAS = ...
diff --git a/po/de.po b/po/de.po
index 73d611c..111f130 100644
--- a/po/de.po
+++ b/po/de.po
@@ -66,20 +66,20 @@ msgstr ""
#: ../quilt/add.in:54 ../quilt/applied.in:62 ../quilt/delete.in:76
#: ../quilt/diff.in:148 ../quilt/diff.in:159 ../quilt/next.in:62
-#: ../quilt/pop.in:129 ../quilt/previous.in:62 ../quilt/push.in:145
+#: ../quilt/pop.in:237 ../quilt/previous.in:62 ../quilt/push.in:265
#: ../quilt/refresh.in:129 ../quilt/remove.in:53 ../quilt/unapplied.in:62
msgid "Patch %s is not in series\\n"
msgstr "Patch %s ist nicht in der series-Datei enthalten\\n"
-#: ../quilt/add.in:75 ../quilt/diff.in:221 ../quilt/pop.in:150
+#: ../quilt/add.in:75 ../quilt/diff.in:221 ../quilt/pop.in:252
#: ../quilt/refresh.in:135 ../quilt/remove.in:74
msgid "Patch %s is not applied\\n"
msgstr "Patch %s ist nicht angewandt\\n"
#: ../quilt/add.in:82 ../quilt/delete.in:68 ../quilt/diff.in:229
#: ../quilt/files.in:103 ../quilt/fold.in:79 ../quilt/fork.in:65
-#: ../quilt/pop.in:185 ../quilt/push.in:182 ../quilt/push.in:221
-#: ../quilt/refresh.in:143 ../quilt/remove.in:81
+#: ../quilt/pop.in:286 ../quilt/push.in:303 ../quilt/refresh.in:143
+#: ../quilt/remove.in:81
msgid "No patches applied\\n"
msgstr "Keine Patches angewandt\\n"
@@ -248,7 +248,7 @@ msgstr "Patch %s ist nicht vor Patch %s angewandt\\n"
msgid "Cannot change into directory %s\\n"
msgstr "Kann nicht in Verzeichnis %s wechseln\\n"
-#: ../quilt/diff.in:318 ../scripts/rpatch.in:62
+#: ../quilt/diff.in:318 ../quilt/pop.in:115 ../scripts/rpatch.in:62
msgid "Failed to copy files to temporary directory\\n"
msgstr "Konnte Dateien nicht in temporäres Verzeichnis kopieren\\n"
@@ -256,7 +256,7 @@ msgstr "Konnte Dateien nicht in temporäres Verzeichnis kopieren\\n"
msgid "Cannot change to temporary directory\\n"
msgstr "Kann nicht in temporäres Verzeichnis wechseln\\n"
-#: ../quilt/diff.in:348 ../scripts/rpatch.in:85
+#: ../quilt/diff.in:348 ../quilt/pop.in:138 ../scripts/rpatch.in:85
msgid "Failed to patch temporary files\\n"
msgstr "Konnte temporäre Dateien nicht patchen\\n"
@@ -557,15 +557,25 @@ msgstr ""
"\n"
"-v\tViele Meldungen ausgeben.\n"
-#: ../quilt/pop.in:160
+#: ../quilt/pop.in:153 ../scripts/rpatch.in:100
+msgid "Patch %s does not remove cleanly (refresh it or enforce with -f)\\n"
+msgstr ""
+"Patch %s kann nicht entfernt werden (Patch auffrischen oder Entfernen "
+"erzwingen mit -f)\\n"
+
+#: ../quilt/pop.in:176 ../scripts/rpatch.in:123
+msgid "Removing patch %s\\n"
+msgstr "Entferne patch %s\\n"
+
+#: ../quilt/pop.in:260 ../scripts/rpatch.in:179
+msgid "Patch %s needs to be refreshed first.\\n"
+msgstr "Patch %s muss zuerst aufgefrischt werden (Refresh).\\n"
+
+#: ../quilt/pop.in:270
msgid "No patch removed\\n"
msgstr "Kein Patch entfernt\\n"
-#: ../quilt/pop.in:176 ../quilt/push.in:212
-msgid "Interrupted by user\\n"
-msgstr "Unterbrechung durch Benutzer\\n"
-
-#: ../quilt/pop.in:192 ../quilt/push.in:223
+#: ../quilt/pop.in:293 ../quilt/push.in:321
msgid "Now at patch %s\\n"
msgstr "Jetzt in Patch %s\\n"
@@ -637,25 +647,43 @@ msgstr ""
"\tErlaubt GNU patch, interaktiv Fragen zu stellen. Wenn diese Option\n"
"\tnicht angegeben wird, wird die Option -f an GNU patch übergeben.\n"
-#: ../quilt/push.in:87
+#: ../quilt/push.in:59 ../scripts/apatch.in:29
+msgid "Interrupted by user; patch %s was not applied.\\n"
+msgstr "Unterbrechung durch Benutzer; Patch %s wurde nicht angewandt.\\n"
+
+#: ../quilt/push.in:71 ../scripts/apatch.in:41
+msgid "Patch %s appears to be empty\\n"
+msgstr "Patch %s scheint leer zu sein\\n"
+
+#: ../quilt/push.in:109 ../scripts/apatch.in:79
+msgid "Applying patch %s\\n"
+msgstr "Wende Patch %s an\\n"
+
+#: ../quilt/push.in:159 ../scripts/apatch.in:130
+msgid "Patch %s appears to be empty, applied\\n"
+msgstr "Patch %s scheint leer zu sein, angewandt\\n"
+
+#: ../quilt/push.in:163 ../scripts/apatch.in:134
+msgid "Applied patch %s (forced; needs refresh)\\n"
+msgstr "Patch %s angewandt (erzwungen, muß aufgefrischt werden (Refresh))\\n"
+
+#: ../quilt/push.in:168 ../scripts/apatch.in:139
+msgid "Patch %s does not apply (enforce with -f)\\n"
+msgstr "Patch %s läßt sich nicht anwenden (erzwingen mit -f)\\n"
+
+#: ../quilt/push.in:207
msgid "Patch %s not found in file series\\n"
msgstr "Patch %s nicht in series-Datei gefunden\\n"
-#: ../quilt/push.in:168
+#: ../quilt/push.in:282
msgid "Patch %s is already applied\\n"
msgstr "Patch %s ist bereits angewandt\\n"
-#: ../quilt/push.in:187
-msgid ""
-"The topmost patch %s 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.\\n"
-msgstr ""
-"Der oberste Patch $top ist nicht mehr in der series-Datei;\n"
-"kann den nächsten Patch nicht ermitteln. Bitte entfernen Sie\n"
-"mit pop -f den obersten Patch, und überprüfen Sie die series-Datei.\\n"
+#: ../quilt/push.in:291 ../scripts/apatch.in:197
+msgid "The topmost patch %s needs to be refreshed first.\\n"
+msgstr "Der oberste Patch %s muss zuerst aufgefrischt werden (Refresh).\\n"
-#: ../quilt/push.in:193
+#: ../quilt/push.in:305
msgid "File series fully applied, ends at patch %s\\n"
msgstr "series-Datei vollständig angewandt, endet in Patch %s\\n"
@@ -958,35 +986,7 @@ msgstr ""
msgid "Usage: $0 [-fqv] patchname\\n"
msgstr "Verwendung: $0 [-fqv] patchname\\n"
-#: ../scripts/apatch.in:29
-msgid "Interrupted by user; patch %s was not applied.\\n"
-msgstr "Unterbrechung durch Benutzer; Patch %s wurde nicht angewandt.\\n"
-
-#: ../scripts/apatch.in:41
-msgid "Patch %s appears to be empty\\n"
-msgstr "Patch %s scheint leer zu sein\\n"
-
-#: ../scripts/apatch.in:81
-msgid "Applying patch %s\\n"
-msgstr "Wende Patch %s an\\n"
-
-#: ../scripts/apatch.in:117
-msgid "Patch %s appears to be empty, applied\\n"
-msgstr "Patch %s scheint leer zu sein, angewandt\\n"
-
-#: ../scripts/apatch.in:121
-msgid "Applied patch %s (forced; needs refresh)\\n"
-msgstr "Patch %s angewandt (erzwungen, muß aufgefrischt werden (Refresh))\\n"
-
-#: ../scripts/apatch.in:126
-msgid "Patch %s does not apply (enforce with -f)\\n"
-msgstr "Patch %s läßt sich nicht anwenden (erzwingen mit -f)\\n"
-
-#: ../scripts/apatch.in:184
-msgid "The topmost patch %s needs to be refreshed first.\\n"
-msgstr "Der oberste Patch %s muss zuerst aufgefrischt werden (Refresh).\\n"
-
-#: ../scripts/patchfns.in:702
+#: ../scripts/patchfns.in:703
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 "
@@ -999,7 +999,7 @@ msgstr ""
"quilt alle Patches mit der Version von quilt, die zur Erstellung des "
"Arbeitsverzeichnisses verwendet wurde.\\n"
-#: ../scripts/patchfns.in:769
+#: ../scripts/patchfns.in:770
msgid ""
"The working tree was created by an older version of quilt. Please run 'quilt "
"upgrade'.\\n"
@@ -1011,16 +1011,14 @@ msgstr ""
msgid "Usage: %s [-fRq] patchname\\n"
msgstr "Verwendung: %s [-fRq] patchname\\n"
-#: ../scripts/rpatch.in:100
-msgid "Patch %s does not remove cleanly (refresh it or enforce with -f)\\n"
-msgstr ""
-"Patch %s kann nicht entfernt werden (Patch auffrischen oder Entfernen "
-"erzwingen mit -f)\\n"
-
-#: ../scripts/rpatch.in:123
-msgid "Removing patch %s\\n"
-msgstr "Entferne patch %s\\n"
-
-#: ../scripts/rpatch.in:179
-msgid "Patch %s needs to be refreshed first.\\n"
-msgstr "Patch %s muss zuerst aufgefrischt werden (Refresh).\\n"
+#~ msgid "Interrupted by user\\n"
+#~ msgstr "Unterbrechung durch Benutzer\\n"
+
+#~ msgid ""
+#~ "The topmost patch %s 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.\\n"
+#~ msgstr ""
+#~ "Der oberste Patch $top ist nicht mehr in der series-Datei;\n"
+#~ "kann den nächsten Patch nicht ermitteln. Bitte entfernen Sie\n"
+#~ "mit pop -f den obersten Patch, und überprüfen Sie die series-Datei.\\n"
diff --git a/po/fr.po b/po/fr.po
index 2d06b26..6d86bc6 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -68,20 +68,20 @@ msgstr ""
#: ../quilt/add.in:54 ../quilt/applied.in:62 ../quilt/delete.in:76
#: ../quilt/diff.in:148 ../quilt/diff.in:159 ../quilt/next.in:62
-#: ../quilt/pop.in:129 ../quilt/previous.in:62 ../quilt/push.in:145
+#: ../quilt/pop.in:237 ../quilt/previous.in:62 ../quilt/push.in:265
#: ../quilt/refresh.in:129 ../quilt/remove.in:53 ../quilt/unapplied.in:62
msgid "Patch %s is not in series\\n"
msgstr "Le patch %s n'est pas dans la srie\\n"
-#: ../quilt/add.in:75 ../quilt/diff.in:221 ../quilt/pop.in:150
+#: ../quilt/add.in:75 ../quilt/diff.in:221 ../quilt/pop.in:252
#: ../quilt/refresh.in:135 ../quilt/remove.in:74
msgid "Patch %s is not applied\\n"
msgstr "Le patch %s n'est pas appliqu\\n"
#: ../quilt/add.in:82 ../quilt/delete.in:68 ../quilt/diff.in:229
#: ../quilt/files.in:103 ../quilt/fold.in:79 ../quilt/fork.in:65
-#: ../quilt/pop.in:185 ../quilt/push.in:182 ../quilt/push.in:221
-#: ../quilt/refresh.in:143 ../quilt/remove.in:81
+#: ../quilt/pop.in:286 ../quilt/push.in:303 ../quilt/refresh.in:143
+#: ../quilt/remove.in:81
msgid "No patches applied\\n"
msgstr "Aucun patch n'est appliqu\\n"
@@ -257,7 +257,7 @@ msgstr "Le patch %s n'est pas appliqu avant %s\\n."
msgid "Cannot change into directory %s\\n"
msgstr "Impossible d'entrer dans le rpertoire %s\\n"
-#: ../quilt/diff.in:318 ../scripts/rpatch.in:62
+#: ../quilt/diff.in:318 ../quilt/pop.in:115 ../scripts/rpatch.in:62
msgid "Failed to copy files to temporary directory\\n"
msgstr "Impossible de copier les fichiers dans le rpertoire temporaire\\n"
@@ -265,7 +265,7 @@ msgstr "Impossible de copier les fichiers dans le rpertoire temporaire\\n"
msgid "Cannot change to temporary directory\\n"
msgstr "Impossible d'entrer dans le rpertoire temporaire\\n"
-#: ../quilt/diff.in:348 ../scripts/rpatch.in:85
+#: ../quilt/diff.in:348 ../quilt/pop.in:138 ../scripts/rpatch.in:85
msgid "Failed to patch temporary files\\n"
msgstr "Impossible de patcher les fichiers temporaires\\n"
@@ -571,15 +571,25 @@ msgstr ""
"\n"
"-v\tOpre verbeusement.\n"
-#: ../quilt/pop.in:160
+#: ../quilt/pop.in:153 ../scripts/rpatch.in:100
+msgid "Patch %s does not remove cleanly (refresh it or enforce with -f)\\n"
+msgstr ""
+"Le patch %s ne se retire pas proprement (rafraichissez le, ou forcez avec -f)"
+"\\n"
+
+#: ../quilt/pop.in:176 ../scripts/rpatch.in:123
+msgid "Removing patch %s\\n"
+msgstr "Retrait de %s\\n"
+
+#: ../quilt/pop.in:260 ../scripts/rpatch.in:179
+msgid "Patch %s needs to be refreshed first.\\n"
+msgstr "Le patch %s doit tre rafraichi au pralable.\\n"
+
+#: ../quilt/pop.in:270
msgid "No patch removed\\n"
msgstr "Aucun patch retir\\n"
-#: ../quilt/pop.in:176 ../quilt/push.in:212
-msgid "Interrupted by user\\n"
-msgstr "Interrompu par l'utilisateur\\n"
-
-#: ../quilt/pop.in:192 ../quilt/push.in:223
+#: ../quilt/pop.in:293 ../quilt/push.in:321
msgid "Now at patch %s\\n"
msgstr "Le patch %s est maintenant au sommet\\n"
@@ -657,26 +667,44 @@ msgstr ""
"\tSi cette option n'est pas donne, l'option -f sera passe au \n"
"\tprogramme patch.\n"
-#: ../quilt/push.in:87
+#: ../quilt/push.in:59 ../scripts/apatch.in:29
+msgid "Interrupted by user; patch %s was not applied.\\n"
+msgstr "Interrompu par l'utilisateur ; le patch %s n'a pas t appliqu.\\n"
+
+#: ../quilt/push.in:71 ../scripts/apatch.in:41
+msgid "Patch %s appears to be empty\\n"
+msgstr "Le patch %s semble vide.\\n"
+
+#: ../quilt/push.in:109 ../scripts/apatch.in:79
+msgid "Applying patch %s\\n"
+msgstr "Application de %s\\n"
+
+#: ../quilt/push.in:159 ../scripts/apatch.in:130
+msgid "Patch %s appears to be empty, applied\\n"
+msgstr "Le patch %s semble vide. Il a t appliqu.\\n"
+
+#: ../quilt/push.in:163 ../scripts/apatch.in:134
+msgid "Applied patch %s (forced; needs refresh)\\n"
+msgstr "%s a t appliqu (forc ; vous devriez le rafrachir)\\n"
+
+#: ../quilt/push.in:168 ../scripts/apatch.in:139
+msgid "Patch %s does not apply (enforce with -f)\\n"
+msgstr ""
+"Le patch %s ne s'applique pas proprement (forcez l'application avec -f)\\n"
+
+#: ../quilt/push.in:207
msgid "Patch %s not found in file series\\n"
msgstr "Le patch %s est introuvable dans le fichier de srie\\n"
-#: ../quilt/push.in:168
+#: ../quilt/push.in:282
msgid "Patch %s is already applied\\n"
msgstr "Le patch %s est dj appliqu.\\n"
-#: ../quilt/push.in:187
-msgid ""
-"The topmost patch %s 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.\\n"
-msgstr ""
-"Le patch du sommet %s n'apparait plus dans la srie;\n"
-"Impossible de dterminer le prochain patch de la srie.\n"
-"Veuillez utiliser pop -f pour le patch du sommet, et vrifier \n"
-"votre fichier de srie.\\n"
+#: ../quilt/push.in:291 ../scripts/apatch.in:197
+msgid "The topmost patch %s needs to be refreshed first.\\n"
+msgstr "Le patch au sommet %s doit tre rafraichi au pralable.\\n"
-#: ../quilt/push.in:193
+#: ../quilt/push.in:305
msgid "File series fully applied, ends at patch %s\\n"
msgstr "La srie est compltement applique. Le dernier patch est %s.\\n"
@@ -979,36 +1007,7 @@ msgstr ""
msgid "Usage: $0 [-fqv] patchname\\n"
msgstr "Usage : $0 [-fqv] patchname\\n"
-#: ../scripts/apatch.in:29
-msgid "Interrupted by user; patch %s was not applied.\\n"
-msgstr "Interrompu par l'utilisateur ; le patch %s n'a pas t appliqu.\\n"
-
-#: ../scripts/apatch.in:41
-msgid "Patch %s appears to be empty\\n"
-msgstr "Le patch %s semble vide.\\n"
-
-#: ../scripts/apatch.in:81
-msgid "Applying patch %s\\n"
-msgstr "Application de %s\\n"
-
-#: ../scripts/apatch.in:117
-msgid "Patch %s appears to be empty, applied\\n"
-msgstr "Le patch %s semble vide. Il a t appliqu.\\n"
-
-#: ../scripts/apatch.in:121
-msgid "Applied patch %s (forced; needs refresh)\\n"
-msgstr "%s a t appliqu (forc ; vous devriez le rafrachir)\\n"
-
-#: ../scripts/apatch.in:126
-msgid "Patch %s does not apply (enforce with -f)\\n"
-msgstr ""
-"Le patch %s ne s'applique pas proprement (forcez l'application avec -f)\\n"
-
-#: ../scripts/apatch.in:184
-msgid "The topmost patch %s needs to be refreshed first.\\n"
-msgstr "Le patch au sommet %s doit tre rafraichi au pralable.\\n"
-
-#: ../scripts/patchfns.in:702
+#: ../scripts/patchfns.in:703
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 "
@@ -1020,7 +1019,7 @@ msgstr ""
"format %s (inclus). Veuillez retirer vos patches avec la version \n"
"utilise pour les appliquer avant d'installer une version plus ancienne.\\n"
-#: ../scripts/patchfns.in:769
+#: ../scripts/patchfns.in:770
msgid ""
"The working tree was created by an older version of quilt. Please run 'quilt "
"upgrade'.\\n"
@@ -1032,16 +1031,15 @@ msgstr ""
msgid "Usage: %s [-fRq] patchname\\n"
msgstr "Usage: %s [-fRq] nom_de_patch\\n"
-#: ../scripts/rpatch.in:100
-msgid "Patch %s does not remove cleanly (refresh it or enforce with -f)\\n"
-msgstr ""
-"Le patch %s ne se retire pas proprement (rafraichissez le, ou forcez avec -f)"
-"\\n"
-
-#: ../scripts/rpatch.in:123
-msgid "Removing patch %s\\n"
-msgstr "Retrait de %s\\n"
-
-#: ../scripts/rpatch.in:179
-msgid "Patch %s needs to be refreshed first.\\n"
-msgstr "Le patch %s doit tre rafraichi au pralable.\\n"
+#~ msgid "Interrupted by user\\n"
+#~ msgstr "Interrompu par l'utilisateur\\n"
+
+#~ msgid ""
+#~ "The topmost patch %s 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.\\n"
+#~ msgstr ""
+#~ "Le patch du sommet %s n'apparait plus dans la srie;\n"
+#~ "Impossible de dterminer le prochain patch de la srie.\n"
+#~ "Veuillez utiliser pop -f pour le patch du sommet, et vrifier \n"
+#~ "votre fichier de srie.\\n"
diff --git a/po/ja.po b/po/ja.po
index ffcda8c..473e729 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -66,20 +66,20 @@ msgstr ""
#: ../quilt/add.in:54 ../quilt/applied.in:62 ../quilt/delete.in:76
#: ../quilt/diff.in:148 ../quilt/diff.in:159 ../quilt/next.in:62
-#: ../quilt/pop.in:129 ../quilt/previous.in:62 ../quilt/push.in:145
+#: ../quilt/pop.in:237 ../quilt/previous.in:62 ../quilt/push.in:265
#: ../quilt/refresh.in:129 ../quilt/remove.in:53 ../quilt/unapplied.in:62
msgid "Patch %s is not in series\\n"
msgstr "パッチ %s は seriesの中にありません\\n"
-#: ../quilt/add.in:75 ../quilt/diff.in:221 ../quilt/pop.in:150
+#: ../quilt/add.in:75 ../quilt/diff.in:221 ../quilt/pop.in:252
#: ../quilt/refresh.in:135 ../quilt/remove.in:74
msgid "Patch %s is not applied\\n"
msgstr "パッチ %s は適用されていません\\n"
#: ../quilt/add.in:82 ../quilt/delete.in:68 ../quilt/diff.in:229
#: ../quilt/files.in:103 ../quilt/fold.in:79 ../quilt/fork.in:65
-#: ../quilt/pop.in:185 ../quilt/push.in:182 ../quilt/push.in:221
-#: ../quilt/refresh.in:143 ../quilt/remove.in:81
+#: ../quilt/pop.in:286 ../quilt/push.in:303 ../quilt/refresh.in:143
+#: ../quilt/remove.in:81
msgid "No patches applied\\n"
msgstr "適用されているパッチはありません\\n"
@@ -243,7 +243,7 @@ msgstr "パッチ %s は、パッチ %s の前に適用されていません\\n"
msgid "Cannot change into directory %s\\n"
msgstr "ディレクトリ %s に移動できません\\n"
-#: ../quilt/diff.in:318 ../scripts/rpatch.in:62
+#: ../quilt/diff.in:318 ../quilt/pop.in:115 ../scripts/rpatch.in:62
msgid "Failed to copy files to temporary directory\\n"
msgstr "テンポラリディレクトリへのファイルコピーに失敗しました\\n"
@@ -251,7 +251,7 @@ msgstr "テンポラリディレクトリへのファイルコピーに失敗し
msgid "Cannot change to temporary directory\\n"
msgstr "テンポラリディレクトリに移動できません\\n"
-#: ../quilt/diff.in:348 ../scripts/rpatch.in:85
+#: ../quilt/diff.in:348 ../quilt/pop.in:138 ../scripts/rpatch.in:85
msgid "Failed to patch temporary files\\n"
msgstr "テンポラリファイルへのパッチ適用に失敗しました\\n"
@@ -548,15 +548,25 @@ msgstr ""
"\n"
"-v\t詳細に表示。\n"
-#: ../quilt/pop.in:160
+#: ../quilt/pop.in:153 ../scripts/rpatch.in:100
+msgid "Patch %s does not remove cleanly (refresh it or enforce with -f)\\n"
+msgstr ""
+"パッチ %s を、正常にはずすことができません (リフレッシュするか -fを付\n"
+"けてはずしてください)\\n"
+
+#: ../quilt/pop.in:176 ../scripts/rpatch.in:123
+msgid "Removing patch %s\\n"
+msgstr "パッチ %s を削除します\\n"
+
+#: ../quilt/pop.in:260 ../scripts/rpatch.in:179
+msgid "Patch %s needs to be refreshed first.\\n"
+msgstr "最初に、パッチ %s のリフレッシュが必要です。\\n"
+
+#: ../quilt/pop.in:270
msgid "No patch removed\\n"
msgstr "適用されているパッチはありません\\n"
-#: ../quilt/pop.in:176 ../quilt/push.in:212
-msgid "Interrupted by user\\n"
-msgstr "ユーザによって中断されました\\n"
-
-#: ../quilt/pop.in:192 ../quilt/push.in:223
+#: ../quilt/pop.in:293 ../quilt/push.in:321
msgid "Now at patch %s\\n"
msgstr "現在位置はパッチ %s です"
@@ -625,25 +635,44 @@ msgstr ""
"\tまま残す。\n"
"\n"
-#: ../quilt/push.in:87
+#: ../quilt/push.in:59 ../scripts/apatch.in:29
+msgid "Interrupted by user; patch %s was not applied.\\n"
+msgstr "ユーザによって中断されました。パッチ % は適用されていません。\\n"
+
+#: ../quilt/push.in:71 ../scripts/apatch.in:41
+msgid "Patch %s appears to be empty\\n"
+msgstr "パッチ %sは、空のようです\\n"
+
+#: ../quilt/push.in:109 ../scripts/apatch.in:79
+msgid "Applying patch %s\\n"
+msgstr "パッチ %s を適用しています\\n"
+
+#: ../quilt/push.in:159 ../scripts/apatch.in:130
+msgid "Patch %s appears to be empty, applied\\n"
+msgstr "パッチ %s は、空のようですが、適用しました\\n"
+
+#: ../quilt/push.in:163 ../scripts/apatch.in:134
+msgid "Applied patch %s (forced; needs refresh)\\n"
+msgstr ""
+"パッチ % を適用しました (強制適用したために、リフレッシュが必要です)\\n"
+
+#: ../quilt/push.in:168 ../scripts/apatch.in:139
+msgid "Patch %s does not apply (enforce with -f)\\n"
+msgstr "パッチ %sが適用できません (強制適用する場合は -fを付けてください)\\n"
+
+#: ../quilt/push.in:207
msgid "Patch %s not found in file series\\n"
msgstr "パッチ %s が seriesファイル内で見つかりません。\\n"
-#: ../quilt/push.in:168
+#: ../quilt/push.in:282
msgid "Patch %s is already applied\\n"
msgstr "パッチ %s は、すでに適用済です\\n"
-#: ../quilt/push.in:187
-msgid ""
-"The topmost patch %s 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.\\n"
-msgstr ""
-"最上位パッチが seriesファイルの中にないため、次のパッチを seriesファイ\n"
-"ルから選択することができません。pop -fを行ない、seriesファイルをチェッ\n"
-"クしてください。\\n"
+#: ../quilt/push.in:291 ../scripts/apatch.in:197
+msgid "The topmost patch %s needs to be refreshed first.\\n"
+msgstr "最上位パッチのリフレッシュが最初に必要です。\\n"
-#: ../quilt/push.in:193
+#: ../quilt/push.in:305
msgid "File series fully applied, ends at patch %s\\n"
msgstr ""
"seriesファイルのパッチはすべて適用されています。\n"
@@ -942,36 +971,7 @@ msgstr ""
msgid "Usage: $0 [-fqv] patchname\\n"
msgstr "使い方: $0 [-fqv] パッチ名\\n"
-#: ../scripts/apatch.in:29
-msgid "Interrupted by user; patch %s was not applied.\\n"
-msgstr "ユーザによって中断されました。パッチ % は適用されていません。\\n"
-
-#: ../scripts/apatch.in:41
-msgid "Patch %s appears to be empty\\n"
-msgstr "パッチ %sは、空のようです\\n"
-
-#: ../scripts/apatch.in:81
-msgid "Applying patch %s\\n"
-msgstr "パッチ %s を適用しています\\n"
-
-#: ../scripts/apatch.in:117
-msgid "Patch %s appears to be empty, applied\\n"
-msgstr "パッチ %s は、空のようですが、適用しました\\n"
-
-#: ../scripts/apatch.in:121
-msgid "Applied patch %s (forced; needs refresh)\\n"
-msgstr ""
-"パッチ % を適用しました (強制適用したために、リフレッシュが必要です)\\n"
-
-#: ../scripts/apatch.in:126
-msgid "Patch %s does not apply (enforce with -f)\\n"
-msgstr "パッチ %sが適用できません (強制適用する場合は -fを付けてください)\\n"
-
-#: ../scripts/apatch.in:184
-msgid "The topmost patch %s needs to be refreshed first.\\n"
-msgstr "最上位パッチのリフレッシュが最初に必要です。\\n"
-
-#: ../scripts/patchfns.in:702
+#: ../scripts/patchfns.in:703
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 "
@@ -983,7 +983,7 @@ msgstr ""
"ていません。ダウングレードする前に、pushしたバージョンの quiltを使って、\n"
"すべてのパッチを pop してください。\\n"
-#: ../scripts/patchfns.in:769
+#: ../scripts/patchfns.in:770
msgid ""
"The working tree was created by an older version of quilt. Please run 'quilt "
"upgrade'.\\n"
@@ -995,16 +995,14 @@ msgstr ""
msgid "Usage: %s [-fRq] patchname\\n"
msgstr "使い方: %s [-fRq] パッチ名\\n"
-#: ../scripts/rpatch.in:100
-msgid "Patch %s does not remove cleanly (refresh it or enforce with -f)\\n"
-msgstr ""
-"パッチ %s を、正常にはずすことができません (リフレッシュするか -fを付\n"
-"けてはずしてください)\\n"
-
-#: ../scripts/rpatch.in:123
-msgid "Removing patch %s\\n"
-msgstr "パッチ %s を削除します\\n"
-
-#: ../scripts/rpatch.in:179
-msgid "Patch %s needs to be refreshed first.\\n"
-msgstr "最初に、パッチ %s のリフレッシュが必要です。\\n"
+#~ msgid "Interrupted by user\\n"
+#~ msgstr "ユーザによって中断されました\\n"
+
+#~ msgid ""
+#~ "The topmost patch %s 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.\\n"
+#~ msgstr ""
+#~ "最上位パッチが seriesファイルの中にないため、次のパッチを seriesファイ\n"
+#~ "ルから選択することができません。pop -fを行ない、seriesファイルをチェッ\n"
+#~ "クしてください。\\n"
diff --git a/po/quilt.pot b/po/quilt.pot
index 874f7e4..3d5c429 100644
--- a/po/quilt.pot
+++ b/po/quilt.pot
@@ -36,20 +36,20 @@ msgstr ""
#: ../quilt/add.in:54 ../quilt/applied.in:62 ../quilt/delete.in:76
#: ../quilt/diff.in:148 ../quilt/diff.in:159 ../quilt/next.in:62
-#: ../quilt/pop.in:129 ../quilt/previous.in:62 ../quilt/push.in:145
+#: ../quilt/pop.in:237 ../quilt/previous.in:62 ../quilt/push.in:265
#: ../quilt/refresh.in:129 ../quilt/remove.in:53 ../quilt/unapplied.in:62
msgid "Patch %s is not in series\\n"
msgstr ""
-#: ../quilt/add.in:75 ../quilt/diff.in:221 ../quilt/pop.in:150
+#: ../quilt/add.in:75 ../quilt/diff.in:221 ../quilt/pop.in:252
#: ../quilt/refresh.in:135 ../quilt/remove.in:74
msgid "Patch %s is not applied\\n"
msgstr ""
#: ../quilt/add.in:82 ../quilt/delete.in:68 ../quilt/diff.in:229
#: ../quilt/files.in:103 ../quilt/fold.in:79 ../quilt/fork.in:65
-#: ../quilt/pop.in:185 ../quilt/push.in:182 ../quilt/push.in:221
-#: ../quilt/refresh.in:143 ../quilt/remove.in:81
+#: ../quilt/pop.in:286 ../quilt/push.in:303 ../quilt/refresh.in:143
+#: ../quilt/remove.in:81
msgid "No patches applied\\n"
msgstr ""
@@ -168,7 +168,7 @@ msgstr ""
msgid "Cannot change into directory %s\\n"
msgstr ""
-#: ../quilt/diff.in:318 ../scripts/rpatch.in:62
+#: ../quilt/diff.in:318 ../quilt/pop.in:115 ../scripts/rpatch.in:62
msgid "Failed to copy files to temporary directory\\n"
msgstr ""
@@ -176,7 +176,7 @@ msgstr ""
msgid "Cannot change to temporary directory\\n"
msgstr ""
-#: ../quilt/diff.in:348 ../scripts/rpatch.in:85
+#: ../quilt/diff.in:348 ../quilt/pop.in:138 ../scripts/rpatch.in:85
msgid "Failed to patch temporary files\\n"
msgstr ""
@@ -401,15 +401,23 @@ msgid ""
"-v\tVerbose operation.\n"
msgstr ""
-#: ../quilt/pop.in:160
-msgid "No patch removed\\n"
+#: ../quilt/pop.in:153 ../scripts/rpatch.in:100
+msgid "Patch %s does not remove cleanly (refresh it or enforce with -f)\\n"
+msgstr ""
+
+#: ../quilt/pop.in:176 ../scripts/rpatch.in:123
+msgid "Removing patch %s\\n"
msgstr ""
-#: ../quilt/pop.in:176 ../quilt/push.in:212
-msgid "Interrupted by user\\n"
+#: ../quilt/pop.in:260 ../scripts/rpatch.in:179
+msgid "Patch %s needs to be refreshed first.\\n"
msgstr ""
-#: ../quilt/pop.in:192 ../quilt/push.in:223
+#: ../quilt/pop.in:270
+msgid "No patch removed\\n"
+msgstr ""
+
+#: ../quilt/pop.in:293 ../quilt/push.in:321
msgid "Now at patch %s\\n"
msgstr ""
@@ -456,22 +464,43 @@ msgid ""
"\tpatch program.\n"
msgstr ""
-#: ../quilt/push.in:87
+#: ../quilt/push.in:59 ../scripts/apatch.in:29
+msgid "Interrupted by user; patch %s was not applied.\\n"
+msgstr ""
+
+#: ../quilt/push.in:71 ../scripts/apatch.in:41
+msgid "Patch %s appears to be empty\\n"
+msgstr ""
+
+#: ../quilt/push.in:109 ../scripts/apatch.in:79
+msgid "Applying patch %s\\n"
+msgstr ""
+
+#: ../quilt/push.in:159 ../scripts/apatch.in:130
+msgid "Patch %s appears to be empty, applied\\n"
+msgstr ""
+
+#: ../quilt/push.in:163 ../scripts/apatch.in:134
+msgid "Applied patch %s (forced; needs refresh)\\n"
+msgstr ""
+
+#: ../quilt/push.in:168 ../scripts/apatch.in:139
+msgid "Patch %s does not apply (enforce with -f)\\n"
+msgstr ""
+
+#: ../quilt/push.in:207
msgid "Patch %s not found in file series\\n"
msgstr ""
-#: ../quilt/push.in:168
+#: ../quilt/push.in:282
msgid "Patch %s is already applied\\n"
msgstr ""
-#: ../quilt/push.in:187
-msgid ""
-"The topmost patch %s 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.\\n"
+#: ../quilt/push.in:291 ../scripts/apatch.in:197
+msgid "The topmost patch %s needs to be refreshed first.\\n"
msgstr ""
-#: ../quilt/push.in:193
+#: ../quilt/push.in:305
msgid "File series fully applied, ends at patch %s\\n"
msgstr ""
@@ -687,35 +716,7 @@ msgstr ""
msgid "Usage: $0 [-fqv] patchname\\n"
msgstr ""
-#: ../scripts/apatch.in:29
-msgid "Interrupted by user; patch %s was not applied.\\n"
-msgstr ""
-
-#: ../scripts/apatch.in:41
-msgid "Patch %s appears to be empty\\n"
-msgstr ""
-
-#: ../scripts/apatch.in:81
-msgid "Applying patch %s\\n"
-msgstr ""
-
-#: ../scripts/apatch.in:117
-msgid "Patch %s appears to be empty, applied\\n"
-msgstr ""
-
-#: ../scripts/apatch.in:121
-msgid "Applied patch %s (forced; needs refresh)\\n"
-msgstr ""
-
-#: ../scripts/apatch.in:126
-msgid "Patch %s does not apply (enforce with -f)\\n"
-msgstr ""
-
-#: ../scripts/apatch.in:184
-msgid "The topmost patch %s needs to be refreshed first.\\n"
-msgstr ""
-
-#: ../scripts/patchfns.in:702
+#: ../scripts/patchfns.in:703
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 "
@@ -723,7 +724,7 @@ msgid ""
"downgrading.\\n"
msgstr ""
-#: ../scripts/patchfns.in:769
+#: ../scripts/patchfns.in:770
msgid ""
"The working tree was created by an older version of quilt. Please run 'quilt "
"upgrade'.\\n"
@@ -732,15 +733,3 @@ msgstr ""
#: ../scripts/rpatch.in:22
msgid "Usage: %s [-fRq] patchname\\n"
msgstr ""
-
-#: ../scripts/rpatch.in:100
-msgid "Patch %s does not remove cleanly (refresh it or enforce with -f)\\n"
-msgstr ""
-
-#: ../scripts/rpatch.in:123
-msgid "Removing patch %s\\n"
-msgstr ""
-
-#: ../scripts/rpatch.in:179
-msgid "Patch %s needs to be refreshed first.\\n"
-msgstr ""
diff --git a/quilt.changes b/quilt.changes
index 74ec083..a75dce2 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Mon Nov 15 23:36:40 CET 2004 - agruen@suse.de
+
+- Get rid of the apatch and rpatch helper scripts: Integrate them
+ in the push and pop commands. This should bring a small
+ performance improvement.
+
+-------------------------------------------------------------------
Mon Nov 8 13:02:31 CET 2004 - agruen@suse.de
- Fix extra trailing space in series file after quilt refresh
diff --git a/quilt/delete.in b/quilt/delete.in
index 2e190da..d807d39 100644
--- a/quilt/delete.in
+++ b/quilt/delete.in
@@ -80,7 +80,7 @@ fi
if is_applied $patch
then
if [ "$patch" != "$(top_patch)" ] || \
- ! @SCRIPTS@/rpatch -fq "$patch"
+ ! @QUILT@/pop -fq "$patch"
then
printf $"Patch %s is currently applied\n" \
"$(print_patch $patch)" >&2
diff --git a/quilt/pop.in b/quilt/pop.in
index 6f8562c..4e807b1 100644
--- a/quilt/pop.in
+++ b/quilt/pop.in
@@ -76,6 +76,114 @@ list_patches()
fi
}
+files_may_have_changed()
+{
+ local patch=$1 file
+ local patch_file=$(patch_file_name $patch)
+
+ if [ $? -ne 0 -o ! -e "$patch_file" \
+ -o ! -e "$QUILT_PC/$patch/.timestamp" \
+ -o "$QUILT_PC/$patch/.timestamp" -ot "$patch_file" ]
+ then
+ return 0
+ fi
+
+ local apply_ts=$(date -r "$QUILT_PC/$patch/.timestamp" '+%s') ts
+ for file in $(files_in_patch $patch)
+ do
+ ts=$(date -r $file '+%s' 2> /dev/null)
+ [ -z "$ts" ] && return 0
+ [ "$ts" -gt $apply_ts ] && return 0
+ done
+ return 1
+}
+
+# Check if all changes have been folded back into the patch (quilt refresh),
+# and report any pending changes.
+check_for_pending_changes()
+{
+ local patch=$1
+ local patch_file=$(patch_file_name $patch)
+ local patch_args=$(patch_args $patch)
+ local workdir=$(gen_tempfile -d quilt) status=0
+
+ if [ -d $QUILT_PC/$patch ]
+ then
+ if ! rmdir $workdir || # note that this is racey...
+ ! cp -rl $QUILT_PC/$patch $workdir/
+ then
+ printf $"Failed to copy files to temporary directory\n" >&2
+ rm -rf $workdir
+ return 1
+ fi
+
+ # Now we may have some zero-size files that have no
+ # permissions (which represent files that the patch
+ # creates). Those may have been created in the meantime,
+ # but patch would refuse to touch them: We must remove
+ # them here.
+ find $workdir -type f -size 0 -exec rm -f '{}' ';'
+
+ fi
+
+ if [ -s $patch_file ]
+ then
+ if ! cat_file $patch_file \
+ | @PATCH@ -d $workdir $patch_args \
+ --no-backup-if-mismatch -E \
+ >/dev/null 2>/dev/null
+ then
+ if ! [ -e $QUILT_PC/$patch ]
+ then
+ printf $"Failed to patch temporary files\n" >&2
+ rm -rf $workdir
+ return 1
+ fi
+ fi
+ fi
+
+ local remains=$(gen_tempfile)
+ for file in $(files_in_patch $patch)
+ do
+ diff_file $file $workdir/$file $file >> $remains
+ done
+
+ if [ -s $remains ]
+ then
+ printf $"Patch %s does not remove cleanly (refresh it or enforce with -f)\n" \
+ "$(print_patch $patch)" >&2
+ status=1
+ fi
+ rm -f $remains
+ rm -rf $workdir
+
+ return $status
+}
+
+remove_patch()
+{
+ local patch=$1 status=0
+
+ trap "status=1" SIGINT
+ if [ -z "$opt_force" ] && \
+ ( [ -n "$opt_remove" ] || files_may_have_changed $patch )
+ then
+ check_for_pending_changes $patch || status=1
+ fi
+
+ if [ $status -eq 0 ]
+ then
+ printf $"Removing patch %s\n" "$(print_patch $patch)"
+ rm -f "$QUILT_PC/$patch/.timestamp"
+ @LIB@/backup-files $silent -r -t -B $QUILT_PC/$patch/ -
+ status=$?
+ remove_from_db $patch
+ rm -f $QUILT_PC/$patch~refresh
+ fi
+ trap - SIGINT
+ return $status
+}
+
options=`getopt -o fRqvah -- "$@"`
if [ $? -ne 0 ]
@@ -134,14 +242,8 @@ else
[ -n "$opt_all" ] || number=1
fi
-[ -n "$opt_force" ] &&
- rpatch_options="$rpatch_options -f"
-[ -n "$opt_remove" ] &&
- rpatch_options="$rpatch_options -R"
-[ -n "$opt_quiet" ] &&
- rpatch_options="$rpatch_options -q"
-[ -n "$opt_verbose" ] &&
- rpatch_options="$rpatch_options -v"
+[ -n "$opt_quiet" ] && silent=-s
+[ -z "$opt_verbose" ] && silent_unless_verbose=-s
if [ -n "$stop_at_patch" ]
then
@@ -152,6 +254,14 @@ then
fi
fi
+top=$(top_patch)
+if [ -n "$top" -a -e $QUILT_PC/$top~refresh -a -z "$opt_force" ]
+then
+ printf $"Patch %s needs to be refreshed first.\n" \
+ "$(print_patch $top)" >&2
+ exit 1
+fi
+
if ! patches=$(list_patches) 2>&1
then
exit 1
@@ -161,19 +271,10 @@ then
exit 2
fi
-trap "interrupted=1" SIGINT
-
for patch in $patches
do
- [ -n "$SUBDIR" ] && pushd $SUBDIR > /dev/null
- if ! @SCRIPTS@/rpatch $rpatch_options $patch
- then
- exit 1
- fi
- [ -n "$SUBDIR" ] && popd > /dev/null
- if [ -n "$interrupted" ]
+ if ! remove_patch $patch
then
- printf $"Interrupted by user\n" >&2
exit 1
fi
[ -z "$opt_quiet" ] && echo
diff --git a/quilt/push.in b/quilt/push.in
index 102a702..d4e9ea7 100644
--- a/quilt/push.in
+++ b/quilt/push.in
@@ -53,6 +53,126 @@ be used.
fi
}
+interrupt()
+{
+ rollback_patch $1
+ printf $"Interrupted by user; patch %s was not applied.\n" \
+ "$(print_patch $patch)" >&2
+ exit 1
+}
+
+apply_patch()
+{
+ local patch=$1
+ local patch_file=$(patch_file_name $patch) output
+
+ if ! [ -s $patch_file ]
+ then
+ printf $"Patch %s appears to be empty\n" "$patch_file"
+ return 0
+ fi
+
+ if [ "${patch_file:(-3)}" = ".gz" ]
+ then
+ gzip -cd $patch_file \
+ | @PATCH@ $QUILT_PATCH_OPTS $(patch_args $patch) \
+ --backup --prefix="$QUILT_PC/$patch/" \
+ $no_reject_files \
+ -E $silent $force_apply 2>&1
+ elif [ "${patch_file:(-4)}" = ".bz2" ]
+ then
+ bzip2 -cd $patch_file \
+ | @PATCH@ $QUILT_PATCH_OPTS $(patch_args $patch) \
+ --backup --prefix="$QUILT_PC/$patch/" \
+ $no_reject_files \
+ -E $silent $force_apply 2>&1
+ else
+ @PATCH@ $QUILT_PATCH_OPTS $(patch_args $patch) \
+ --backup --prefix="$QUILT_PC/$patch/" \
+ $no_reject_files \
+ -E $silent $force_apply -i $patch_file 2>&1
+ fi
+}
+
+rollback_patch()
+{
+ local patch=$1
+
+ @LIB@/backup-files $silent_unless_verbose -r -B $QUILT_PC/$patch/ -
+}
+
+add_patch()
+{
+ local patch=$1
+ local file status
+
+ printf $"Applying patch %s\n" "$(print_patch $patch)"
+ trap "interrupt $patch" SIGINT
+
+ no_reject_files=
+ if [ -z "$opt_leave_rejects" ]; then
+ local tmp="$(gen_tempfile)"
+ trap "rm -f $tmp" EXIT
+ no_reject_files="-r $tmp"
+ fi
+
+ output="$(apply_patch $patch)"
+ status=${PIPESTATUS[0]}
+ trap "" SIGINT
+
+ if [ $status -ne 0 -a -z "$opt_leave_rejects" ]
+ then
+ # The reject files are removed in rollback_patch.
+ echo "$output" \
+ | @AWK@ '
+ /^patching file / { filename = substr($0, 15) }
+ { if ('${#silent}' != 0)
+ gsub(/ -- saving rejects to file .*/, "")
+ else
+ gsub(/ -- saving rejects to file .*/,
+ " -- rejects in file " filename)
+ }
+ { print }
+ '
+ elif [ -n "$output" ]
+ then
+ echo "$output"
+ fi
+
+ if [ $status -eq 0 -o -n "$opt_force" ]
+ then
+ add_to_db $patch
+ if [ $status -eq 0 ]
+ then
+ rm -f $QUILT_PC/$patch~refresh
+ else
+ touch $QUILT_PC/$patch~refresh
+ fi
+
+ if [ -e "$QUILT_PC/$patch" ]
+ then
+ touch $QUILT_PC/$patch/.timestamp
+ fi
+
+ if [ "$(shopt -s nullglob ; echo $QUILT_PC/$patch/*)" = "" ]
+ then
+ printf $"Patch %s appears to be empty, applied\n" \
+ "$(print_patch $patch)"
+ elif [ $status -ne 0 ]
+ then
+ printf $"Applied patch %s (forced; needs refresh)\n" \
+ "$(print_patch $patch)"
+ fi
+ else
+ rollback_patch $patch
+ printf $"Patch %s does not apply (enforce with -f)\n" \
+ "$(print_patch $patch)"
+ status=1
+ fi
+ trap - SIGINT
+ return $status
+}
+
list_patches()
{
local top=$(top_patch) n=0 patch
@@ -150,16 +270,10 @@ else
[ -z "$opt_all" ] && number=1
fi
-[ -n "$opt_force" ] &&
- apatch_options="$apatch_options -f"
-[ -n "$opt_quiet" ] &&
- apatch_options="$apatch_options -q"
-[ -n "$opt_verbose" ] &&
- apatch_options="$apatch_options -v"
-[ -n "$opt_leave_rejects" ] &&
- apatch_options="$apatch_options --leave-rejects"
-[ -n "$opt_interactive" ] &&
- apatch_options="$apatch_options --interactive"
+[ -n "$opt_quiet" ] && silent=-s
+[ -z "$opt_verbose" ] && silent_unless_verbose=-s
+[ -z "$opt_interactive" ] && force_apply=-f
+[ -n "$opt_force" ] && opt_leave_rejects=1
if [ -n "$stop_at_patch" ]
then
@@ -171,57 +285,40 @@ then
fi
fi
+top=$(top_patch)
+if [ -n "$top" -a -e $QUILT_PC/$top~refresh ]
+then
+ printf $"The topmost patch %s needs to be refreshed first.\n" \
+ "$(print_patch $top)"
+ exit 1
+fi
+
if ! patches=$(list_patches) 2>&1
then
exit 1
elif [ -z "$patches" ]
then
- top=$(top_patch)
if [ -z "$top" ]
then
printf $"No patches applied\n" >&2
- exit 2
- elif [ -z "$(patch_file_name $top)" ]
- then
- printf \
-$"The topmost patch %s is not in the series file anymore;
-cannot determine the next patch from the series file.
-Please pop -f the top patch and check your series file.\n" "$top" >&2
- exit 1
-
else
printf $"File series fully applied, ends at patch %s\n" \
"$(print_patch $top)" >&2
- exit 2
fi
+ exit 2
fi
-trap "interrupted=1" SIGINT
-
create_db
for patch in $patches
do
- [ -n "$SUBDIR" ] && pushd $SUBDIR > /dev/null
- if ! @SCRIPTS@/apatch $apatch_options $patch
+ if ! add_patch $patch
then
exit 1
fi
- [ -n "$SUBDIR" ] && popd > /dev/null
- if [ -n "$interrupted" ]
- then
- printf $"Interrupted by user\n" >&2
- exit 1
- fi
[ -z "$opt_quiet" ] && echo
done
-patch="$(top_patch)"
-if [ -z "$patch" ]
-then
- printf $"No patches applied\n"
-else
- printf $"Now at patch %s\n" "$(print_patch $patch)"
-fi
+printf $"Now at patch %s\n" "$(print_patch $patch)"
### Local Variables:
### mode: shell-script
### End:
diff --git a/scripts/apatch.in b/scripts/apatch.in
deleted file mode 100755
index 7e58c50..0000000
--- a/scripts/apatch.in
+++ /dev/null
@@ -1,205 +0,0 @@
-#! @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()
-{
- printf $"Usage: $0 [-fqv] patchname\n"
- exit 1
-}
-
-interrupt()
-{
- rollback_patch $1
- printf $"Interrupted by user; patch %s was not applied.\n" \
- "$(print_patch $patch)" >&2
- exit 1
-}
-
-apply_patch()
-{
- local patch=$1
- local patch_file=$(patch_file_name $patch) output
-
- if ! [ -s $patch_file ]
- then
- printf $"Patch %s appears to be empty\n" "$patch_file"
- return 0
- fi
-
- if [ "x${patch_file:(-3)}" = "x.gz" ]
- then
- gzip -cd $patch_file \
- | @PATCH@ $QUILT_PATCH_OPTS $(patch_args $patch) \
- --backup --prefix="$QUILT_PC/$patch/" \
- $no_reject_files \
- -E $silent $force_apply 2>&1
- elif [ "x${patch_file:(-4)}" = "x.bz2" ]
- then
- bzip2 -cd $patch_file \
- | @PATCH@ $QUILT_PATCH_OPTS $(patch_args $patch) \
- --backup --prefix="$QUILT_PC/$patch/" \
- $no_reject_files \
- -E $silent $force_apply 2>&1
- else
- @PATCH@ $QUILT_PATCH_OPTS $(patch_args $patch) \
- --backup --prefix="$QUILT_PC/$patch/" \
- $no_reject_files \
- -E $silent $force_apply -i $patch_file 2>&1
- fi
-}
-
-rollback_patch()
-{
- local patch=$1
-
- @LIB@/backup-files $silent_unless_verbose -r -B $QUILT_PC/$patch/ -
-}
-
-apatch()
-{
- local patch=$1
- local file status
-
- printf $"Applying patch %s\n" "$(print_patch $patch)"
- trap "interrupt $patch" SIGINT
-
- no_reject_files=
- if [ -z "$opt_leave_rejects" ]; then
- local tmp="$(gen_tempfile)"
- trap "rm -f $tmp" EXIT
- no_reject_files="-r $tmp"
- fi
-
- output="$(apply_patch $patch)"
- status=${PIPESTATUS[0]}
-
- trap "" SIGINT
-
- if [ $status -ne 0 -a -z "$opt_leave_rejects" ]
- then
- # The reject files are removed in rollback_patch.
- echo "$output" \
- | @AWK@ '
- /^patching file / { filename = substr($0, 15) }
- { if ('${#silent}' != 0)
- gsub(/ -- saving rejects to file .*/, "")
- else
- gsub(/ -- saving rejects to file .*/, " -- rejects in file " filename)
- }
- { print }
- '
- elif [ -n "$output" ]
- then
- echo "$output"
- fi
-
- if [ $status -eq 0 -o -n "$opt_force" ]
- then
- add_to_db $patch
- if [ $status -eq 0 ]
- then
- rm -f $QUILT_PC/$patch~refresh
- else
- touch $QUILT_PC/$patch~refresh
- fi
-
- if [ -e "$QUILT_PC/$patch" ]
- then
- touch $QUILT_PC/$patch/.timestamp
- fi
-
- if [ "$(shopt -s nullglob ; echo $QUILT_PC/$patch/*)" = "" ]
- then
- printf $"Patch %s appears to be empty, applied\n" \
- "$(print_patch $patch)"
- elif [ $status -ne 0 ]
- then
- printf $"Applied patch %s (forced; needs refresh)\n" \
- "$(print_patch $patch)"
- fi
- else
- rollback_patch $patch
- printf $"Patch %s does not apply (enforce with -f)\n" \
- "$(print_patch $patch)"
- status=1
- fi
- trap - SIGINT
- return $status
-}
-
-options=`getopt -o fqvh --long leave-rejects,interactive -- "$@"`
-
-if [ $? -ne 0 ]
-then
- usage
-fi
-
-eval set -- "$options"
-
-while true
-do
- case "$1" in
- -f)
- opt_force=1
- shift ;;
- -q)
- opt_quiet=1
- shift ;;
- -v)
- opt_verbose=1
- shift ;;
- --leave-rejects)
- opt_leave_rejects=1
- shift ;;
- --interactive)
- opt_interactive=1
- shift ;;
- -h)
- usage -h ;;
- --)
- shift
- break ;;
- esac
-done
-
-if [ $# -ne 1 ]
-then
- usage
-fi
-
-[ -n "$opt_quiet" ] && silent=-s
-[ -z "$opt_verbose" ] && silent_unless_verbose=-s
-[ -z "$opt_interactive" ] && force_apply=-f
-[ -n "$opt_force" ] && opt_leave_rejects=1
-
-patch=$1
-
-top=$(top_patch)
-if [ -n "$top" -a -e $QUILT_PC/$top~refresh ]
-then
- printf $"The topmost patch %s needs to be refreshed first.\n" \
- "$(print_patch $top)"
- exit 1
-fi
-
-apatch $patch
-### Local Variables:
-### mode: shell-script
-### End:
-# vim:filetype=sh
diff --git a/scripts/rpatch.in b/scripts/rpatch.in
deleted file mode 100755
index b33652a..0000000
--- a/scripts/rpatch.in
+++ /dev/null
@@ -1,188 +0,0 @@
-#! @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()
-{
- printf $"Usage: %s [-fRq] patchname\n" "$0"
- exit 1
-}
-
-files_may_have_changed()
-{
- local patch=$1 file
- local patch_file=$(patch_file_name $patch)
-
- if [ $? -ne 0 -o ! -e "$patch_file" \
- -o ! -e "$QUILT_PC/$patch/.timestamp" \
- -o "$QUILT_PC/$patch/.timestamp" -ot "$patch_file" ]
- then
- return 0
- fi
-
- local apply_ts=$(date -r "$QUILT_PC/$patch/.timestamp" '+%s') ts
- for file in $(files_in_patch $patch)
- do
- ts=$(date -r $file '+%s' 2> /dev/null)
- [ -z "$ts" ] && return 0
- [ "$ts" -gt $apply_ts ] && return 0
- done
- return 1
-}
-
-# Check if all changes have been folded back into the patch (quilt refresh),
-# and report any pending changes.
-check_for_pending_changes()
-{
- local patch=$1
- local patch_file=$(patch_file_name $patch)
- local patch_args=$(patch_args $patch)
- local workdir=$(gen_tempfile -d quilt) status=0
-
- if [ -d $QUILT_PC/$patch ]
- then
- if ! rmdir $workdir || # note that this is racey...
- ! cp -rl $QUILT_PC/$patch $workdir/
- then
- printf $"Failed to copy files to temporary directory\n" >&2
- rm -rf $workdir
- return 1
- fi
-
- # Now we may have some zero-size files that have no
- # permissions (which represent files that the patch
- # creates). Those may have been created in the meantime,
- # but patch would refuse to touch them: We must remove
- # them here.
- find $workdir -type f -size 0 -exec rm -f '{}' ';'
-
- fi
-
- if [ -s $patch_file ]
- then
- if ! cat_file $patch_file \
- | @PATCH@ -d $workdir $patch_args \
- --no-backup-if-mismatch -E \
- >/dev/null 2>/dev/null
- then
- if ! [ -e $QUILT_PC/$patch ]
- then
- printf $"Failed to patch temporary files\n" >&2
- rm -rf $workdir
- return 1
- fi
- fi
- fi
-
- local remains=$(gen_tempfile)
- for file in $(files_in_patch $patch)
- do
- diff_file $file $workdir/$file $file >> $remains
- done
-
- if [ -s $remains ]
- then
- printf $"Patch %s does not remove cleanly (refresh it or enforce with -f)\n" \
- "$(print_patch $patch)" >&2
- status=1
- fi
- rm -f $remains
- rm -rf $workdir
-
- return $status
-}
-
-rpatch()
-{
- local patch=$1 status=0
-
- trap "" SIGINT
- if [ -z "$opt_force" ] && \
- ( [ -n "$opt_remove" ] || files_may_have_changed $patch )
- then
- check_for_pending_changes $patch || status=1
- fi
-
- if [ $status -eq 0 ]
- then
- printf $"Removing patch %s\n" "$(print_patch $patch)"
- rm -f "$QUILT_PC/$patch/.timestamp"
- @LIB@/backup-files $silent -r -t -B $QUILT_PC/$patch/ -
- status=$?
- remove_from_db $patch
- rm -f $QUILT_PC/$patch~refresh
- fi
- trap - SIGINT
- return $status
-}
-
-options=`getopt -o fRqvh -- "$@"`
-
-if [ $? -ne 0 ]
-then
- usage
-fi
-
-eval set -- "$options"
-
-while true
-do
- case "$1" in
- -f)
- opt_force=1
- shift ;;
- -R)
- opt_remove=1 # remove properly with patch -R; no tricks
- unset opt_force
- shift ;;
- -q)
- opt_quiet=1
- shift ;;
- -v)
- opt_verbose=1
- shift ;;
- -h)
- usage -h ;;
- --)
- shift
- break ;;
- esac
-done
-
-if [ $# -ne 1 ]
-then
- usage
-fi
-
-patch=$1
-[ -n "$opt_quiet" ] && silent=-s
-[ -z "$opt_verbose" ] && silent_unless_verbose=-s
-
-top=$(top_patch)
-if [ -n "$top" -a -e $QUILT_PC/$top~refresh -a -z "$opt_force" ]
-then
- printf $"Patch %s needs to be refreshed first.\n" \
- "$(print_patch $top)" >&2
- exit 1
-fi
-
-rpatch "$patch" || exit 1
-### Local Variables:
-### mode: shell-script
-### End:
-# vim:filetype=sh
diff --git a/test/example1.test b/test/example1.test
index f209d3d..d50b53e 100644
--- a/test/example1.test
+++ b/test/example1.test
@@ -78,7 +78,7 @@ Or ``quilt edit Oberon.txt''
> Oberon.txt
$ quilt patches Oberon.txt
- > flower.diff
+ > patches/flower.diff
$ quilt pop -f
> Removing patch %{P}flower.diff
> Restoring Oberon.txt