Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jan 2013 20:21:31 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r245571 - head/etc
Message-ID:  <201301172021.r0HKLVVK082420@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Thu Jan 17 20:21:30 2013
New Revision: 245571
URL: http://svnweb.freebsd.org/changeset/base/245571

Log:
  In preparation for logging metadata about each filesystem object
  refactor the link section of distrib-dirs to alwasy install to a full
  path (the link contents remain relative as they should).
  
  Eliminate the use of the "rm -r[f] <foo>; ln -s <bar> <foo>" pattern in
  favor of "ln -sf <bar> <foo>".  None of these links could be directories
  on a system installed in the last decade.
  
  Sponsored by:	DARPA, AFRL
  Reviewed by:	mtree

Modified:
  head/etc/Makefile

Modified: head/etc/Makefile
==============================================================================
--- head/etc/Makefile	Thu Jan 17 19:27:12 2013	(r245570)
+++ head/etc/Makefile	Thu Jan 17 20:21:30 2013	(r245571)
@@ -324,32 +324,26 @@ distrib-dirs:
 		    -f $$m -p $$d; \
 		${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
 	done; true
-	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
-	cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
-	cd ${DESTDIR}/usr/share/man/en.UTF-8; ln -sf ../man* .
+	ln -sf usr/src/sys ${DESTDIR}/sys
 	cd ${DESTDIR}/usr/share/man; \
-	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
-	while [ $$# -gt 0 ] ; \
-	do \
-		rm -rf "$$1"; \
-		ln -s "$$2" "$$1"; \
-		shift; shift; \
+	for mandir in man*; do \
+		ln -sf ../$$mandir ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
+		ln -sf ../$$mandir ${DESTDIR}/usr/share/man/en.UTF-8/; \
 	done
 	cd ${DESTDIR}/usr/share/openssl/man; \
+	for mandir in man*; do \
+		ln -sf ../$$mandir \
+		    ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
+	done
 	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
-	while [ $$# -gt 0 ] ; \
-	do \
-		rm -rf "$$1"; \
-		ln -s "$$2" "$$1"; \
+	while [ $$# -gt 0 ] ; do \
+		ln -sf "$$2" "${DESTDIR}/usr/share/man/$$1"; \
+		ln -sf "$$2" "${DESTDIR}/usr/share/openssl/man/$$1"; \
 		shift; shift; \
 	done
-	cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ln -sf ../man* .
-	cd ${DESTDIR}/usr/share/nls; \
 	set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
-	while [ $$# -gt 0 ] ; \
-	do \
-		rm -rf "$$1"; \
-		ln -s "$$2" "$$1"; \
+	while [ $$# -gt 0 ] ; do \
+		ln -sf "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
 		shift; shift; \
 	done
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301172021.r0HKLVVK082420>