[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CVS: cvs.openbsd.org: src



> CVSROOT:	/cvs
> Module name:	src
> Changes by:	brian@cvs.openbsd.org	2001/05/21 10:47:51
> 
> Modified files:
> 	usr.sbin/pkg_install: Makefile 
> Added files:
> 	usr.sbin/pkg_install/version: Makefile pkg_version.1 
> 	                              pkg_version.pl 
> 
> Log message:
> Add pkg_version from FreeBSD (modulo the PORT_REVISION stuff)

I'd like to add the following to /etc/weekly.  Does anyone have any 
objections ?  The down-side is that people who install the ports 
collection but don't update their system very frequently suffer the 
wasted processing time.  An alternative might be to maintain a touch 
file (/var/db/pkg_version_check ?) and compare it's time against 
/usr/ports/INDEX.  If the touch file is older (or doesn't exist), 
touch it and do the check.

Comments ?

Index: weekly
===================================================================
RCS file: /cvs/src/etc/weekly,v
retrieving revision 1.10
diff -u -r1.10 weekly
--- weekly	1999/09/19 23:15:28	1.10
+++ weekly	2001/05/21 14:42:40
@@ -41,6 +41,16 @@
 	echo "Not rebuilding locate database; no /var/db/locate.database"
 fi
 
+if [ -f /usr/ports/INDEX ]; then
+	echo ""
+	echo "Checking for out of date packages:"
+	pkg_version -v |
+	    sed -n -e 's/^\([^ ]*\)  *<  */  \1 /p' \
+	    -e '/^[^ ]*-\([^ ]*\)  *\* *multiple versions.*[ ,]\1[,)].*/d' \
+	    -e 's/^\([^ ]*\)  *\* *multiple versions.*\((.*\)/  \1 needs updating \2/p' \
+	    -e 's/^\([^ ]*-[^ ]*\)  *? *unknown in index/  \1 is obsolete/p'
+fi
+
 echo ""
 echo "Rebuilding whatis databases:"
 makewhatis