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 _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"