Makefile: soft-fail on creating extra directories

The extra {completions,functions,conf}.d directories may be placed
outside the writeable prefix. Attempt to create them, but don't abort
the installation if it is not possible.

(There is an argument for not creating these folders at all, but that
reduces their discoverability.)

As discussed in https://github.com/Homebrew/homebrew-core/pull/2813
This commit is contained in:
David Adam 2016-07-09 11:02:50 +08:00
parent 3ca5ca77fa
commit 9abbc5f06c

View file

@ -575,7 +575,8 @@ xcode-install:
# #
# Actually do the installation. These 'true' lines are to prevent installs # Actually do the installation. These 'true' lines are to prevent installs
# from failing for (e.g.) missing man pages. # from failing for (e.g.) missing man pages or extra_dirs outside the
# writeable prefix.
# #
install-force: all install-translations install-force: all install-translations
$(INSTALL) -m 755 -d $(DESTDIR)$(bindir) $(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
@ -587,9 +588,9 @@ install-force: all install-translations
$(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish/conf.d $(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish/conf.d
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/completions $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/completions
$(INSTALL) -m 755 -d $(DESTDIR)$(extra_completionsdir) $(INSTALL) -m 755 -d $(DESTDIR)$(extra_completionsdir); true
$(INSTALL) -m 755 -d $(DESTDIR)$(extra_functionsdir) $(INSTALL) -m 755 -d $(DESTDIR)$(extra_functionsdir); true
$(INSTALL) -m 755 -d $(DESTDIR)$(extra_confdir) $(INSTALL) -m 755 -d $(DESTDIR)$(extra_confdir); true
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/functions $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/functions
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/man/man1 $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/man/man1
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools