portversion and pkg_version have different opinions on current versions

Doug Barton dougb at FreeBSD.org
Sat Aug 15 16:30:29 UTC 2009


Thomas Backman wrote:
> First off: not subscribed to this list, please make sure to Cc me or I
> won't see your answers! :)
> 
> Oh, and I use portsnap, in crontab:
> 0 19 * * *  portsnap -I cron update
> 
> So, long story short:
> 
> [root at chaos ~]# pkgdb -aF
> --->  Checking the package registry database
> [root at chaos ~]# portversion -l '<'
> dnsmasq                     <
> ezm3                        <
> libtool                     <
> python26                    <
> [root at chaos ~]# pkg_version | awk '$2 !~ /=/'
> [root at chaos ~]# portupgrade -a
> [root at chaos ~]#

Off hand I'd say this looks like your pkgdb might be corrupt or out of
sync, but I am far from an expert in portupgrade.

> ... How do I figure out which is correct,

pkg_version is authoritative since by default it checks the version of
what you have installed against what's in the port's Makefile. Nick
was right and you can just use the following:

pkg_version -L '='

> and which/what should I use in
> my crontab to check for out-of-date packages?

If you want to run it every night after portsnap runs I'd just add "&&
pkg_version -L '='" to the end of your crontab. If you want a little
nicer output there is a periodic script to check package status. You
could copy the lines about 400.status-pkg from
/etc/defaults/periodic.conf to /etc/periodic.conf, enable it there,
and then do: && /etc/periodic/weekly/400.status-pkg at the end of your
crontab line.

> I'm pretty new to FreeBSD

Welcome!

> (testing use since May, but I've used it briefly before), but have
> almost 10 years of Linux experience, mostly Gentoo, so I'm not new to
> *nix-like OS's, not to mention that Gentoo's portage is based on FreeBSD
> ports - except that it has an official interface (i.e. emerge), rather
> than portupgrade, portmaster, portmanager, etc. A bit of a mess in my
> outsider opinion. ;)

One person's mess is another person's freedom of choice. :)  Each of
those tools has its positives and negatives, and each of them has a
user base that is happy with the tool.

In any case, hope that answers your question and good luck!


Doug

-- 

    This .signature sanitized for your protection



More information about the freebsd-ports mailing list