Skip to content

Commit 6c94d94

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 e37820a commit 6c94d94

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

Documentation/Makefile

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ docdep_prereqs = \
286286
cmd-list.made $(cmds_txt)
287287

288288
doc.dep : $(docdep_prereqs) $(wildcard *.txt) build-docdep.perl
289-
$(QUIET_GEN)$(RM) $@+ $@ && \
290-
$(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \
291-
mv $@+ $@
289+
$(QUIET_GEN)$(RM) $@.new $@ && \
290+
$(PERL_PATH) ./build-docdep.perl >$@.new $(QUIET_STDERR) && \
291+
mv $@.new $@
292292

293293
-include doc.dep
294294

@@ -324,8 +324,8 @@ mergetools-list.made: ../git-mergetool--lib.sh $(wildcard ../mergetools/*)
324324
date >$@
325325

326326
clean:
327-
$(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7
328-
$(RM) *.texi *.texi+ *.texi++ git.info gitman.info
327+
$(RM) *.xml *.xml.new *.html *.html.new *.1 *.5 *.7
328+
$(RM) *.texi *.texi.new *.texi.new.new git.info gitman.info
329329
$(RM) *.pdf
330330
$(RM) howto-index.txt howto/*.html doc.dep
331331
$(RM) technical/*.html technical/api-index.txt
@@ -334,14 +334,14 @@ clean:
334334
$(RM) manpage-base-url.xsl
335335

336336
$(MAN_HTML): %.html : %.txt asciidoc.conf
337-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
338-
$(TXT_TO_HTML) -d manpage -o $@+ $< && \
339-
mv $@+ $@
337+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
338+
$(TXT_TO_HTML) -d manpage -o $@.new $< && \
339+
mv $@.new $@
340340

341341
$(OBSOLETE_HTML): %.html : %.txto asciidoc.conf
342-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
343-
$(TXT_TO_HTML) -o $@+ $< && \
344-
mv $@+ $@
342+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
343+
$(TXT_TO_HTML) -o $@.new $< && \
344+
mv $@.new $@
345345

346346
manpage-base-url.xsl: manpage-base-url.xsl.in
347347
sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@
@@ -351,14 +351,14 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
351351
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
352352

353353
%.xml : %.txt asciidoc.conf
354-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
355-
$(TXT_TO_XML) -d manpage -o $@+ $< && \
356-
mv $@+ $@
354+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
355+
$(TXT_TO_XML) -d manpage -o $@.new $< && \
356+
mv $@.new $@
357357

358358
user-manual.xml: user-manual.txt user-manual.conf
359-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
360-
$(TXT_TO_XML) -d book -o $@+ $< && \
361-
mv $@+ $@
359+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
360+
$(TXT_TO_XML) -d book -o $@.new $< && \
361+
mv $@.new $@
362362

363363
technical/api-index.txt: technical/api-index-skel.txt \
364364
technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
@@ -375,46 +375,46 @@ XSLT = docbook.xsl
375375
XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
376376

377377
user-manual.html: user-manual.xml $(XSLT)
378-
$(QUIET_XSLTPROC)$(RM) $@+ $@ && \
379-
xsltproc $(XSLTOPTS) -o $@+ $(XSLT) $< && \
380-
mv $@+ $@
378+
$(QUIET_XSLTPROC)$(RM) $@.new $@ && \
379+
xsltproc $(XSLTOPTS) -o $@.new $(XSLT) $< && \
380+
mv $@.new $@
381381

382382
git.info: user-manual.texi
383383
$(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi
384384

385385
user-manual.texi: user-manual.xml
386-
$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
387-
$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@++ && \
388-
$(PERL_PATH) fix-texi.perl <$@++ >$@+ && \
389-
rm $@++ && \
390-
mv $@+ $@
386+
$(QUIET_DB2TEXI)$(RM) $@.new $@ && \
387+
$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@.new.new && \
388+
$(PERL_PATH) fix-texi.perl <$@.new.new >$@.new && \
389+
rm $@.new.new && \
390+
mv $@.new $@
391391

392392
user-manual.pdf: user-manual.xml
393-
$(QUIET_DBLATEX)$(RM) $@+ $@ && \
394-
$(DBLATEX) -o $@+ $(DBLATEX_COMMON) $< && \
395-
mv $@+ $@
393+
$(QUIET_DBLATEX)$(RM) $@.new $@ && \
394+
$(DBLATEX) -o $@.new $(DBLATEX_COMMON) $< && \
395+
mv $@.new $@
396396

397397
gitman.texi: $(MAN_XML) cat-texi.perl texi.xsl
398-
$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
399-
($(foreach xml,$(sort $(MAN_XML)),xsltproc -o $(xml)+ texi.xsl $(xml) && \
400-
$(DOCBOOK2X_TEXI) --encoding=UTF-8 --to-stdout $(xml)+ && \
401-
rm $(xml)+ &&) true) > $@++ && \
402-
$(PERL_PATH) cat-texi.perl $@ <$@++ >$@+ && \
403-
rm $@++ && \
404-
mv $@+ $@
398+
$(QUIET_DB2TEXI)$(RM) $@.new $@ && \
399+
($(foreach xml,$(sort $(MAN_XML)),xsltproc -o $(xml).new texi.xsl $(xml) && \
400+
$(DOCBOOK2X_TEXI) --encoding=UTF-8 --to-stdout $(xml).new && \
401+
rm $(xml).new &&) true) > $@.new.new && \
402+
$(PERL_PATH) cat-texi.perl $@ <$@.new.new >$@.new && \
403+
rm $@.new.new && \
404+
mv $@.new $@
405405

406406
gitman.info: gitman.texi
407407
$(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $*.texi
408408

409409
$(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
410-
$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
411-
$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \
412-
mv $@+ $@
410+
$(QUIET_DB2TEXI)$(RM) $@.new $@ && \
411+
$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@.new && \
412+
mv $@.new $@
413413

414414
howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
415-
$(QUIET_GEN)$(RM) $@+ $@ && \
416-
'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/*.txt)) >$@+ && \
417-
mv $@+ $@
415+
$(QUIET_GEN)$(RM) $@.new $@ && \
416+
'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/*.txt)) >$@.new && \
417+
mv $@.new $@
418418

419419
$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
420420
$(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt
@@ -423,10 +423,10 @@ WEBDOC_DEST = /pub/software/scm/git/docs
423423

424424
howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
425425
$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
426-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
426+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
427427
sed -e '1,/^$$/d' $< | \
428-
$(TXT_TO_HTML) - >$@+ && \
429-
mv $@+ $@
428+
$(TXT_TO_HTML) - >$@.new && \
429+
mv $@.new $@
430430

431431
install-webdoc : html
432432
'$(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST)

0 commit comments

Comments
 (0)