Skip to content

Commit

Permalink
bail out installation if doc conversion failed
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87117 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
ripley committed Sep 11, 2024
1 parent 4af5924 commit 8f2ce5a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ R: Makefile svnonly
$(ECHO) "you should 'make docs' now ..."

docs: R FORCE
-@(cd doc && $(MAKE) $@)
@(cd doc && $(MAKE) $@)
-@(cd src/library && $(MAKE) $@)
FORCE:

Expand Down
24 changes: 12 additions & 12 deletions doc/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ Rscript.1:
NEWS.rds: $(srcdir)/NEWS.Rd
@$(ECHO) "options(warn=1);saveRDS(tools:::prepare_Rd(tools::parse_Rd(\"$(srcdir)/NEWS.Rd\", \
macros = \"../share/Rd/macros/system.Rd\"), stages = 'install', warningCalls = FALSE), \
'NEWS.rds')" | $(R_EXE)
'NEWS.rds')" | $(R_EXE) || rm $^

NEWS: NEWS.rds
@$(ECHO) "creating doc/NEWS"
@$(ECHO) 'options(warn=1);tools:::Rd2txt_NEWS_in_Rd("NEWS.rds", "NEWS")' | $(R_EXE)
@$(ECHO) 'options(warn=1);tools:::Rd2txt_NEWS_in_Rd("NEWS.rds", "NEWS")' | $(R_EXE) || rm $^

html/NEWS.html: NEWS.rds
@$(ECHO) 'options(warn=1);tools:::Rd2HTML_NEWS_in_Rd("NEWS.rds", "html/NEWS.html")' | $(R_EXE)
@$(ECHO) 'options(warn=1);tools:::Rd2HTML_NEWS_in_Rd("NEWS.rds", "html/NEWS.html")' | $(R_EXE) || rm $^

PDFLATEX = @PDFLATEX@
## needs pdflatex (and more)
Expand All @@ -74,31 +74,31 @@ NEWS.pdf: NEWS.rds
else \
$(ECHO) "creating doc/NEWS.pdf"; \
$(ECHO) 'options(warn=1);tools:::Rd2pdf_NEWS_in_Rd("NEWS.rds", "NEWS.pdf")' | \
TEXINPUTS="$(top_srcdir)/share/texmf/tex/latex:$$TEXINPUTS" $(R_EXE); \
TEXINPUTS="$(top_srcdir)/share/texmf/tex/latex:$$TEXINPUTS" $(R_EXE) || rm $^; \
fi

docs3: NEWS.3.rds NEWS.3.html NEWS.3.pdf

NEWS.3.rds: $(srcdir)/NEWS.3.Rd
@$(ECHO) "options(warn=1);saveRDS(tools:::prepare_Rd(tools::parse_Rd(\"$(srcdir)/NEWS.3.Rd\", \
macros = \"../share/Rd/macros/system.Rd\"), stages = 'install', warningCalls = FALSE), \
'NEWS.3.rds')" | $(R_EXE)
'NEWS.3.rds')" | $(R_EXE) || rm $^

NEWS.3: NEWS.3.rds
@$(ECHO) "creating NEWS.3"
@$(ECHO) 'options(warn=1);tools:::Rd2txt_NEWS_in_Rd("NEWS.3.rds", "NEWS.3")' | $(R_EXE)
@$(ECHO) 'options(warn=1);tools:::Rd2txt_NEWS_in_Rd("NEWS.3.rds", "NEWS.3")' | $(R_EXE) || rm $^

NEWS.3.html: NEWS.3.rds
@$(ECHO) "creating NEWS.3.html"
@$(ECHO) 'options(warn=1);tools:::Rd2HTML_NEWS_in_Rd("NEWS.3.rds", "NEWS.3.html")' | $(R_EXE)
@$(ECHO) 'options(warn=1);tools:::Rd2HTML_NEWS_in_Rd("NEWS.3.rds", "NEWS.3.html")' | $(R_EXE) || rm $^

NEWS.3.pdf: NEWS.3.rds
@if test -z "$(PDFLATEX)"; then \
$(ECHO) "'pdflatex' is needed to make NEWS.3.pdf but is missing on your system."; \
else \
$(ECHO) "creating NEWS.3.pdf"; \
$(ECHO) 'options(warn=1);tools:::Rd2pdf_NEWS_in_Rd("NEWS.3.rds", "NEWS.3.pdf")' | \
TEXINPUTS="$(top_srcdir)/share/texmf/tex/latex:$$TEXINPUTS" $(R_EXE); \
TEXINPUTS="$(top_srcdir)/share/texmf/tex/latex:$$TEXINPUTS" $(R_EXE) || rm $^; \
fi

## NEWS.2.html ships as doc/html/NEWS.2.html in the sources.
Expand All @@ -107,24 +107,24 @@ docs2: NEWS.2.rds NEWS.2.html NEWS.2.pdf
NEWS.2.rds: $(srcdir)/NEWS.2.Rd
@$(ECHO) "options(warn=1);saveRDS(tools:::prepare_Rd(tools::parse_Rd(\"$(srcdir)/NEWS.2.Rd\", \
macros = \"../share/Rd/macros/system.Rd\"), stages = 'install', warningCalls = FALSE), \
'NEWS.2.rds')" | $(R_EXE)
'NEWS.2.rds')" | $(R_EXE) || rm $^

## NB: this is only the top part of NEWS.2 in the sources.
NEWS.2: NEWS.2.rds
@$(ECHO) "creating NEWS.2"
@$(ECHO) 'options(warn=1);tools:::Rd2txt_NEWS_in_Rd("NEWS.2.rds", "NEWS.2")' | $(R_EXE)
@$(ECHO) 'options(warn=1);tools:::Rd2txt_NEWS_in_Rd("NEWS.2.rds", "NEWS.2")' | $(R_EXE) || rm $^

NEWS.2.html: NEWS.2.rds
@$(ECHO) "creating NEWS.2.html"
@$(ECHO) 'options(warn=1);tools:::Rd2HTML_NEWS_in_Rd("NEWS.2.rds", "NEWS.2.html")' | $(R_EXE)
@$(ECHO) 'options(warn=1);tools:::Rd2HTML_NEWS_in_Rd("NEWS.2.rds", "NEWS.2.html")' | $(R_EXE) || rm $^

NEWS.2.pdf: NEWS.2.rds
@if test -z "$(PDFLATEX)"; then \
$(ECHO) "'pdflatex' is needed to make NEWS.2.pdf but is missing on your system."; \
else \
$(ECHO) "creating NEWS.2.pdf"; \
$(ECHO) 'options(warn=1);tools:::Rd2pdf_NEWS_in_Rd("NEWS.2.rds", "NEWS.2.pdf")' | \
TEXINPUTS="$(top_srcdir)/share/texmf/tex/latex:$$TEXINPUTS" $(R_EXE); \
TEXINPUTS="$(top_srcdir)/share/texmf/tex/latex:$$TEXINPUTS" $(R_EXE) || rm $^; \
fi


Expand Down
16 changes: 8 additions & 8 deletions doc/Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ all: NEWS.rds html/NEWS.html NEWS NEWS.pdf NEWS.2.rds NEWS.3.rds \
NEWS.rds: NEWS.Rd
@$(ECHO) "options(warn=1);saveRDS(tools:::prepare_Rd(tools::parse_Rd(\"$<\", \
macros = \"../share/Rd/macros/system.Rd\"), stages = \"install\", \
warningCalls = FALSE), \"$@\")" | $(R_EXE)
warningCalls = FALSE), \"$@\")" | $(R_EXE) || rm $^

NEWS.2.rds: NEWS.2.Rd
@$(ECHO) "options(warn=1);saveRDS(tools:::prepare_Rd(tools::parse_Rd(\"$<\", \
macros = \"../share/Rd/macros/system.Rd\"), stages = \"install\", \
warningCalls = FALSE), \"$@\")" | $(R_EXE)
warningCalls = FALSE), \"$@\")" | $(R_EXE) || rm $^

NEWS.3.rds: NEWS.3.Rd
@$(ECHO) "options(warn=1);saveRDS(tools:::prepare_Rd(tools::parse_Rd(\"$<\", \
macros = \"../share/Rd/macros/system.Rd\"), stages = \"install\", \
warningCalls = FALSE), \"$@\")" | $(R_EXE)
warningCalls = FALSE), \"$@\")" | $(R_EXE) || rm $^

CHANGES.rds: ../src/gnuwin32/CHANGES.Rd
@$(ECHO) "options(warn=1);saveRDS(tools:::prepare_Rd(tools::parse_Rd(\"$<\", \
macros = \"../share/Rd/macros/system.Rd\"), stages = \"install\", \
warningCalls = FALSE), \"$@\")" | $(R_EXE)
warningCalls = FALSE), \"$@\")" | $(R_EXE) || rm $^

## Force ASCII output, for portability on Windows
NEWS: NEWS.rds
@$(ECHO) "creating doc/NEWS"
@$(ECHO) "options(warn=1);tools:::Rd2txt_NEWS_in_Rd(\"$<\", \"$@\", \
outputEncoding = \"ASCII//TRANSLIT\")" | $(R_EXE)
outputEncoding = \"ASCII//TRANSLIT\")" | $(R_EXE) || rm $^

## Should be allowed to fail if pdflatex is not available
NEWS.pdf: NEWS.rds
Expand All @@ -45,15 +45,15 @@ NEWS.pdf: NEWS.rds

CHANGES: CHANGES.rds
@$(ECHO) "options(warn=1);tools:::Rd2txt_NEWS_in_Rd(\"$<\", \"$@\", \
outputEncoding = \"ASCII//TRANSLIT\")" | $(R_EXE)
outputEncoding = \"ASCII//TRANSLIT\")" | $(R_EXE) || rm $^

html/NEWS.html: NEWS.rds
@$(ECHO) "options(warn=1);tools:::Rd2HTML_NEWS_in_Rd(\"$<\", \"$@\")" | \
$(R_EXE)
$(R_EXE) || rm $^

html/CHANGES.html: CHANGES.rds
@$(ECHO) "options(warn=1);tools:::Rd2HTML_NEWS_in_Rd(\"$<\", \"$@\")" | \
$(R_EXE)
$(R_EXE) || rm $^

clean:
@rm -f NEWS.rds html/NEWS.html NEWS NEWS.pdf \
Expand Down
3 changes: 3 additions & 0 deletions doc/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@

\item Building the HTML (and Info) versions of the R manuals now
requires \command{texi2any} from \I{Texinfo} 6.1 or later.

\item Failures in building the manuals under \file{doc} now abort
the installation, removing sny file which caused the failure.
}
}

Expand Down
4 changes: 2 additions & 2 deletions doc/manual/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ $(texinputs_BASE): FORCE
"tools:::.Rdnewer(\"$(top_srcdir)/src/library/$${pkg}\", \"$@\")"; then \
$(ECHO) "collecting LaTeX docs for package '$${pkg}' ..."; \
$(ECHO) "tools:::.pkg2tex(\"$(top_builddir)/library/$${pkg}\")" \
| LC_ALL=C $(R_EXE) ; \
| LC_ALL=C $(R_EXE) || rm $^ ; \
fi)
FORCE:

Expand All @@ -201,7 +201,7 @@ $(texinputs_RECOMMENDED): FORCE
-print 2> /dev/null | grep $@ > /dev/null; then :; else \
$(ECHO) "collecting LaTeX docs for package '$${pkg}' ..."; \
$(ECHO) "tools:::.pkg2tex(\"$(top_builddir)/library/$${pkg}\")" \
| LC_ALL=C $(R_EXE) ; \
| LC_ALL=C $(R_EXE) || rm $^ ; \
fi)

version.texi: Makefile $(top_srcdir)/VERSION $(SVN_REV)
Expand Down
2 changes: 1 addition & 1 deletion doc/manual/Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ compact-pdf:
%-pkg.tex: FORCE
@$(ECHO) "collecting LaTeX docs for package \`$*' ..."
@$(ECHO) "tools:::.pkg2tex(\"$(top_srcdir)/library/$*\")" \
| LC_ALL=C $(R_EXE) --vanilla --no-echo
| LC_ALL=C $(R_EXE) --vanilla --no-echo || rm $^
FORCE:

version.texi: Makefile.win $(top_srcdir)/VERSION $(SVN_REV)
Expand Down

0 comments on commit 8f2ce5a

Please sign in to comment.