Skip to content

Commit f9b8814

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 e5c990c commit f9b8814

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
@@ -284,9 +284,9 @@ docdep_prereqs = \
284284
cmd-list.made $(cmds_txt)
285285

286286
doc.dep : $(docdep_prereqs) $(wildcard *.txt) build-docdep.perl
287-
$(QUIET_GEN)$(RM) $@+ $@ && \
288-
$(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \
289-
mv $@+ $@
287+
$(QUIET_GEN)$(RM) $@.new $@ && \
288+
$(PERL_PATH) ./build-docdep.perl >$@.new $(QUIET_STDERR) && \
289+
mv $@.new $@
290290

291291
-include doc.dep
292292

@@ -322,8 +322,8 @@ mergetools-list.made: ../git-mergetool--lib.sh $(wildcard ../mergetools/*)
322322
date >$@
323323

324324
clean:
325-
$(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7
326-
$(RM) *.texi *.texi+ *.texi++ git.info gitman.info
325+
$(RM) *.xml *.xml.new *.html *.html.new *.1 *.5 *.7
326+
$(RM) *.texi *.texi.new *.texi.new.new git.info gitman.info
327327
$(RM) *.pdf
328328
$(RM) howto-index.txt howto/*.html doc.dep
329329
$(RM) technical/*.html technical/api-index.txt
@@ -332,14 +332,14 @@ clean:
332332
$(RM) manpage-base-url.xsl
333333

334334
$(MAN_HTML): %.html : %.txt asciidoc.conf
335-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
336-
$(TXT_TO_HTML) -d manpage -o $@+ $< && \
337-
mv $@+ $@
335+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
336+
$(TXT_TO_HTML) -d manpage -o $@.new $< && \
337+
mv $@.new $@
338338

339339
$(OBSOLETE_HTML): %.html : %.txto asciidoc.conf
340-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
341-
$(TXT_TO_HTML) -o $@+ $< && \
342-
mv $@+ $@
340+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
341+
$(TXT_TO_HTML) -o $@.new $< && \
342+
mv $@.new $@
343343

344344
manpage-base-url.xsl: manpage-base-url.xsl.in
345345
sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@
@@ -349,14 +349,14 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
349349
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
350350

351351
%.xml : %.txt asciidoc.conf
352-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
353-
$(TXT_TO_XML) -d manpage -o $@+ $< && \
354-
mv $@+ $@
352+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
353+
$(TXT_TO_XML) -d manpage -o $@.new $< && \
354+
mv $@.new $@
355355

356356
user-manual.xml: user-manual.txt user-manual.conf
357-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
358-
$(TXT_TO_XML) -d book -o $@+ $< && \
359-
mv $@+ $@
357+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
358+
$(TXT_TO_XML) -d book -o $@.new $< && \
359+
mv $@.new $@
360360

361361
technical/api-index.txt: technical/api-index-skel.txt \
362362
technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
@@ -373,46 +373,46 @@ XSLT = docbook.xsl
373373
XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
374374

375375
user-manual.html: user-manual.xml $(XSLT)
376-
$(QUIET_XSLTPROC)$(RM) $@+ $@ && \
377-
xsltproc $(XSLTOPTS) -o $@+ $(XSLT) $< && \
378-
mv $@+ $@
376+
$(QUIET_XSLTPROC)$(RM) $@.new $@ && \
377+
xsltproc $(XSLTOPTS) -o $@.new $(XSLT) $< && \
378+
mv $@.new $@
379379

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

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

390390
user-manual.pdf: user-manual.xml
391-
$(QUIET_DBLATEX)$(RM) $@+ $@ && \
392-
$(DBLATEX) -o $@+ $(DBLATEX_COMMON) $< && \
393-
mv $@+ $@
391+
$(QUIET_DBLATEX)$(RM) $@.new $@ && \
392+
$(DBLATEX) -o $@.new $(DBLATEX_COMMON) $< && \
393+
mv $@.new $@
394394

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

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

407407
$(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
408-
$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
409-
$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \
410-
mv $@+ $@
408+
$(QUIET_DB2TEXI)$(RM) $@.new $@ && \
409+
$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@.new && \
410+
mv $@.new $@
411411

412412
howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
413-
$(QUIET_GEN)$(RM) $@+ $@ && \
414-
'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/*.txt)) >$@+ && \
415-
mv $@+ $@
413+
$(QUIET_GEN)$(RM) $@.new $@ && \
414+
'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/*.txt)) >$@.new && \
415+
mv $@.new $@
416416

417417
$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
418418
$(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt
@@ -421,10 +421,10 @@ WEBDOC_DEST = /pub/software/scm/git/docs
421421

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

429429
install-webdoc : html
430430
'$(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST)

0 commit comments

Comments
 (0)