pkg_upgrade (was Re: pkg_add does not backtrack, does it?)

Michel Talon talon at
Fri Feb 9 18:22:14 UTC 2007

youshi10 wrote :

> > Personally, I think that's cool, but it does means it won't go into
> > the base system. Portupgrade would probably be in the base system if
> > it were written in a language in the base system.
> >
> > 	<mike
> > --
> > Mike Meyer <mwm at>
> >
> > Independent Network/Unix/Perforce consultant, email for more
> > information.
> Would perl be close enough to count, or would it have to be C/C++?

I think that such a tool, once debugged, and if people find it
convenient, should be written in C++. The reason is that such a tool
naturally uses a lot of dictionaries and similar data structures which 
are in the STL. So i think the translation from python to C++ would not
be too terrible. I hope to do it later on if it is valuable.

For the moment being i have fixed some little problems i had with and i have finally found a bug which was such that far too
many ports were compiled. The bug was in function to_have() which was
completely incorrect.

With this correction, this is the sort of result i get on my machine:
niobe% ./pkgupgrade 
There are now 621 packages installed.

Here i have shunted first phase for debugging.

Second phase, downloads and backups.
Total time spent in backups:  00 minutes 22 seconds.
Total time spent in downloads:  08 minutes 17 seconds.
Writing upgrade shell script.
Will remove 391 old packages.
Will install 465 new binary packages.
Will compile 11 ports.
All tasks completed.
Total time:  09 minutes 12 seconds.

So only 11 ports have to be compiled! Of course it retreived a lot more
packages, which explains the longer download time.

I have replaced the corrected on my website, and will
replace pkgupgrade tomorrow after a further check.


Michel TALON

More information about the freebsd-hackers mailing list