Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Dec 2010 23:09:42 +0000 (UTC)
From:      "Simon L. Nielsen" <simon@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r216575 - head/usr.sbin/portsnap/portsnap
Message-ID:  <201012192309.oBJN9gTv041693@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: simon
Date: Sun Dec 19 23:09:42 2010
New Revision: 216575
URL: http://svn.freebsd.org/changeset/base/216575

Log:
  Add --numeric-owner to tar extract operations in portsnap.
  
  This is done to speed up extraction significantly (both for portsnap
  extract and update) in the case of slow NSS modules (like nss_ldap) as
  it avoids having to look up uid and gid for root / wheel.
  
  The reason this is a bigger problem for portsnap than for many other
  system operations, is that portsnap executes tar(1) once for each port
  so the internal uid/gid caching in tar(1) only helps a bit, resulting
  in many user lookup calls.
  
  Discussed with:	cperciva

Modified:
  head/usr.sbin/portsnap/portsnap/portsnap.sh

Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh
==============================================================================
--- head/usr.sbin/portsnap/portsnap/portsnap.sh	Sun Dec 19 21:51:11 2010	(r216574)
+++ head/usr.sbin/portsnap/portsnap/portsnap.sh	Sun Dec 19 23:09:42 2010	(r216575)
@@ -632,7 +632,7 @@ fetch_snapshot() {
 	fetch -r http://${SERVERNAME}/s/${SNAPSHOTHASH}.tgz || return 1
 
 	echo -n "Extracting snapshot... "
-	tar -xzf ${SNAPSHOTHASH}.tgz snap/ || return 1
+	tar -xz --numeric-owner -f ${SNAPSHOTHASH}.tgz snap/ || return 1
 	rm ${SNAPSHOTHASH}.tgz
 	echo "done."
 
@@ -896,12 +896,12 @@ extract_run() {
 		*/)
 			rm -rf ${PORTSDIR}/${FILE%/}
 			mkdir -p ${PORTSDIR}/${FILE}
-			tar -xzf ${WORKDIR}/files/${HASH}.gz	\
+			tar -xz --numeric-owner -f ${WORKDIR}/files/${HASH}.gz \
 			    -C ${PORTSDIR}/${FILE}
 			;;
 		*)
 			rm -f ${PORTSDIR}/${FILE}
-			tar -xzf ${WORKDIR}/files/${HASH}.gz	\
+			tar -xz --numeric-owner -f ${WORKDIR}/files/${HASH}.gz \
 			    -C ${PORTSDIR} ${FILE}
 			;;
 		esac
@@ -966,11 +966,11 @@ update_run() {
 		case ${FILE} in
 		*/)
 			mkdir -p ${PORTSDIR}/${FILE}
-			tar -xzf ${WORKDIR}/files/${HASH}.gz	\
+			tar -xz --numeric-owner -f ${WORKDIR}/files/${HASH}.gz \
 			    -C ${PORTSDIR}/${FILE}
 			;;
 		*)
-			tar -xzf ${WORKDIR}/files/${HASH}.gz	\
+			tar -xz --numeric-owner -f ${WORKDIR}/files/${HASH}.gz \
 			    -C ${PORTSDIR} ${FILE}
 			;;
 		esac



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