install-links Makefile rule
Keri Harris <[email protected]> Sun, 22 Jul 2018 13:18:51 +0200
| Newsgroups | gmane.comp.gnu.prolog.bugs |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --------------20246B783838F5345E2EB39A Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi, The install-links rule in the gprolog Makefile contains a couple of bugs: install-links: uninstall-links if test $(LINKS_DIR) != none; then \ ./mkinstalldirs $(LINKS_DIR); \ (cd $(LINKS_DIR) ; $(LN_S) $(INSTALL_DIR)/bin/* .); \ fi uninstall-links: -if test $(LINKS_DIR) != none; then \ (cd $(LINKS_DIR) 2>/dev/null && rm -f $(BIN_FILES)); \ rmdir $(LINKS_DIR) 2>/dev/null; \ fi || exit 0; 1. install-links uses a wildcard character. This is not expanded by make and instead the single symlink '/path/to/bin/*' is created. If the wildcard character was expanded then we run the risk of creating links to all files in $(INSTALL_DIR)/bin, which would be what we want if $(INSTALL_DIR)/bin points to a populated directory like /usr/bin. 2. install-links depends on uninstall-links Running uninstall-links can be very dangerous. For example, if configure is invoked with the arg --with-links-dir=/usr/bin then the uninstall-links rule will attempt to delete /usr/bin. I don't think that the gprolog install should be attempting to delete anything. I've attached a patch for both of these issues. Thanks Keri --------------20246B783838F5345E2EB39A Content-Type: text/x-patch; name="gprolog-1.4.4-links.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gprolog-1.4.4-links.patch" diff -ur gprolog-1.4.4.orig/src/Makefile.in gprolog-1.4.4/src/Makefile.in --- gprolog-1.4.4.orig/src/Makefile.in 2013-04-23 16:56:44.000000000 +0200 +++ gprolog-1.4.4/src/Makefile.in 2013-05-15 17:00:58.000000000 +0200 @@ -81,10 +81,10 @@ # --- Links --- # -install-links: uninstall-links +install-links: if test $(LINKS_DIR) != none; then \ ./mkinstalldirs $(LINKS_DIR); \ - (cd $(LINKS_DIR) ; $(LN_S) $(INSTALL_DIR)/bin/* .); \ + (cd $(LINKS_DIR); for i in $(BIN_FILES); do $(LN_S) $(INSTALL_DIR)/bin/$$i .; done); \ fi uninstall-links: --------------20246B783838F5345E2EB39A Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Bug-prolog mailing list [email protected] https://lists.gnu.org/mailman/listinfo/bug-prolog --------------20246B783838F5345E2EB39A--