From owner-svn-src-all@FreeBSD.ORG Sun Dec 19 23:09:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC729106566C; Sun, 19 Dec 2010 23:09:42 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B056B8FC08; Sun, 19 Dec 2010 23:09:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBJN9g8v041695; Sun, 19 Dec 2010 23:09:42 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBJN9gTv041693; Sun, 19 Dec 2010 23:09:42 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201012192309.oBJN9gTv041693@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 19 Dec 2010 23:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216575 - head/usr.sbin/portsnap/portsnap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Dec 2010 23:09:43 -0000 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