summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-08-08 19:03:39 -0400
committerBen Gamari <ben@smart-cactus.org>2022-08-10 09:07:15 -0400
commitb2faa987c39bf344f5a4caba7c146cf01c00c306 (patch)
tree2fdface88eebb0550778512a6dfe0cb03959283d
parent823fe5b56450a7eefbf41ce8ece34095bf2217ee (diff)
downloadhaskell-wip/T21976.tar.gz
hadrian: Don't attempt to install documentation if doc/ doesn't existwip/T21976
Previously we would attempt to install documentation even if the `doc` directory doesn't exist (e.g. due to `--docs=none`). This would result in the surprising side-effect of the entire contents of the bindist being installed in the destination documentation directory. Fix this. Fixes #21976.
-rw-r--r--hadrian/bindist/Makefile10
1 files changed, 6 insertions, 4 deletions
diff --git a/hadrian/bindist/Makefile b/hadrian/bindist/Makefile
index 5159558c5f..a62cdca797 100644
--- a/hadrian/bindist/Makefile
+++ b/hadrian/bindist/Makefile
@@ -184,10 +184,12 @@ install_lib: lib/settings
install_docs:
@echo "Copying docs to $(DESTDIR)$(docdir)"
$(INSTALL_DIR) "$(DESTDIR)$(docdir)"
- cd doc; $(FIND) . -type f -exec sh -c \
- '$(INSTALL_DIR) "$(DESTDIR)$(docdir)/`dirname $$1`" && \
- $(INSTALL_DATA) "$$1" "$(DESTDIR)$(docdir)/`dirname $$1`" \
- ' sh '{}' \;
+
+ if [ -d doc ]; then \
+ cd doc; $(FIND) . -type f -exec sh -c \
+ '$(INSTALL_DIR) "$(DESTDIR)$(docdir)/`dirname $$1`" && $(INSTALL_DATA) "$$1" "$(DESTDIR)$(docdir)/`dirname $$1`"' \
+ sh '{}' ';'; \
+ fi
if [ -d docs-utils ]; then \
$(INSTALL_DIR) "$(DESTDIR)$(docdir)/html/libraries/"; \