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

Re: CVS: cvs.openbsd.org: src



> > > 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 ?
> > 
> > as long as this is controllable via rc.conf, i have no problem with it.
> 
> Yes, in retrospect I guess that's the best approach.

Here's a revised patch - with an rc.conf knob that defaults to NO.

> > 			Eric

-- 
Brian <brian@Awfulhak.org>                        <brian@[uk.]FreeBSD.org>
      <http://www.Awfulhak.org>                   <brian@[uk.]OpenBSD.org>
Don't _EVER_ lose your sense of humour !

Index: rc.conf
===================================================================
RCS file: /cvs/src/etc/rc.conf,v
retrieving revision 1.58
diff -u -r1.58 rc.conf
--- rc.conf	2001/05/02 02:41:26	1.58
+++ rc.conf	2001/05/22 01:37:24
@@ -58,6 +58,7 @@
 check_quotas=YES	# NO may be desirable in some YP environments
 ntpd=YES		# run ntpd if it exists
 afs=NO			# mount and run afs
+ports_check=NO		# Check weekly for out-of-date ports
 
 # Multicast routing configuration
 # Please look at /etc/netstart for a detailed description if you change these
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/22 01:59:42
@@ -6,6 +6,9 @@
 PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec
 export PATH
 
+# pick up option configuration
+. /etc/rc.conf
+
 if [ -f /etc/weekly.local ];then
 	echo ""
 	echo "Running weekly.local:"
@@ -39,6 +42,16 @@
 	fi
 else
 	echo "Not rebuilding locate database; no /var/db/locate.database"
+fi
+
+if [ ."$ports_check" = .YES -a -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 ""