Skip to content

Commit 8f2ce5a

Browse files
author
ripley
committed
bail out installation if doc conversion failed
git-svn-id: https://svn.r-project.org/R/trunk@87117 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 4af5924 commit 8f2ce5a

File tree

6 files changed

+27
-24
lines changed

6 files changed

+27
-24
lines changed

Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ R: Makefile svnonly
6969
$(ECHO) "you should 'make docs' now ..."
7070

7171
docs: R FORCE
72-
-@(cd doc && $(MAKE) $@)
72+
@(cd doc && $(MAKE) $@)
7373
-@(cd src/library && $(MAKE) $@)
7474
FORCE:
7575

doc/Makefile.in

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ Rscript.1:
5757
NEWS.rds: $(srcdir)/NEWS.Rd
5858
@$(ECHO) "options(warn=1);saveRDS(tools:::prepare_Rd(tools::parse_Rd(\"$(srcdir)/NEWS.Rd\", \
5959
macros = \"../share/Rd/macros/system.Rd\"), stages = 'install', warningCalls = FALSE), \
60-
'NEWS.rds')" | $(R_EXE)
60+
'NEWS.rds')" | $(R_EXE) || rm $^
6161

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

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

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

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

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

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

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

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

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

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

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

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

130130

doc/Makefile.win

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,28 @@ all: NEWS.rds html/NEWS.html NEWS NEWS.pdf NEWS.2.rds NEWS.3.rds \
1414
NEWS.rds: NEWS.Rd
1515
@$(ECHO) "options(warn=1);saveRDS(tools:::prepare_Rd(tools::parse_Rd(\"$<\", \
1616
macros = \"../share/Rd/macros/system.Rd\"), stages = \"install\", \
17-
warningCalls = FALSE), \"$@\")" | $(R_EXE)
17+
warningCalls = FALSE), \"$@\")" | $(R_EXE) || rm $^
1818

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

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

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

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

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

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

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

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

5858
clean:
5959
@rm -f NEWS.rds html/NEWS.html NEWS NEWS.pdf \

doc/NEWS.Rd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@
9797

9898
\item Building the HTML (and Info) versions of the R manuals now
9999
requires \command{texi2any} from \I{Texinfo} 6.1 or later.
100+
101+
\item Failures in building the manuals under \file{doc} now abort
102+
the installation, removing sny file which caused the failure.
100103
}
101104
}
102105

doc/manual/Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ $(texinputs_BASE): FORCE
191191
"tools:::.Rdnewer(\"$(top_srcdir)/src/library/$${pkg}\", \"$@\")"; then \
192192
$(ECHO) "collecting LaTeX docs for package '$${pkg}' ..."; \
193193
$(ECHO) "tools:::.pkg2tex(\"$(top_builddir)/library/$${pkg}\")" \
194-
| LC_ALL=C $(R_EXE) ; \
194+
| LC_ALL=C $(R_EXE) || rm $^ ; \
195195
fi)
196196
FORCE:
197197

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

207207
version.texi: Makefile $(top_srcdir)/VERSION $(SVN_REV)

doc/manual/Makefile.win

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ compact-pdf:
161161
%-pkg.tex: FORCE
162162
@$(ECHO) "collecting LaTeX docs for package \`$*' ..."
163163
@$(ECHO) "tools:::.pkg2tex(\"$(top_srcdir)/library/$*\")" \
164-
| LC_ALL=C $(R_EXE) --vanilla --no-echo
164+
| LC_ALL=C $(R_EXE) --vanilla --no-echo || rm $^
165165
FORCE:
166166

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

0 commit comments

Comments
 (0)