[Git][ghc/ghc][wip/T21976] hadrian: Don't attempt to install documentation if doc/ doesn't exist

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Wed Aug 10 04:52:22 UTC 2022



Ben Gamari pushed to branch wip/T21976 at Glasgow Haskell Compiler / GHC


Commits:
3fd2b56c by Ben Gamari at 2022-08-10T00:52:17-04:00
hadrian: Don't attempt to install documentation if doc/ doesn't exist

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.

- - - - -


1 changed file:

- hadrian/bindist/Makefile


Changes:

=====================================
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/"; \



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3fd2b56c0e3432fe94b3b9e30cf8a1b2fd740553

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3fd2b56c0e3432fe94b3b9e30cf8a1b2fd740553
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20220810/115655d8/attachment-0001.html>


More information about the ghc-commits mailing list