Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Aug 2007 21:56:29 -0500
From:      Stephen Montgomery-Smith <stephen@math.missouri.edu>
To:        ports@freebsd.org
Subject:   Re: Faster pkg_version
Message-ID:  <46B147DD.3000001@math.missouri.edu>
In-Reply-To: <46B13434.9010301@math.missouri.edu>
References:  <46B13434.9010301@math.missouri.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------000105080309020900070104
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Stephen Montgomery-Smith wrote:
> Here is my next attempt to make a faster pkg_version.  This script is 
> not going to be 100% reliable, but it should work most of the time.  It 
> works by first checking the time difference between 
> /var/db/pkg/*/+CONTENTS and /usr/ports/*/*/Makefile, and only invokes 
> pkg_version if the former is older.

Someone emailed me that it didn't work on their system.  Try this one 
instead.  I also corrected a few other potential issues (like if you run 
my script as root and then press control C, you might mess up your 
database).





--------------000105080309020900070104
Content-Type: text/plain;
 name="pkg-version-quick"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="pkg-version-quick"

#!/usr/bin/make -f

PKG_DBDIR?=/var/db/pkg
PORTSDIR?=/usr/ports

PKG_LIST!= \
	for p in ${PKG_DBDIR}/*/+CONTENTS; do \
		sed -n "s|@comment ORIGIN|$$p|p" $$p; \
	done

all:	${PKG_LIST:C/:.*//}

.for target in ${PKG_LIST}
${target:C/:.*//}::	${PORTSDIR}/${target:C/.*://}/Makefile
	@pkg_version -L'=' -v -s ${target:C|${PKG_DBDIR}/(.*)/\+CONTENTS:.*|\1|}
.endfor

--------------000105080309020900070104--



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