summaryrefslogtreecommitdiffstats
path: root/office/texlive/branch2011/19-import_cautious_create_remove_man_link.patch
blob: a4cc7d0b9f7a293dede07a248b5fcdbf9888ab4f (plain)
r24766 | peter | 2011-12-05 12:23:16 +0000 (Mon, 05 Dec 2011) | 2 lines

branch2011: import more cautious creation and removal of man link
from trunk r24727, r24728, and r24765

Index: Build/source/texk/texlive/linked_scripts/Makefile.in
===================================================================
--- Build/source/texk/texlive/linked_scripts/Makefile.in	(revision 24461)
+++ Build/source/texk/texlive/linked_scripts/Makefile.in	(revision 24766)
@@ -650,10 +650,12 @@
 	    echo "creating link '$$link' -> '$$file'"; \
 	    $(LN_S) $$file $$link || exit 1; \
 	  done && \
-	  rm -f man && \
-	  if test -d $(REL)/texmf/doc/man; then \
-	    echo "creating link 'man' -> '$(REL)/texmf/doc/man'" && \
-	    (ln -s $(REL)/texmf/doc/man man || :); \
+	  if test -d "$$REL/texmf/doc/man" \
+	     && test -z "$(TL_INSTALL_OMIT_MAN_LINK)" \
+	     && (test -h man || test ! -e man); then \
+	    echo "creating link 'man' -> '$$REL/texmf/doc/man'"; \
+	    rm -f man; \
+	    (ln -s "$$REL/texmf/doc/man" man || :); \
 	  else :; fi
 
 uninstall-hook:
@@ -667,7 +669,9 @@
 	  link=`echo $$s | sed 's,.*:,,'`; \
 	  rm -f $(DESTDIR)$(bindir)/$$link$(WINEXT); \
 	done
-@WIN32_FALSE@	rm -f $(DESTDIR)$(bindir)/man
+@WIN32_FALSE@	if test -h $(DESTDIR)$(bindir)/man; then \
+@WIN32_FALSE@	  rm -f $(DESTDIR)$(bindir)/man; \
+@WIN32_FALSE@	else :; fi
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
Index: Build/source/texk/texlive/linked_scripts/ChangeLog
===================================================================
--- Build/source/texk/texlive/linked_scripts/ChangeLog	(revision 24461)
+++ Build/source/texk/texlive/linked_scripts/ChangeLog	(revision 24766)
@@ -1,3 +1,13 @@
+2011-12-05  Peter Breitenlohner  <peb@mppmu.mpg.de>
+
+	* Makefile.am (uninstall-hook): Only remove man if it is a link.
+
+2011-12-03  Karl Berry  <karl@tug.org>
+
+	* Makefile.am (install-data-hook): only create the man link if it
+	is a link already, and if TL_INSTALL_OMIT_MAN_LINK is unset
+	in the environment.  Report from Bruce Dubbs, 18 Nov 2011 18:56:22.
+
 2011-05-30  Peter Breitenlohner  <peb@mppmu.mpg.de>
 
 	* Makefile.am (bin_links): Move mpost:metafun and mpost:mfplain
Index: Build/source/texk/texlive/linked_scripts/Makefile.am
===================================================================
--- Build/source/texk/texlive/linked_scripts/Makefile.am	(revision 24461)
+++ Build/source/texk/texlive/linked_scripts/Makefile.am	(revision 24766)
@@ -199,12 +199,15 @@
 	    echo "creating link '$$link' -> '$$file'"; \
 	    $(LN_S) $$file $$link || exit 1; \
 	  done && \
-	  rm -f man && \
-	  if test -d $(REL)/texmf/doc/man; then \
-	    echo "creating link 'man' -> '$(REL)/texmf/doc/man'" && \
-	    (ln -s $(REL)/texmf/doc/man man || :); \
+	  if test -d "$$REL/texmf/doc/man" \
+	     && test -z "$(TL_INSTALL_OMIT_MAN_LINK)" \
+	     && (test -h man || test ! -e man); then \
+	    echo "creating link 'man' -> '$$REL/texmf/doc/man'"; \
+	    rm -f man; \
+	    (ln -s "$$REL/texmf/doc/man" man || :); \
 	  else :; fi
-## man dir link for those mans which can use it.
+## man dir link for those mans which can use it, but don't overwrite a
+## real file, e.g., /usr/bin/man.
 
 ## For WIN32 (MinGW or native) we have wrapper binaries with .exe,
 ## for Cygwin and Unix we have symlinks without .exe.
@@ -224,6 +227,8 @@
 	  rm -f $(DESTDIR)$(bindir)/$$link$(WINEXT); \
 	done
 if !WIN32
-	rm -f $(DESTDIR)$(bindir)/man
+	if test -h $(DESTDIR)$(bindir)/man; then \
+	  rm -f $(DESTDIR)$(bindir)/man; \
+	else :; fi
 endif !WIN32