[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CVS: cvs.openbsd.org: src
Brian Somers <brian@Awfulhak.org> wrote:
> 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 ?
Is the INDEX always supposed to be up to date? Actually often it isn't
updated for weeks, if not months, and people who regularly update their
trees will have newer packages installed than these in the INDEX. What
if one has updated his/her INDEX locally only? I think this is
> 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"
> +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'
> echo ""
> echo "Rebuilding whatis databases:"
Also, I don't think /usr/ports can be hardcoded as the PORTSDIR (see
bsd.port.mk). People like me use other directories, and everything
has to work in that case, i.e. we don't have /usr/ports but we do have
ports trees. Well, I admit this is not the biggest concern.