diff options
-rw-r--r-- | Makefile.in | 12 | ||||
-rw-r--r-- | TODO | 66 | ||||
-rw-r--r-- | bin/quilt.in | 5 | ||||
-rw-r--r-- | configure.ac | 24 | ||||
-rw-r--r-- | doc/README.MAIL | 56 | ||||
-rw-r--r-- | po/de.po | 38 | ||||
-rw-r--r-- | po/fr.po | 36 | ||||
-rw-r--r-- | po/ja.po | 38 | ||||
-rw-r--r-- | po/quilt.pot | 37 | ||||
-rw-r--r-- | quilt.changes | 9 | ||||
-rw-r--r-- | quilt.quiltrc | 37 | ||||
-rw-r--r-- | quilt/mail.in | 278 | ||||
-rw-r--r-- | quilt/push.in | 1 | ||||
-rw-r--r-- | scripts/edmail.in | 151 | ||||
-rw-r--r-- | scripts/patchfns.in | 61 |
15 files changed, 744 insertions, 105 deletions
diff --git a/Makefile.in b/Makefile.in index fe38539..297b393 100644 --- a/Makefile.in +++ b/Makefile.in @@ -28,6 +28,7 @@ MKTEMP := @MKTEMP@ MSGFMT := @MSGFMT@ DIFFSTAT := @DIFFSTAT@ RPMBUILD := @RPMBUILD@ +MTA := @MTA@ ifeq "$(MSGFMT)" "" MAKE_NLS := @true @@ -56,7 +57,7 @@ SRC += $(BIN_SRC:%=bin/%) DIRT += $(BIN_IN:%=bin/%) QUILT_IN := add applied delete diff edit files fold fork graph grep \ - import new next patches pop previous push refresh remove \ + import mail new next patches pop previous push refresh remove \ series setup snapshot top unapplied upgrade QUILT_SRC := $(QUILT_IN:%=%.in) @@ -64,7 +65,7 @@ QUILT := $(QUILT_IN) SRC += $(QUILT_SRC:%=quilt/%) DIRT += $(QUILT_IN:%=quilt/%) -SCRIPTS_IN := patchfns parse-patch inspect dependency-graph +SCRIPTS_IN := patchfns parse-patch inspect dependency-graph edmail SCRIPTS_SRC := $(SCRIPTS_IN:%=%.in) SCRIPTS := $(SCRIPTS_IN) SRC += $(SCRIPTS_SRC:%=scripts/%) @@ -80,7 +81,8 @@ DOC_SRC := $(DOC_IN:%=doc/%.in) DOC := $(DOC_IN) SRC += $(DOC_SRC) SRC += doc/main.tex doc/quilt.pdf doc/Makefile \ - doc/sample.quiltrc doc/quilt.1.in + doc/sample.quiltrc doc/quilt.1.in \ + doc/README.MAIL DIRT += $(DOC_IN:%=doc/%) doc/quilt.1 MAN1 := bin/guards.1 doc/quilt.1 @@ -213,7 +215,9 @@ $(PACKAGE).spec : $(PACKAGE).spec.in $(PACKAGE).changes Makefile \ -e 's:@RELEASE''@:$(RELEASE):g' \ -e 's:@RPMBUILD''@:$(RPMBUILD):g' \ -e 's:@DIFFSTAT''@:$(DIFFSTAT):g' \ + -e 's:@MTA''@:$(MTA):g' \ -e 's:@LOCALEDIR''@:$(localedir):g' \ + -e 's:@DOCSUBDIR''@:$(docdir)/$(PACKAGE)-$(VERSION):g' \ $< > $@ @chmod --reference=$< $@ @@ -240,7 +244,7 @@ install : scripts @INSTALL@ -d $(BUILD_ROOT)$(docdir)/$(PACKAGE)-$(VERSION)/ @INSTALL@ -m 644 doc/README \ $(BUILD_ROOT)$(docdir)/$(PACKAGE)-$(VERSION)/ - @INSTALL@ -m 644 doc/quilt.pdf \ + @INSTALL@ -m 644 doc/quilt.pdf doc/README.MAIL \ $(BUILD_ROOT)$(docdir)/$(PACKAGE)-$(VERSION)/ @INSTALL@ -d $(BUILD_ROOT)$(mandir)/man1 @@ -1,5 +1,3 @@ --> Describe how to work with hard-linked trees - General: - Abstract backup operations to/from the .pc/ directory, so that @@ -17,15 +15,53 @@ General: - Support different diff/patch options for different patches. (By specifying them in the series file?) + - Syntax coloring: Allow to change the colors (for reverse video, + ...) + + - Add command that generates a summary (patch names + descriptions). + + - Add command to extract a header. + + - Add more long-form options, and add some nagative options so that + defaults from .quiltrc can easily be overruled. + Documentation: - - How to import a complete directory, before doing - wild changes? + - How to import a complete directory before doing wild changes? + + - Describe how to work with hard-linked trees + + - /etc/quilt.quiltrc and ~/.quiltrc + + - diff/refresh: C -c -N -n options + + - Subdirectory support + +quilt push: + + - Add option to print the reject to stdout + + - Syntax color patch output (fuzz and rejects) + +quilt pop: + + - The timestamp comparison logic is broken; need to track + last-known timestamps per file. + +quilt diff: + + - Error message when a file is specified that isn't in the + patch(es). quilt refresh: - Add an -m option similar to `cvs commit -m "..."' to simplify keeping a change log in the patch documentation? + + - Add option to log the updates of each patch (e.g., append the + output of ``quilt diff -zR'' to patch.log on each update). + + - Remove existing diffstat if --diffstat is not specified? quilt import: @@ -41,20 +77,16 @@ quilt setup: - Also recognize other uses of tar and patch (with options in the command line), etc. -rpatch: - - - If not removing the topmost patch, add checks if any files are - hidden by later patches. If so, refuse to remove patch! (Note - that pop takes care of that currently.) - -apatch: - - - Allow to add a patch in the middle of the applied series, and - inject the patch in its proper position in applied-patches. - Needs to check if any of the files in the patch are touched by - later patches. - quit edit: - Check for actual changes, and remove files again that haven't been changed. + +quilt mail: + + - Improve recipient handling (quote special characters automatically; + encode 8-bit characters). + + - Character set handling is missing, too. + + - Too many passes of edmail make it a bit slow. diff --git a/bin/quilt.in b/bin/quilt.in index c88a648..df7a430 100644 --- a/bin/quilt.in +++ b/bin/quilt.in @@ -34,8 +34,9 @@ Common options to all commands: Runs the command in bash trace mode (-x). For internal debugging. --quiltrc file - Use the specified configuration file instead of ~/.quiltrc. - See pdf documentation for details about its possible content." + Use the specified configuration file instead of ~/.quiltrc (or + /etc/quilt.quiltrc if ~/.quiltrc is missing). See the pdf + documentation for details about its possible content." exit 1 } diff --git a/configure.ac b/configure.ac index 91e1b8e..36862e4 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.37],[quilt-dev@nongnu.org]) +AC_INIT([quilt],[0.38],[quilt-dev@nongnu.org]) AC_CONFIG_AUX_DIR(config) AC_PREREQ(2.53) -AC_REVISION ($Revision: 1.32 $) +AC_REVISION ($Revision: 1.33 $) PACKAGE_RELEASE=1 AC_SUBST(PACKAGE_RELEASE) @@ -202,6 +202,26 @@ using the '--with-diffstat' option. DIFFSTAT="diffstat" fi +dnl Check for sendmail +AC_ARG_WITH(mta, AC_HELP_STRING( + [--with-mta], [mail transfer agent to use]), + [ + MTA="$withval" + AC_SUBST(MTA) + AC_MSG_NOTICE([Using mail transfer executable $MTA]) + ],[ + AC_PATH_PROG(MTA, sendmail, [], [$PATH:/usr/sbin]) + ]) +if test -z "$MTA"; then + AC_MSG_WARN([ +Mail transfer executable not found; the --send option of the mail command +will not work correctly. If you have a mail transfer agent in a directory +that is not in the search path you can specify its location using the +'--with-mta' option. +]) + MTA="sendmail" +fi + dnl Check for NLS AC_ARG_ENABLE(nls, AC_HELP_STRING( [--enable-nls], [include natural language support])) diff --git a/doc/README.MAIL b/doc/README.MAIL new file mode 100644 index 0000000..08df3fd --- /dev/null +++ b/doc/README.MAIL @@ -0,0 +1,56 @@ +QUILT MAIL COMMAND +================== + +The mail command starts up the system editor ($EDITOR, or vi if $EDITOR +is undefined) with an template in Internet Message Format (RFC 2822). +This template is used to generate an introduction, as well as one +message for each patch in the series file. The template is used as +follows: The headers are used in each message generated, and modified as +required. The template body is used only for the introduction. + +In the template, the headers can be modified, additional headers added, +and unneeeded headers can be removed. The template header also contains +a special Subject-Prefix header which defines a prefix to prefix each +subject header with. The @num@ and @total@ macros in the Subject-Prefix +header are replaced with the patch number and the total number of +patches, respectively. The patch number @num@ is zero-padded to the +same width that @total@ has. + +Each message is assigned a unique Message-Id header, and all messages +other than the introduction are made to refer to the introduction (using +a References header) for proper message threading in mail clients. +Patch filenames are stored in Content-Disposition headers so that mail +clients know the original filename. The message timestamps in Date +headers in each message is incremented one second per message starting +from the timestamp of the introduction. + +If a ~/.signature file exists, this file is appended to each message +generated. + +Recipients and headers can be added, and existing headers can be +replaced, individually in each message based on the headers in the +introduction. Quilt does not enforce a specific patch file format. +Instead, to customize the messages generated, a filter function called +quilt_mail_patch_filter may be defined in .quiltrc, or +/etc/quilt.quiltrc if no ~/.quiltrc exists. This function is passed the +patch name as argument (without the $QUILT_PATCHES prefix). It shall +read the patch from standard input, and write a RFC 2822 message header +and the patch to standard output. Headers of the form ``Recipient-$X: +...'' denote recipients to be added to the $X header (for example, +``Recipient-Cc: agruen@suse.de''). Headers of the form ``Replace-$X: +...'' specify that header $X is to be replaced by this header (for +eaxmple, ``Replace-Subject: Patch description''). All other headers +are appended to the existing headers. + +A quilt_mail_patch_filter example is found in the example quilt.quiltrc. + +Each recipient will occur in the resulting message only once. Duplicates +are filtered out. This happens as the headers are read, so the relative +order of the To, Cc, and Bcc headers should not be changed. + +Recipients are checked for RFC 2822 conformance (at least that is the +intention; actually the checks are not perfect). This means that special +characters must be quoted, and 8-bit characters must be encoded. In +practice it probably makes little sense to use anything fancy right now; +this area still needs some work. Character set recognition and proper +qualifying is also still missing. @@ -11,15 +11,16 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../bin/quilt.in:20 +#: ../bin/quilt.in:23 msgid "Usage: quilt [--trace[=verbose]] [--quiltrc=XX] command [-h] ..." msgstr "Verwendung: quilt [--trace[=verbose]] [--quiltrc=XX] befehl [-h] ..." -#: ../bin/quilt.in:22 +#: ../bin/quilt.in:25 msgid "Commands are:" msgstr "Vorhandene Befehle:" -#: ../bin/quilt.in:27 +#: ../bin/quilt.in:30 +#, fuzzy msgid "" "\n" "Common options to all commands:\n" @@ -28,8 +29,9 @@ msgid "" "\tRuns the command in bash trace mode (-x). For internal debugging.\n" "\n" "--quiltrc file\n" -"\tUse the specified configuration file instead of ~/.quiltrc. \n" -"\tSee pdf documentation for details about its possible content." +"\tUse the specified configuration file instead of ~/.quiltrc (or\n" +"\t/etc/quilt.quiltrc if ~/.quiltrc is missing). See the pdf\n" +"\tdocumentation for details about its possible content." msgstr "" "\n" "Gemeinsame Optionen für alle Befehle:\n" @@ -66,7 +68,7 @@ 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:237 ../quilt/previous.in:62 ../quilt/push.in:265 +#: ../quilt/pop.in:237 ../quilt/previous.in:62 ../quilt/push.in:272 #: ../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" @@ -78,7 +80,7 @@ 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:286 ../quilt/push.in:303 ../quilt/refresh.in:143 +#: ../quilt/pop.in:286 ../quilt/push.in:310 ../quilt/refresh.in:143 #: ../quilt/remove.in:81 msgid "No patches applied\\n" msgstr "Keine Patches angewandt\\n" @@ -575,7 +577,7 @@ msgstr "Patch %s muss zuerst aufgefrischt werden (Refresh).\\n" msgid "No patch removed\\n" msgstr "Kein Patch entfernt\\n" -#: ../quilt/pop.in:293 ../quilt/push.in:321 +#: ../quilt/pop.in:293 ../quilt/push.in:328 msgid "Now at patch %s\\n" msgstr "Jetzt in Patch %s\\n" @@ -655,35 +657,35 @@ msgstr "Unterbrechung durch Benutzer; Patch %s wurde nicht angewandt.\\n" msgid "Patch %s appears to be empty\\n" msgstr "Patch %s scheint leer zu sein\\n" -#: ../quilt/push.in:109 +#: ../quilt/push.in:135 msgid "Applying patch %s\\n" msgstr "Wende Patch %s an\\n" -#: ../quilt/push.in:159 +#: ../quilt/push.in:166 msgid "Patch %s appears to be empty, applied\\n" msgstr "Patch %s scheint leer zu sein, angewandt\\n" -#: ../quilt/push.in:163 +#: ../quilt/push.in:170 msgid "Applied patch %s (forced; needs refresh)\\n" msgstr "Patch %s angewandt (erzwungen, muß aufgefrischt werden (Refresh))\\n" -#: ../quilt/push.in:168 +#: ../quilt/push.in:175 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 +#: ../quilt/push.in:214 msgid "Patch %s not found in file series\\n" msgstr "Patch %s nicht in series-Datei gefunden\\n" -#: ../quilt/push.in:282 +#: ../quilt/push.in:289 msgid "Patch %s is already applied\\n" msgstr "Patch %s ist bereits angewandt\\n" -#: ../quilt/push.in:291 +#: ../quilt/push.in:298 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:305 +#: ../quilt/push.in:312 msgid "File series fully applied, ends at patch %s\\n" msgstr "series-Datei vollständig angewandt, endet in Patch %s\\n" @@ -982,7 +984,7 @@ msgstr "" "zur Erzeugung des Arbeitsverzeichnis verwendet wurden, oder entfernen Sie " "das Verzeichnis %s, und wenden Sie die Patches neu an.\\n" -#: ../scripts/patchfns.in:703 +#: ../scripts/patchfns.in:750 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 " @@ -995,7 +997,7 @@ msgstr "" "quilt alle Patches mit der Version von quilt, die zur Erstellung des " "Arbeitsverzeichnisses verwendet wurde.\\n" -#: ../scripts/patchfns.in:770 +#: ../scripts/patchfns.in:817 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" @@ -12,15 +12,16 @@ msgstr "" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" -#: ../bin/quilt.in:20 +#: ../bin/quilt.in:23 msgid "Usage: quilt [--trace[=verbose]] [--quiltrc=XX] command [-h] ..." msgstr "Usage : quilt [--trace[=verbose]] [--quiltrc=XX] commande [-h] ..." -#: ../bin/quilt.in:22 +#: ../bin/quilt.in:25 msgid "Commands are:" msgstr "Les commandes sont :" -#: ../bin/quilt.in:27 +#: ../bin/quilt.in:30 +#, fuzzy msgid "" "\n" "Common options to all commands:\n" @@ -29,8 +30,9 @@ msgid "" "\tRuns the command in bash trace mode (-x). For internal debugging.\n" "\n" "--quiltrc file\n" -"\tUse the specified configuration file instead of ~/.quiltrc. \n" -"\tSee pdf documentation for details about its possible content." +"\tUse the specified configuration file instead of ~/.quiltrc (or\n" +"\t/etc/quilt.quiltrc if ~/.quiltrc is missing). See the pdf\n" +"\tdocumentation for details about its possible content." msgstr "" "\n" "Options communes toutes les commandes :\n" @@ -68,7 +70,7 @@ 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:237 ../quilt/previous.in:62 ../quilt/push.in:273 +#: ../quilt/pop.in:237 ../quilt/previous.in:62 ../quilt/push.in:272 #: ../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" @@ -80,7 +82,7 @@ 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:286 ../quilt/push.in:311 ../quilt/refresh.in:143 +#: ../quilt/pop.in:286 ../quilt/push.in:310 ../quilt/refresh.in:143 #: ../quilt/remove.in:81 msgid "No patches applied\\n" msgstr "Aucun patch n'est appliqu\\n" @@ -589,7 +591,7 @@ msgstr "Le patch %s doit tre rafraichi au pralable.\\n" msgid "No patch removed\\n" msgstr "Aucun patch retir\\n" -#: ../quilt/pop.in:293 ../quilt/push.in:329 +#: ../quilt/pop.in:293 ../quilt/push.in:328 msgid "Now at patch %s\\n" msgstr "Le patch %s est maintenant au sommet\\n" @@ -679,32 +681,32 @@ msgstr "Le patch %s semble vide.\\n" msgid "Applying patch %s\\n" msgstr "Application de %s\\n" -#: ../quilt/push.in:167 +#: ../quilt/push.in:166 msgid "Patch %s appears to be empty, applied\\n" msgstr "Le patch %s semble vide. Il a t appliqu.\\n" -#: ../quilt/push.in:171 +#: ../quilt/push.in:170 msgid "Applied patch %s (forced; needs refresh)\\n" msgstr "%s a t appliqu (forc ; vous devriez le rafrachir)\\n" -#: ../quilt/push.in:176 +#: ../quilt/push.in:175 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:215 +#: ../quilt/push.in:214 msgid "Patch %s not found in file series\\n" msgstr "Le patch %s est introuvable dans le fichier de srie\\n" -#: ../quilt/push.in:290 +#: ../quilt/push.in:289 msgid "Patch %s is already applied\\n" msgstr "Le patch %s est dj appliqu.\\n" -#: ../quilt/push.in:299 +#: ../quilt/push.in:298 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:313 +#: ../quilt/push.in:312 msgid "File series fully applied, ends at patch %s\\n" msgstr "La srie est compltement applique. Le dernier patch est %s.\\n" @@ -1003,7 +1005,7 @@ msgstr "" "version utilise pour crer cet arbre de travail, ou effacez le rpertoire\n" "%s et rappliquez compltement vos patchs.\\n" -#: ../scripts/patchfns.in:703 +#: ../scripts/patchfns.in:750 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 " @@ -1015,7 +1017,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:770 +#: ../scripts/patchfns.in:817 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" @@ -12,15 +12,16 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../bin/quilt.in:20 +#: ../bin/quilt.in:23 msgid "Usage: quilt [--trace[=verbose]] [--quiltrc=XX] command [-h] ..." msgstr "使い方: quilt [--trace[=verbose]] [--quiltrc=XX] command [-h] ..." -#: ../bin/quilt.in:22 +#: ../bin/quilt.in:25 msgid "Commands are:" msgstr "コマンド一覧:" -#: ../bin/quilt.in:27 +#: ../bin/quilt.in:30 +#, fuzzy msgid "" "\n" "Common options to all commands:\n" @@ -29,8 +30,9 @@ msgid "" "\tRuns the command in bash trace mode (-x). For internal debugging.\n" "\n" "--quiltrc file\n" -"\tUse the specified configuration file instead of ~/.quiltrc. \n" -"\tSee pdf documentation for details about its possible content." +"\tUse the specified configuration file instead of ~/.quiltrc (or\n" +"\t/etc/quilt.quiltrc if ~/.quiltrc is missing). See the pdf\n" +"\tdocumentation for details about its possible content." msgstr "" "\n" "全コマンド共通オプション:\n" @@ -66,7 +68,7 @@ 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:237 ../quilt/previous.in:62 ../quilt/push.in:265 +#: ../quilt/pop.in:237 ../quilt/previous.in:62 ../quilt/push.in:272 #: ../quilt/refresh.in:129 ../quilt/remove.in:53 ../quilt/unapplied.in:62 msgid "Patch %s is not in series\\n" msgstr "パッチ %s は seriesの中にありません\\n" @@ -78,7 +80,7 @@ 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:286 ../quilt/push.in:303 ../quilt/refresh.in:143 +#: ../quilt/pop.in:286 ../quilt/push.in:310 ../quilt/refresh.in:143 #: ../quilt/remove.in:81 msgid "No patches applied\\n" msgstr "適用されているパッチはありません\\n" @@ -566,7 +568,7 @@ msgstr "最初に、パッチ %s のリフレッシュが必要です。\\n" msgid "No patch removed\\n" msgstr "適用されているパッチはありません\\n" -#: ../quilt/pop.in:293 ../quilt/push.in:321 +#: ../quilt/pop.in:293 ../quilt/push.in:328 msgid "Now at patch %s\\n" msgstr "現在位置はパッチ %s です" @@ -643,36 +645,36 @@ msgstr "ユーザによって中断されました。パッチ % は適用され msgid "Patch %s appears to be empty\\n" msgstr "パッチ %sは、空のようです\\n" -#: ../quilt/push.in:109 +#: ../quilt/push.in:135 msgid "Applying patch %s\\n" msgstr "パッチ %s を適用しています\\n" -#: ../quilt/push.in:159 +#: ../quilt/push.in:166 msgid "Patch %s appears to be empty, applied\\n" msgstr "パッチ %s は、空のようですが、適用しました\\n" -#: ../quilt/push.in:163 +#: ../quilt/push.in:170 msgid "Applied patch %s (forced; needs refresh)\\n" msgstr "" "パッチ % を適用しました (強制適用したために、リフレッシュが必要です)\\n" -#: ../quilt/push.in:168 +#: ../quilt/push.in:175 msgid "Patch %s does not apply (enforce with -f)\\n" msgstr "パッチ %sが適用できません (強制適用する場合は -fを付けてください)\\n" -#: ../quilt/push.in:207 +#: ../quilt/push.in:214 msgid "Patch %s not found in file series\\n" msgstr "パッチ %s が seriesファイル内で見つかりません。\\n" -#: ../quilt/push.in:282 +#: ../quilt/push.in:289 msgid "Patch %s is already applied\\n" msgstr "パッチ %s は、すでに適用済です\\n" -#: ../quilt/push.in:291 +#: ../quilt/push.in:298 msgid "The topmost patch %s needs to be refreshed first.\\n" msgstr "最上位パッチのリフレッシュが最初に必要です。\\n" -#: ../quilt/push.in:305 +#: ../quilt/push.in:312 msgid "File series fully applied, ends at patch %s\\n" msgstr "" "seriesファイルのパッチはすべて適用されています。\n" @@ -967,7 +969,7 @@ msgstr "" "pop -a'を実行し、すべてのパッチをはずしてください。または、%s ディレク\n" "トリを削除し、最初からパッチをあて直してください。\\n" -#: ../scripts/patchfns.in:703 +#: ../scripts/patchfns.in:750 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 " @@ -979,7 +981,7 @@ msgstr "" "ていません。ダウングレードする前に、pushしたバージョンの quiltを使って、\n" "すべてのパッチを pop してください。\\n" -#: ../scripts/patchfns.in:770 +#: ../scripts/patchfns.in:817 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" diff --git a/po/quilt.pot b/po/quilt.pot index f2e0a53..3e586df 100644 --- a/po/quilt.pot +++ b/po/quilt.pot @@ -1,12 +1,12 @@ -#: ../bin/quilt.in:20 +#: ../bin/quilt.in:23 msgid "Usage: quilt [--trace[=verbose]] [--quiltrc=XX] command [-h] ..." msgstr "" -#: ../bin/quilt.in:22 +#: ../bin/quilt.in:25 msgid "Commands are:" msgstr "" -#: ../bin/quilt.in:27 +#: ../bin/quilt.in:30 msgid "" "\n" "Common options to all commands:\n" @@ -15,8 +15,9 @@ msgid "" "\tRuns the command in bash trace mode (-x). For internal debugging.\n" "\n" "--quiltrc file\n" -"\tUse the specified configuration file instead of ~/.quiltrc. \n" -"\tSee pdf documentation for details about its possible content." +"\tUse the specified configuration file instead of ~/.quiltrc (or\n" +"\t/etc/quilt.quiltrc if ~/.quiltrc is missing). See the pdf\n" +"\tdocumentation for details about its possible content." msgstr "" #: ../quilt/add.in:22 @@ -36,7 +37,7 @@ 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:237 ../quilt/previous.in:62 ../quilt/push.in:265 +#: ../quilt/pop.in:237 ../quilt/previous.in:62 ../quilt/push.in:272 #: ../quilt/refresh.in:129 ../quilt/remove.in:53 ../quilt/unapplied.in:62 msgid "Patch %s is not in series\\n" msgstr "" @@ -48,7 +49,7 @@ 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:286 ../quilt/push.in:303 ../quilt/refresh.in:143 +#: ../quilt/pop.in:286 ../quilt/push.in:310 ../quilt/refresh.in:143 #: ../quilt/remove.in:81 msgid "No patches applied\\n" msgstr "" @@ -417,7 +418,7 @@ msgstr "" msgid "No patch removed\\n" msgstr "" -#: ../quilt/pop.in:293 ../quilt/push.in:321 +#: ../quilt/pop.in:293 ../quilt/push.in:328 msgid "Now at patch %s\\n" msgstr "" @@ -472,35 +473,35 @@ msgstr "" msgid "Patch %s appears to be empty\\n" msgstr "" -#: ../quilt/push.in:109 +#: ../quilt/push.in:135 msgid "Applying patch %s\\n" msgstr "" -#: ../quilt/push.in:159 +#: ../quilt/push.in:166 msgid "Patch %s appears to be empty, applied\\n" msgstr "" -#: ../quilt/push.in:163 +#: ../quilt/push.in:170 msgid "Applied patch %s (forced; needs refresh)\\n" msgstr "" -#: ../quilt/push.in:168 +#: ../quilt/push.in:175 msgid "Patch %s does not apply (enforce with -f)\\n" msgstr "" -#: ../quilt/push.in:207 +#: ../quilt/push.in:214 msgid "Patch %s not found in file series\\n" msgstr "" -#: ../quilt/push.in:282 +#: ../quilt/push.in:289 msgid "Patch %s is already applied\\n" msgstr "" -#: ../quilt/push.in:291 +#: ../quilt/push.in:298 msgid "The topmost patch %s needs to be refreshed first.\\n" msgstr "" -#: ../quilt/push.in:305 +#: ../quilt/push.in:312 msgid "File series fully applied, ends at patch %s\\n" msgstr "" @@ -712,7 +713,7 @@ msgid "" "patches from scratch.\\n" msgstr "" -#: ../scripts/patchfns.in:703 +#: ../scripts/patchfns.in:750 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 " @@ -720,7 +721,7 @@ msgid "" "downgrading.\\n" msgstr "" -#: ../scripts/patchfns.in:770 +#: ../scripts/patchfns.in:817 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" diff --git a/quilt.changes b/quilt.changes index 198c2c8..c0fb776 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Sun Jan 23 05:03:08 CET 2005 - agruen@suse.de + +- Add mail command, doc/README.MAIL and example ``mail'' command + filter in quilt.quiltrc. +- Bump version to 0.38. + +------------------------------------------------------------------- Fri Jan 21 13:49:30 CET 2005 - agruen@suse.de - Add a missing find_patch call in the files command. @@ -63,7 +70,7 @@ Wed Sep 22 14:24:45 CEST 2004 - agruen@suse.de - Push command: Without -f or --leave-rejects, when applying a patch failed, the *.rej files were not removed properly. Change the code so that they won't be created in the working tree in - the first place this case. + the first place in this case. - test/run script: Oops, the previous commit was not the latest version. - Fix the version check in bash_completion for bash 3. diff --git a/quilt.quiltrc b/quilt.quiltrc index 6a1318b..a2d2ede 100644 --- a/quilt.quiltrc +++ b/quilt.quiltrc @@ -11,3 +11,40 @@ QUILT_REFRESH_ARGS="--no-timestamps --backup" # Prefix all patch names with the relative path to the patch? QUILT_PATCHES_PREFIX=yes + +# The following ``mail'' command filter recognizes the format we use for +# kernel patches inside SUSE. The format is as follows (slightly +# simplified; Signed-off-by and Acked-by lines optional): +# +# From: author@some.where +# Subject: One-line summary +# +# Patch description +# +# Signed-off-by: reviewer@some.where +# Acked-by: reviewer@some.where +# +# <<patch>> +# +# To enable, remove or comment out the lines above and below the function. + +: <<'EOF' +quilt_mail_patch_filter() { + local x=$(cat) + # Replace subject with patch summary, add anybody in To or Cc + # headers as recipients, and take all people in Signed-off-by + # and Acked-by into the Cc (excluding myself). + echo "$x" \ + | sed -n -e "/${LOGNAME:-$(whoami)}@$(hostname -d)/d" \ + -e 's/^\(To\|Cc\):/Recipient-\1:/ip' \ + -e 's/^\(Signed-off-by\|Acked-by\):/Recipient-Cc:/ip' \ + -e 's/^Subject:/Replace-Subject:/p' \ + -e '/^\*\*\*\|---/q' + echo + # Discard the patch header, and pass on the rest + echo "$x" | awk ' + !in_body && (/^[-A-Za-z]+:/ || /^$/) { next } + { in_body = 1 ; print } + ' +} +EOF diff --git a/quilt/mail.in b/quilt/mail.in new file mode 100644 index 0000000..88d5ce7 --- /dev/null +++ b/quilt/mail.in @@ -0,0 +1,278 @@ +#! @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} + +# 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 + +options=`getopt -o o:h --long from:,to:,cc:,bcc:,subject:,send,mbox -- "$@"` +usage() +{ + printf $"Usage: quilt mail {--mbox file|--send} [--from ...] [--to ...] [--cc ...] [--bcc ...] [--subject ...]\n" + if [ x$1 = x-h ] + then + printf $" +Create mail messages from all patches in the series file, and either store +them in a mailbox file, or send them immediately. The editor is opened +with a template for the introductory message. Please see the file +@DOCSUBDIR@/README.MAIL for details. + +--mbox file + Store all messages in the specified file in mbox format. The mbox + can later be sent using formail, for example. + +--send + Send the messages directly using @MTA@. + +--from, --subject + The values for the From and Subject headers to use. + +--to, --cc, --bcc + Append a recipient to the To, Cc, or Bcc header. +" + exit 0 + else + exit 1 + fi +} + +msgid() +{ + local timestamp=$(date --utc "+%Y%m%d%H%M%S.%N") + echo "$timestamp@$(hostname -f)" +} + +process_mail() +{ + local tmpfile=$(gen_tempfile) + + cat > $tmpfile + set -- $(@SCRIPTS@/edmail --charset $opt_charset \ + --extract-recipients To \ + --extract-recipients Cc \ + --extract-recipients Bcc \ + < $tmpfile) + if [ -n "$opt_send" ]; then + echo @MTA@ "$@" + @SCRIPTS@/edmail --charset $opt_charset \ + --remove-header Bcc "$@" < $tmpfile \ + | @MTA@ "$@" + else + local from_date=$(date "+%a %b %e %H:%M:%S %Y") + echo "From ${LOGNAME:-$(whoami)}@$(hostname -f) $from_date" + @SED@ -e 's/^From />From /' $tmpfile + echo + fi + rm -f $tmpfile +} + +options=`getopt -o h --long from:,to:,cc:,bcc:,subject: \ + --long send,mbox:,charset: -- "$@"` + +if [ $? -ne 0 ] +then + usage +fi + +eval set -- "$options" + +while true +do + case "$1" in + --from) + opt_from=$2 + shift 2 ;; + --to) + opt_to[${#opt_to[@]}]=$2 + shift 2 ;; + --cc) + opt_cc[${#opt_cc[@]}]=$2 + shift 2 ;; + --bcc) + opt_bcc[${#opt_bcc[@]}]=$2 + shift 2 ;; + --subject) + opt_subject=$2 + shift 2 ;; + --send) + opt_send=1 + shift ;; + --mbox) + opt_mbox=$2 + shift 2 ;; + --charset) + opt_charset=$2 + shift 2 ;; + -h) + usage -h ;; + --) + shift + break ;; + esac +done + +if [ $# -gt 0 -o \( -z "$opt_send" -a -z "$opt_mbox" \) ] +then + usage +fi +if [ -z "$opt_charset" ]; then + case "${LC_ALL:-$LANG}" in + *.UTF-8) + opt_charset=UTF-8 + ;; + *) + opt_charset=ISO-8859-15 + ;; + esac +fi + +if [ "$(type -t quilt_mail_patch_filter 2> /dev/null)" != function ]; then + quilt_mail_patch_filter() { + echo # We don't have a mail header + cat + # We could quote everything that looks like a mail + # header instead: + #@SED@ -e $'s/^[\41-\176]\\+:/>&/' + } +fi + +introduction=$(gen_tempfile) +( + cat <<-EOF + Message-Id: <$(msgid)> + Date: $(date --rfc-822) + From: $opt_from + To: $(IFS=,; echo "${opt_to[*]}") + Cc: $(IFS=,; echo "${opt_cc[*]}") + Bcc: $(IFS=,; echo "${opt_bcc[*]}") + Subject-Prefix: [patch @num@/@total@] + Subject: + + -- + EOF + [ -r $HOME/.signature ] && cat $HOME/.signature +) | @SCRIPTS@/edmail --charset $opt_charset > $introduction + +$EDITOR $introduction || exit 1 + +set -- $(cat_series) +total=$# + +if [ -n "$opt_mbox" ]; then + exec 1> $opt_mbox +fi + +subject_prefix=$(@SED@ -ne $'s/^Subject-Prefix:[ \t]*//p' $introduction) +[ -n "$subject_prefix" ] && subject_prefix="$subject_prefix " + +subject_prefix=${subject_prefix//\'/\'\'} +subject_prefix=${subject_prefix//\//\\\/} +p=${subject_prefix//@num@/$(printf %0*d ${#total} 0)} +p=${p//@total@/$total} +@SED@ -e $'s/^\\(Subject:[ \t]\\)/\\1'"$p"'/' \ + -e '/^Subject-Prefix:/d' \ +$introduction \ +| @SCRIPTS@/edmail --charset $opt_charset \ + --remove-empty-headers To Cc Bcc \ +| process_mail + +if [ -n "$opt_mbox" ]; then + exec 1>> $opt_mbox +fi + +# Remember the timestamp of the last message sent. For each message, +# increment the timestamp by one second and wait with sending until +# that time has arrived. This allows MUAs to show the messages in the +# correct order. +last_ts=$(date '+%s' -d "$(@SED@ -ne $'s/^Date:[ \t]*//p' $introduction)") + +num=1 +body=$(gen_tempfile) +for patch in "$@"; do + #echo -n '.' >&2 + # Timestamps that are a few seconds in the future don't hurt usually + #while [ $(date '+%s') -le $last_ts ]; do + # sleep 1 + #done + ((last_ts++)) + new_date="$(date --rfc-822 -d "1970/01/01 UTC + $last_ts seconds")" + + cat_file $(patch_file_name $patch) \ + | quilt_mail_patch_filter $patch > $body + modify="$(@AWK@ ' + sub(/^Recipient-/, "") { r = gensub(/:.*/, "", "g") + s = gensub(/^[^:]*:[ \t]*/, "", "g") + gsub(/'\''/, "'\'\''", s) + print "--add-recipient " r "='\''" s "'\''" + } + sub(/^Replace-/, "") { r = gensub(/:.*/, "", "g") + s = gensub(/^[^:]*:[ \t]*/, "", "g") + gsub(/'\''/, "'\'\''", s) + print "--replace-header " r "='\''" s "'\''" + } + ' $body)" + p=${subject_prefix//@num@/$(printf %0*d ${#total} $num)} + p=${p//@total@/$total} + ( echo "Message-Id: <$(msgid)>" + @SED@ -e 's/^Message-Id:/References:/' \ + -e '/^$/Q' \ + $introduction + echo "Content-Disposition: inline; filename=$patch" + @SED@ -e '/^Recipient-.*:/d' \ + -e '/^Replace-.*:/d' \ + -e '/^$/Q' $body + @AWK@ ' + /^$/ { in_body = 1 } + in_body { print } + ' $body + echo -e '\n--' + [ -r $HOME/.signature ] && cat $HOME/.signature + ) | eval @SCRIPTS@/edmail --charset $opt_charset \ + --replace-header Date="\"$new_date\"" \ + To Cc Bcc \ + $modify \ + | @SED@ -e $'s/^\\(Subject:[ \t]\\)/\\1'"$p"'/' \ + -e '/^Subject-Prefix:/d' \ + | @SCRIPTS@/edmail --remove-empty-headers \ + | process_mail + + if [ ${PIPESTATUS[1]} -ne 0 ]; then + echo "Introductory message saved as $introduction" >&2 + rm -f $body + exit 1 + fi + + # If the character set is UTF-8, check for invalid byte + # sequences. + + #content_length=${#body} + #if [ -n "$(echo "$body" | tr -d '\0-\177')" ]; then + # charset=UTF-8 + #fi + # Content-Transfer-Encoding: 7bit + # Content-Transfer-Encoding: 8bit + # Content-Type: text/plain; charset=ISO-8859-1 + # Content-Type: text/plain; charset=UTF-8 + + ((num++)) +done +rm -f $introduction $body +#echo >&2 +### Local Variables: +### mode: shell-script +### End: +# vim:filetype=sh diff --git a/quilt/push.in b/quilt/push.in index e70839d..757cc2b 100644 --- a/quilt/push.in +++ b/quilt/push.in @@ -138,7 +138,6 @@ add_patch() no_reject_files= if [ -z "$opt_leave_rejects" ]; then local tmp="$(gen_tempfile)" - trap "rm -f $tmp" EXIT no_reject_files="-r $tmp" fi diff --git a/scripts/edmail.in b/scripts/edmail.in new file mode 100644 index 0000000..9f1e8f3 --- /dev/null +++ b/scripts/edmail.in @@ -0,0 +1,151 @@ +#! @PERL@ -w + +use Getopt::Long; +use strict; + +my (%append_name, %append_value, $remove_empty_headers, %remove_header, + %extract_recipients, %replace_name, %replace_value, $charset); +GetOptions('add-recipient:s%' => + sub { + $append_name{lc $_[1]} = $_[1]; + $append_value{lc $_[1]} .= ",\n " . $_[2]; + }, + 'remove-header:s' => sub { $remove_header{lc $_[1]}++ }, + 'remove-empty-headers' => \$remove_empty_headers, + 'replace-header:s%' => + sub { + $replace_name{lc $_[1]} = $_[1]; + $replace_value{lc $_[1]} = $_[2]; + }, + 'extract-recipients:s' => sub { $extract_recipients{lc $_[1]} = 1 }, + 'charset' => \$charset) + or exit 1; +my %recipient_headers = map {lc $_ => 1} (@ARGV, keys %append_name); + +# Email address formats understood: +# Andreas Gruenbacher <agruen@suse.de> +# "Andreas G." <agruen@suse.de> +# agruen@suse.de (Andreas Gruenbacher) +# agruen@suse.de +# agruen@[suse.de] +# +# Not understood (needs proper encoding): +# Andreas Grünbacher <agruen@suse.de> + +sub check_recipient($) { + my ($recipient) = @_; + my ($display, $deliver); + local $_ = $recipient; + my $spl = '()<>\[\]:;@\\,"'; # special characters + my $spldot = "$spl."; # special characters + dot + + # FIXME: Take a character set option and if set, encode invalid + # characters in atoms: =?iso-8859-1?q?Gr=FCnbacher?= + + if (($display, $deliver) = /^(.*?)\s*<(.+)>$/ or + ($deliver, $display) = /^(\S*)(\s*\(.*\))$/) { + $_ = $display; + if (/^"((?:[^"\\]|\\[^\n\r])*)"/) { + $display = $1; + } else { + # The value is not (properly) quoted. Check for invalid characters. + while (/\(/ or /\)/) { + die "Display name '$display' contains unpaired parentheses\n" + unless s/\(([^()]*)\)/$1/; + } + die "Display name '$display' contains invalid characters\n" + if /[$spldot]/; + } + die "Display name '$display' contains non-printable or " . + "8-bit characters\n" if (/[^ \t\40-\176]/); + } else { + $deliver = $_; + } + # Check for a valid delivery address + die "Delivery address '$deliver' is invalid\n" + if $deliver =~ /[ \t]/ or $deliver =~ /[^ \t\40-\176]/ or + $deliver !~ /^[^$spl]+@(\[?)[^$spldot]+(?:\.[^$spldot]+)*(\]?)$/ or + (!$1) != (!$2); + return $deliver; +} + +my %recipients; +sub process_header($) { + local ($_) = @_; + my ($name, $value); + + return unless defined $_; + unless (($name, $value) = /^([\41-\176]+):\s*(.*)\s*/s) { + print; + return + } + if (%extract_recipients) { + if (exists $extract_recipients{lc $name}) { + #print "(($value))"; + $value =~ s/^\s*//; $value =~ s/\s*$//; + foreach my $recipient (split /\s*,\s*/s, $value) { + next if $recipient =~ /^\s*$/; + #print "<<$recipient>>"; + print check_recipient($recipient), "\n"; + } + } + return; + } + return if exists $remove_header{lc $name}; + if (exists $replace_name{lc $name}) { + if (exists $replace_value{lc $name}) { + print "$replace_name{lc $name}: $replace_value{lc $name}\n"; + delete $replace_value{lc $name}; + } + return; + } + if (exists $recipient_headers{lc $1}) { + if (exists $append_name{lc $name}) { + $value .= $append_value{lc $name}; + delete $append_name{lc $name}; + } + my @recipients; + # This is a recipients field. Split out all the recipients and + # check the addresses. Suppress duplicate recipients. + $value =~ s/^\s*//; $value =~ s/\s*$//; + foreach my $recipient (split /\s*,\s*/, $value) { + next if $recipient =~ /^\s*$/; + my $deliver = check_recipient($recipient); + push @recipients, $recipient + unless exists $recipients{$deliver}; + $recipients{$deliver} = $deliver; + } + print "$name: ", join(",\n ", @recipients), "\n" + if @recipients || !$remove_empty_headers; + } else { + print if $value ne "" || !$remove_empty_headers; + } +} + +my $header; +while (<STDIN>) { + last if (/^$/); + if (/^\S/) { + process_header $header; + undef $header; + } + $header .= $_; +} +process_header $header; +foreach my $name (keys %append_name) { + process_header $append_name{$name} . ': ' . $append_value{$name}; +} +unless (%extract_recipients) { + # Copy the message body to standard output + # FIXME check for 7-bit clean, else assume $charset + # FIXME if UTF-8, check for invalid characters! + # FIXME must make sure that all messages are written in + # either 7-bit or $charset => mbox !!! + + # Content-Transfer-Encoding: 7bit + # Content-Transfer-Encoding: 8bit + # Content-Type: text/plain; charset=ISO-8859-15 + # Content-Type: text/plain; charset=UTF-8 + undef $/; + print "\n", <STDIN>; +} diff --git a/scripts/patchfns.in b/scripts/patchfns.in index aecd68a..0e9b306 100644 --- a/scripts/patchfns.in +++ b/scripts/patchfns.in @@ -32,10 +32,39 @@ fi # Add default arguments for this command if [ -n "$QUILT_COMMAND" ]; then args="QUILT_$(echo $QUILT_COMMAND | tr a-z A-Z)_ARGS" - set -- ${!args} "$@" + eval set -- ${!args} \"\$@\" unset args fi +# ======================================================== + +#declare -a exit_handlers +# +#add_exit_handler() { +# exit_handlers[${#exit_handlers[@]}]=$1 +#} +# +#remove_exit_handler() { +# declare -a handlers +# local h +# for h in "${exit_handlers[@]}"; do +# [ "$h" = "$1" ] && continue +# handlers[${#handlers[@]}]=$h +# done +# exit_handlers=( "${handlers[@]}" ) +#} +# +#run_exit_handlers() { +# local h +# for h in "${exit_handlers[@]}"; do +# eval $h +# done +#} +# +#trap run_exit_handlers EXIT + +# ======================================================== + # Quote a string for use in a basic regular expression. quote_bre() { @@ -653,14 +682,32 @@ gen_tempfile() fi } - local dir - if [ x"$1" = x"-d" ] + local name + if [ "$1" = -d ] then - dir=-d - shift + @MKTEMP@ -d ${2:-${TMPDIR:-/tmp}/quilt}.XXXXXX + else + @MKTEMP@ ${1:-${TMPDIR:-/tmp}/quilt}.XXXXXX fi - @MKTEMP@ $dir ${1:-${TMPDIR:-/tmp}/quilt}.XXXXXX -} +# if [ "$1" = -d ] +# then +# name=$(@MKTEMP@ -d ${2:-${TMPDIR:-/tmp}/quilt}.XXXXXX) +# add_exit_handler "rm -rf $name" +# else +# name=$(@MKTEMP@ ${1:-${TMPDIR:-/tmp}/quilt}.XXXXXX) +# add_exit_handler "rm -f $name" +# fi +# echo "$name" +} + +#keep_tempfile() +#{ +# if [ "$1" = -d ]; then +# remove_exit_handler "rm -rf $2" +# else +# remove_exit_handler "rm -f $1" +# fi +#} first_modified_by() { |