From owner-freebsd-gnome@FreeBSD.ORG Mon Apr 26 02:20:48 2004 Return-Path: Delivered-To: freebsd-gnome@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 67E6816A4CE for ; Mon, 26 Apr 2004 02:20:48 -0700 (PDT) Received: from melusine.cuivre.fr.eu.org (melusine.cuivre.fr.eu.org [82.225.155.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2186843D1F for ; Mon, 26 Apr 2004 02:20:48 -0700 (PDT) (envelope-from thomas@freebsd.org) Received: by melusine.cuivre.fr.eu.org (Postfix, from userid 1000) id 5FCD72A42B; Mon, 26 Apr 2004 11:20:46 +0200 (CEST) Date: Mon, 26 Apr 2004 11:20:46 +0200 From: Thomas Quinot To: gnome@freebsd.org Message-ID: <20040426092046.GA30821@melusine.cuivre.fr.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-message-flag: WARNING! Using Outlook can damage your computer. User-Agent: Mutt/1.5.6i Subject: Speeding up gnome2 installation X-BeenThere: freebsd-gnome@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: GNOME for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2004 09:20:48 -0000 The pkg-install script for gnome currently runs pkg_info in a loop, which is costly if many packages are stored under /usr/ports/packages. I'd like to suggest that pkg_info be run only once and its output stored in a temp file, to make the installation quicker. Please review the attached patch. Thanks! Thomas. cvs diff: Diffing . Index: pkg-install =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/ports/x11/gnome2/pkg-install,v retrieving revision 1.9 diff -u -r1.9 pkg-install --- pkg-install 5 Apr 2004 03:11:31 -0000 1.9 +++ pkg-install 26 Apr 2004 09:17:14 -0000 @@ -3,10 +3,15 @@ PATH=3D/bin:/usr/bin:/sbin:/usr/sbin:${PATH} export PATH =20 +tmp_pkg_info=3D`mktemp -t gnome_install_pkg_info` +trap "rm -f ${tmp_pkg_info}" 0 + +pkg_info > ${tmp_pkg_info} + if [ "$2" =3D "PRE-INSTALL" ]; then GNOME_ONE_DESKTOP=3D"gnomecore gnomeapplets gnomemedia gnomeutils gto= p libgtop sawfish nautilus gedit xalf bugbuddy gnomegames gdm eog ggv gnome= audio" for package in ${GNOME_ONE_DESKTOP}; do - if pkg_info | grep "^${package}-[0-9]" >/dev/null 2>&1; then + if grep "^${package}-[0-9]" ${tmp_pkg_info} >/dev/null 2>&1; then echo "${package} was detected on the system. This package is part o= f the GNOME 1.x" echo "desktop, and cannot coexist with the GNOME 2.2 desktop." echo "" --=20 Thomas.Quinot@Cuivre.FR.EU.ORG