Why does portsdb -Uu run so long?

Nikolas Britton nikolas.britton at gmail.com
Sat Feb 4 08:14:58 PST 2006

On 2/4/06, Xn Nooby <xnooby at gmail.com> wrote:
> > It just does, after you cvsup new ports cd into /usr/ports and type
> > make fetchindex. what way is the "old foolproof way"?
> >
> Here is how I update my system (without using a 'make fetchindex')
>   cvsup -g -L 2 /root/stable-supfile
>   less UPDATING
>   make buildworld
>   make buildkernel
>   make installkernel
>   shutdown now
>   cd /usr/src
>   make installworld
>   mergemaster
>   shutdown -r now
>   portsdb -Uu
>   portversion -l "<"
>    portupgrade -arR
>   reboot
> It takes forever, but it works everytime.  Everything else I've ever tried
> has always had some kind of error, and I never know what they mean or what I
> should do.
> Maybe by never doing a fetchindex, I've never really updated my system, and
> thats why its never had a problem, lol. That would be embarassing.

No, If I remember right (someone step in if I'm wrong) make fetchindex
is what you would get if you ran portsdb -Uu.

By the looks of it when you cvsup you get everything (src-all,
ports-all, etc) all at once. I think it might be better if you split
that into two sup-files where you would have one for the system,
src-all, and the other one for ports. This way you don't have to
rebuild the system every time you update your ports, this also works
the other way around. Once a branch is cut and declared -STABLE the
libraries used to make your programs work are rarely changed, If it
does change they will tell you in /usr/src/UPDATING. For the sake of
troubleshooting it helps if you don't change everything all at once.

This is what I, generally, do when updating ports:

1. cvsup -g -L 2 ~/ports-supfile
2. cd /usr/ports; make fetchindex
3. more UPDATING
4. pkg_version | grep "<"
5. nice +20 portupgrade -rRW pkgname_glob
Repeat steps 4 and 5 until done.
6. portsclean -CDD (optional)

On my home system I typically do this once a week starting with step 1
on Saturday and then upgrading the ports at my leisure over the course
of the week. Right now I have 'portsclean -C; nice +20 portupgrade
-rfWw "expat*"' running in the background, why you ask? The reason is
in /usr/ports/UPDATING, you must always read this file before you
upgrade your ports. And the way I clean, or don't clean, ports
probably looks erratic but I have my reasons, they are mostly just to
save time.

One thing I have noticed, and stopped doing, is changing the default
values for CFLAGS and CXXFLAGS via /etc/make.conf. It's easy to screw
up the stability of your system if you set them and then use automated
tools such as portupgrade. Also of note is not setting CPUTYPE too
high in make.conf, I have a p4 but I set it to p2. You can set
individual build options for each port in pkg-tools.conf located in
/usr/local/etc but I like to set them in make.conf because the build
options are set in stone then, make will always use these options
regardless of how or who built the port. You can do this with a simple
.if .endif block, two examples from one of my 5.4 servers are below:

.if ${.CURDIR:M*/lang/php4}

.if ${.CURDIR:M*/net/samba3}

More information about the freebsd-questions mailing list