[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CVS: cvs.openbsd.org: src
Brian Somers <brian@Awfulhak.org> wrote:
> Here's a revised patch - with an rc.conf knob that defaults to NO.
..
> +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
I did not see what exactly pkg_version did by the time it was in, but
if you still want to apply the above weekly check, I suppose you can use
something similar to:
pkg_info -e pkgname\* | awk -F'-' '{print $2}'
to get a package's version number. The fields are not unique for the
above pattern, but the idea is pkg_info(1)'s -e option -- from there on,
you should be easily able to tweak the output to fit your needs.