Skip to content

Commit 4b44941

Browse files
committed
Avoid illegal filenames when building Documentation on NTFS
A '+' is not a valid part of a filename with Windows file systems (it is reserved because the '+' operator meant file concatenation back in the DOS days). Let's just not use it. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent d3b8489 commit 4b44941

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

Documentation/Makefile

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ docdep_prereqs = \
266266
cmd-list.made $(cmds_txt)
267267

268268
doc.dep : $(docdep_prereqs) $(wildcard *.txt) build-docdep.perl
269-
$(QUIET_GEN)$(RM) $@+ $@ && \
270-
$(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \
271-
mv $@+ $@
269+
$(QUIET_GEN)$(RM) $@.new $@ && \
270+
$(PERL_PATH) ./build-docdep.perl >$@.new $(QUIET_STDERR) && \
271+
mv $@.new $@
272272

273273
-include doc.dep
274274

@@ -304,23 +304,23 @@ mergetools-list.made: ../git-mergetool--lib.sh $(wildcard ../mergetools/*)
304304
date >$@
305305

306306
clean:
307-
$(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7
308-
$(RM) *.texi *.texi+ *.texi++ git.info gitman.info
307+
$(RM) *.xml *.xml.new *.html *.html.new *.1 *.5 *.7
308+
$(RM) *.texi *.texi.new *.texi.new.new git.info gitman.info
309309
$(RM) *.pdf
310310
$(RM) howto-index.txt howto/*.html doc.dep
311311
$(RM) technical/*.html technical/api-index.txt
312312
$(RM) $(cmds_txt) $(mergetools_txt) *.made
313313
$(RM) manpage-base-url.xsl
314314

315315
$(MAN_HTML): %.html : %.txt asciidoc.conf
316-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
317-
$(TXT_TO_HTML) -d manpage -o $@+ $< && \
318-
mv $@+ $@
316+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
317+
$(TXT_TO_HTML) -d manpage -o $@.new $< && \
318+
mv $@.new $@
319319

320320
$(OBSOLETE_HTML): %.html : %.txto asciidoc.conf
321-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
322-
$(TXT_TO_HTML) -o $@+ $< && \
323-
mv $@+ $@
321+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
322+
$(TXT_TO_HTML) -o $@.new $< && \
323+
mv $@.new $@
324324

325325
manpage-base-url.xsl: manpage-base-url.xsl.in
326326
sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@
@@ -330,14 +330,14 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
330330
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
331331

332332
%.xml : %.txt asciidoc.conf
333-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
334-
$(TXT_TO_XML) -d manpage -o $@+ $< && \
335-
mv $@+ $@
333+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
334+
$(TXT_TO_XML) -d manpage -o $@.new $< && \
335+
mv $@.new $@
336336

337337
user-manual.xml: user-manual.txt user-manual.conf
338-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
339-
$(TXT_TO_XML) -d book -o $@+ $< && \
340-
mv $@+ $@
338+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
339+
$(TXT_TO_XML) -d book -o $@.new $< && \
340+
mv $@.new $@
341341

342342
technical/api-index.txt: technical/api-index-skel.txt \
343343
technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
@@ -351,45 +351,45 @@ XSLT = docbook.xsl
351351
XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
352352

353353
user-manual.html: user-manual.xml $(XSLT)
354-
$(QUIET_XSLTPROC)$(RM) $@+ $@ && \
355-
xsltproc $(XSLTOPTS) -o $@+ $(XSLT) $< && \
356-
mv $@+ $@
354+
$(QUIET_XSLTPROC)$(RM) $@.new $@ && \
355+
xsltproc $(XSLTOPTS) -o $@.new $(XSLT) $< && \
356+
mv $@.new $@
357357

358358
git.info: user-manual.texi
359359
$(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi
360360

361361
user-manual.texi: user-manual.xml
362-
$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
363-
$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@++ && \
364-
$(PERL_PATH) fix-texi.perl <$@++ >$@+ && \
365-
rm $@++ && \
366-
mv $@+ $@
362+
$(QUIET_DB2TEXI)$(RM) $@.new $@ && \
363+
$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@.new.new && \
364+
$(PERL_PATH) fix-texi.perl <$@.new.new >$@.new && \
365+
rm $@.new.new && \
366+
mv $@.new $@
367367

368368
user-manual.pdf: user-manual.xml
369-
$(QUIET_DBLATEX)$(RM) $@+ $@ && \
370-
$(DBLATEX) -o $@+ -p $(ASCIIDOC_DBLATEX_DIR)/asciidoc-dblatex.xsl -s $(ASCIIDOC_DBLATEX_DIR)/asciidoc-dblatex.sty $< && \
371-
mv $@+ $@
369+
$(QUIET_DBLATEX)$(RM) $@.new $@ && \
370+
$(DBLATEX) -o $@.new -p $(ASCIIDOC_DBLATEX_DIR)/asciidoc-dblatex.xsl -s $(ASCIIDOC_DBLATEX_DIR)/asciidoc-dblatex.sty $< && \
371+
mv $@.new $@
372372

373373
gitman.texi: $(MAN_XML) cat-texi.perl
374-
$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
374+
$(QUIET_DB2TEXI)$(RM) $@.new $@ && \
375375
($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --encoding=UTF-8 \
376-
--to-stdout $(xml) &&) true) > $@++ && \
377-
$(PERL_PATH) cat-texi.perl $@ <$@++ >$@+ && \
378-
rm $@++ && \
379-
mv $@+ $@
376+
--to-stdout $(xml) &&) true) > $@.new.new && \
377+
$(PERL_PATH) cat-texi.perl $@ <$@.new.new >$@.new && \
378+
rm $@.new.new && \
379+
mv $@.new $@
380380

381381
gitman.info: gitman.texi
382382
$(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $*.texi
383383

384384
$(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
385-
$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
386-
$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \
387-
mv $@+ $@
385+
$(QUIET_DB2TEXI)$(RM) $@.new $@ && \
386+
$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@.new && \
387+
mv $@.new $@
388388

389389
howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
390-
$(QUIET_GEN)$(RM) $@+ $@ && \
391-
'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/*.txt)) >$@+ && \
392-
mv $@+ $@
390+
$(QUIET_GEN)$(RM) $@.new $@ && \
391+
'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/*.txt)) >$@.new && \
392+
mv $@.new $@
393393

394394
$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
395395
$(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt
@@ -398,10 +398,10 @@ WEBDOC_DEST = /pub/software/scm/git/docs
398398

399399
howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
400400
$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
401-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
401+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
402402
sed -e '1,/^$$/d' $< | \
403-
$(TXT_TO_HTML) - >$@+ && \
404-
mv $@+ $@
403+
$(TXT_TO_HTML) - >$@.new && \
404+
mv $@.new $@
405405

406406
install-webdoc : html
407407
'$(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST)

0 commit comments

Comments
 (0)