diff options
| author | Paul Eggert | 2015-10-10 18:03:49 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-10-10 18:11:27 -0700 |
| commit | 29dfca23553b9995a8ec3b50090a652a6a0ecb01 (patch) | |
| tree | a5d968df7cadd8259e029d89e6150dfe6762cb96 /doc | |
| parent | ec0d4d24fd11b5040de9f7657b486c3b1e743071 (diff) | |
| download | emacs-29dfca23553b9995a8ec3b50090a652a6a0ecb01.tar.gz emacs-29dfca23553b9995a8ec3b50090a652a6a0ecb01.zip | |
Use ‘echo’ safely with ‘\’ or leading ‘-’
POSIX says that ‘echo FOO’ produces implementation-defined output
if FOO contains leading ‘-’, or ‘\’ anywhere, so don’t assume GNU
behavior in that case.
* Makefile.in (removenullpaths): Remove.
(epaths-force): Rewrite to avoid the need for ‘echo’.
(install-etc): Be clearer about escaping the shell metacharacters
‘\’ and ‘$’.
* Makefile.in (install-arch-indep, install-etcdoc):
* admin/charsets/mapconv, admin/merge-gnulib, admin/merge-pkg-config:
* admin/quick-install-emacs, build-aux/gitlog-to-emacslog:
* configure.ac, lib-src/rcs2log, make-dist:
* src/Makefile.in (lisp.mk):
Don’t assume ‘echo’ outputs ‘\’ and leading ‘-’ unscathed.
For example, use ‘printf '%s\n' "$foo"’ rather than ‘echo "$foo"’
if $foo can contain arbitrary characters.
* lisp/Makefile.in (TAGS): Use ‘ls’, not ‘echo’, to avoid ‘\’ issues.
* doc/lispref/two-volume.make (vol1.pdf):
* test/etags/make-src/Makefile (web ftp publish):
Use ‘printf’ rather than ‘echo -e’.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/two-volume.make | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/doc/lispref/two-volume.make b/doc/lispref/two-volume.make index 64799d8fc04..bdcdb2f4fdd 100644 --- a/doc/lispref/two-volume.make +++ b/doc/lispref/two-volume.make | |||
| @@ -26,9 +26,9 @@ tex2 = sed '/^@setfilename/a\ | |||
| 26 | 26 | ||
| 27 | # elisp.texi specially defines \tocreadfilename when VOL1 or VOL2 is | 27 | # elisp.texi specially defines \tocreadfilename when VOL1 or VOL2 is |
| 28 | # set, so we can use our premade .toc's. | 28 | # set, so we can use our premade .toc's. |
| 29 | # | 29 | # |
| 30 | vol1.pdf: elisp1med-fns-ready elisp1med-aux-ready elisp1med-toc-ready | 30 | vol1.pdf: elisp1med-fns-ready elisp1med-aux-ready elisp1med-toc-ready |
| 31 | @echo -e "\f Final TeX run for volume 1..." | 31 | @printf '\f Final TeX run for volume 1...\n' |
| 32 | cp elisp1med-toc-ready elisp1-toc-ready.toc | 32 | cp elisp1med-toc-ready elisp1-toc-ready.toc |
| 33 | cp elisp1med-fns-ready vol1.fns | 33 | cp elisp1med-fns-ready vol1.fns |
| 34 | cp elisp1med-aux-ready vol1.aux | 34 | cp elisp1med-aux-ready vol1.aux |
| @@ -42,27 +42,27 @@ vol2.pdf: elisp2med-fns-ready elisp2med-aux-ready elisp2med-toc-ready | |||
| 42 | $(tex2) | 42 | $(tex2) |
| 43 | 43 | ||
| 44 | # intermediate toc files. | 44 | # intermediate toc files. |
| 45 | # | 45 | # |
| 46 | # vol1 toc: volume 1, page break, volume 2 (with II: prepended). | 46 | # vol1 toc: volume 1, page break, volume 2 (with II: prepended). |
| 47 | elisp1med-toc-ready: elisp1med-init elisp2med-init | 47 | elisp1med-toc-ready: elisp1med-init elisp2med-init |
| 48 | echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@ | 48 | echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@ |
| 49 | cat elisp1med-toc >>$@ | 49 | cat elisp1med-toc >>$@ |
| 50 | echo '@page' >>$@ | 50 | echo '@page' >>$@ |
| 51 | echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@ | 51 | echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@ |
| 52 | sed 's/{\([^}]*\)}$$/{II:\1}/' elisp2med-toc >>$@ | 52 | sed 's/{\([^}]*\)}$$/{II:\1}/' elisp2med-toc >>$@ |
| 53 | # | 53 | # |
| 54 | # vol2 toc: volume 1 (with I: prepended), page break, volume 2. | 54 | # vol2 toc: volume 1 (with I: prepended), page break, volume 2. |
| 55 | elisp2med-toc-ready: elisp1med-init elisp2med-init | 55 | elisp2med-toc-ready: elisp1med-init elisp2med-init |
| 56 | echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@ | 56 | echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@ |
| 57 | sed 's/{\([^}]*\)}$$/{I:\1}/' elisp1med-toc >>$@ | 57 | sed 's/{\([^}]*\)}$$/{I:\1}/' elisp1med-toc >>$@ |
| 58 | echo '@page' >>$@ | 58 | echo '@page' >>$@ |
| 59 | echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@ | 59 | echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@ |
| 60 | cat elisp2med-toc >>$@ | 60 | cat elisp2med-toc >>$@ |
| 61 | 61 | ||
| 62 | 62 | ||
| 63 | # intermediate aux files. | 63 | # intermediate aux files. |
| 64 | # | 64 | # |
| 65 | # append vol2's fixed aux to normal vol1. | 65 | # append vol2's fixed aux to normal vol1. |
| 66 | elisp1med-aux-ready: elisp2med-aux-vol-added | 66 | elisp1med-aux-ready: elisp2med-aux-vol-added |
| 67 | cat elisp1med-aux $< >$@ | 67 | cat elisp1med-aux $< >$@ |
| 68 | # | 68 | # |
| @@ -78,7 +78,7 @@ elisp2med-aux-vol-added: elisp2med-init | |||
| 78 | sed 's/-pg}{\(.*\)}$$/-pg}{\1, vol.@tie2}/' elisp2med-aux >$@ | 78 | sed 's/-pg}{\(.*\)}$$/-pg}{\1, vol.@tie2}/' elisp2med-aux >$@ |
| 79 | 79 | ||
| 80 | # intermediate index (fns) file. | 80 | # intermediate index (fns) file. |
| 81 | # | 81 | # |
| 82 | elisp1med-fns-ready: elisp1med-fn-vol-added elisp2med-fn-vol-added | 82 | elisp1med-fns-ready: elisp1med-fn-vol-added elisp2med-fn-vol-added |
| 83 | cat elisp2med-fn-vol-added >>vol1.fn | 83 | cat elisp2med-fn-vol-added >>vol1.fn |
| 84 | texindex vol1.fn | 84 | texindex vol1.fn |
| @@ -103,17 +103,17 @@ elisp2med-fn-vol-added: elisp2med-init | |||
| 103 | # ----------------------------------------------------------------------------- | 103 | # ----------------------------------------------------------------------------- |
| 104 | 104 | ||
| 105 | # intermediate TeX runs. | 105 | # intermediate TeX runs. |
| 106 | # | 106 | # |
| 107 | # this generates what would be the final versions -- except the page | 107 | # this generates what would be the final versions -- except the page |
| 108 | # numbers aren't right. The process of adding the I: and II: changes | 108 | # numbers aren't right. The process of adding the I: and II: changes |
| 109 | # the page breaks, so a few index entries, at least are wrong. (In | 109 | # the page breaks, so a few index entries, at least are wrong. (In |
| 110 | # 2007, x-meta-keysym in vol.II ended up on page 374 when the index had | 110 | # 2007, x-meta-keysym in vol.II ended up on page 374 when the index had |
| 111 | # it on page 375 from the initial run.) | 111 | # it on page 375 from the initial run.) |
| 112 | # | 112 | # |
| 113 | # So, we start all over again, from these fns/aux/toc files. | 113 | # So, we start all over again, from these fns/aux/toc files. |
| 114 | # | 114 | # |
| 115 | elisp1med-init: elisp1-fns-ready elisp1-aux-ready elisp1init-toc-ready $(texinfodir)/texinfo.tex | 115 | elisp1med-init: elisp1-fns-ready elisp1-aux-ready elisp1init-toc-ready $(texinfodir)/texinfo.tex |
| 116 | @echo -e "\f Intermediate TeX run for volume 1..." | 116 | @printf '\f Intermediate TeX run for volume 1...\n' |
| 117 | cp elisp1init-toc-ready elisp1-toc-ready.toc | 117 | cp elisp1init-toc-ready elisp1-toc-ready.toc |
| 118 | cp elisp1-fns-ready vol1.fns | 118 | cp elisp1-fns-ready vol1.fns |
| 119 | cp elisp1-aux-ready vol1.aux | 119 | cp elisp1-aux-ready vol1.aux |
| @@ -134,26 +134,26 @@ elisp2med-init: elisp2-fns-ready elisp2-aux-ready elisp2init-toc-ready $(texinfo | |||
| 134 | 134 | ||
| 135 | 135 | ||
| 136 | # initial toc files. | 136 | # initial toc files. |
| 137 | # | 137 | # |
| 138 | # vol1 toc: volume 1, page break, volume 2 (with II: prepended). | 138 | # vol1 toc: volume 1, page break, volume 2 (with II: prepended). |
| 139 | elisp1init-toc-ready: elisp1-init elisp2-init | 139 | elisp1init-toc-ready: elisp1-init elisp2-init |
| 140 | echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@ | 140 | echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@ |
| 141 | cat elisp1-toc >>$@ | 141 | cat elisp1-toc >>$@ |
| 142 | echo '@page' >>$@ | 142 | echo '@page' >>$@ |
| 143 | echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@ | 143 | echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@ |
| 144 | sed 's/{\([^}]*\)}$$/{II:\1}/' elisp2-toc >>$@ | 144 | sed 's/{\([^}]*\)}$$/{II:\1}/' elisp2-toc >>$@ |
| 145 | # | 145 | # |
| 146 | # vol2 toc: volume 1 (with I: prepended), page break, volume 2. | 146 | # vol2 toc: volume 1 (with I: prepended), page break, volume 2. |
| 147 | elisp2init-toc-ready: elisp1-init elisp2-init | 147 | elisp2init-toc-ready: elisp1-init elisp2-init |
| 148 | echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@ | 148 | echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@ |
| 149 | sed 's/{\([^}]*\)}$$/{I:\1}/' elisp1-toc >>$@ | 149 | sed 's/{\([^}]*\)}$$/{I:\1}/' elisp1-toc >>$@ |
| 150 | echo '@page' >>$@ | 150 | echo '@page' >>$@ |
| 151 | echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@ | 151 | echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@ |
| 152 | cat elisp2-toc >>$@ | 152 | cat elisp2-toc >>$@ |
| 153 | 153 | ||
| 154 | 154 | ||
| 155 | # initial aux files. | 155 | # initial aux files. |
| 156 | # | 156 | # |
| 157 | # append vol2's fixed aux to normal vol1. The initial runs saved | 157 | # append vol2's fixed aux to normal vol1. The initial runs saved |
| 158 | # elisp1-aux and elisp2-aux. | 158 | # elisp1-aux and elisp2-aux. |
| 159 | elisp1-aux-ready: elisp2-aux-vol-added | 159 | elisp1-aux-ready: elisp2-aux-vol-added |
| @@ -171,7 +171,7 @@ elisp2-aux-vol-added: elisp2-init | |||
| 171 | sed 's/-pg}{\(.*\)}$$/-pg}{\1, vol.@tie2}/' elisp2-aux >$@ | 171 | sed 's/-pg}{\(.*\)}$$/-pg}{\1, vol.@tie2}/' elisp2-aux >$@ |
| 172 | 172 | ||
| 173 | # initial index (fns) file. | 173 | # initial index (fns) file. |
| 174 | # | 174 | # |
| 175 | # Append other volume's index entries to this one's. | 175 | # Append other volume's index entries to this one's. |
| 176 | # Index entries in this volume will then take precedence. | 176 | # Index entries in this volume will then take precedence. |
| 177 | elisp1-fns-ready: elisp1-fn-vol-added elisp2-fn-vol-added | 177 | elisp1-fns-ready: elisp1-fn-vol-added elisp2-fn-vol-added |
| @@ -195,14 +195,14 @@ elisp2-fn-vol-added: elisp2-init | |||
| 195 | 195 | ||
| 196 | 196 | ||
| 197 | # initial TeX runs. | 197 | # initial TeX runs. |
| 198 | # | 198 | # |
| 199 | # We use the .fn, .aux, and .toc files created here in subsequent | 199 | # We use the .fn, .aux, and .toc files created here in subsequent |
| 200 | # processing. The page numbers generated here will not be correct yet, | 200 | # processing. The page numbers generated here will not be correct yet, |
| 201 | # but we run texindex and TeX a second time just to get them closer. | 201 | # but we run texindex and TeX a second time just to get them closer. |
| 202 | # Otherwise it might take even longer for them to converge. | 202 | # Otherwise it might take even longer for them to converge. |
| 203 | # | 203 | # |
| 204 | elisp1-init: elisp.texi | 204 | elisp1-init: elisp.texi |
| 205 | @echo -e "\f Initial TeX run for volume 1..." | 205 | @printf '\f Initial TeX run for volume 1...\n' |
| 206 | rm -f vol1.aux vol1.toc | 206 | rm -f vol1.aux vol1.toc |
| 207 | $(tex1) | 207 | $(tex1) |
| 208 | texindex vol1.?? | 208 | texindex vol1.?? |
| @@ -220,17 +220,16 @@ elisp2-init: elisp.texi | |||
| 220 | touch $@ | 220 | touch $@ |
| 221 | 221 | ||
| 222 | # COPYING CONDITIONS | 222 | # COPYING CONDITIONS |
| 223 | # | 223 | # |
| 224 | # This file is free software: you can redistribute it and/or modify | 224 | # This file is free software: you can redistribute it and/or modify |
| 225 | # it under the terms of the GNU General Public License as published by | 225 | # it under the terms of the GNU General Public License as published by |
| 226 | # the Free Software Foundation, either version 3 of the License, or | 226 | # the Free Software Foundation, either version 3 of the License, or |
| 227 | # (at your option) any later version. | 227 | # (at your option) any later version. |
| 228 | # | 228 | # |
| 229 | # This file is distributed in the hope that it will be useful, | 229 | # This file is distributed in the hope that it will be useful, |
| 230 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | 230 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 231 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 231 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 232 | # GNU General Public License for more details. | 232 | # GNU General Public License for more details. |
| 233 | # | 233 | # |
| 234 | # You should have received a copy of the GNU General Public License | 234 | # You should have received a copy of the GNU General Public License |
| 235 | # along with this file. If not, see <http://www.gnu.org/licenses/>. | 235 | # along with this file. If not, see <http://www.gnu.org/licenses/>. |
| 236 | |||