portupgrade O(n^m)? and pkgupgrade

Michel Talon talon at lpthe.jussieu.fr
Thu Feb 15 16:53:39 UTC 2007

As a tentative solution to the problem in the subject, i have corrected
still more bugs in my program pkguprade. The last version is at

I had observed on my own machine two problems, one being that the
topological sort was scrambled, this i have discovered was due to a bad
use of the python sort() function (although i don't understand clearly
why the syntax was bad), the other had to do with ports being moved in
the MOVED files and whose moves were accounted incorrectly. This is 
a hairy problem with the FreeBSD ports sytem.

As an example of running pkgupgrade, here is what i get after having
upgraded the port tree from 6.2-RELEASE to current:
niobe% ./pkgupgrade
There are now 711 packages installed.
Collecting installed packages.
Building the updated index.
Building and filling the dependency DAG.
Printing the upgrade list in UpgradeLog
Total time spent in analysis:  01 minutes 29 seconds.
Second phase, downloads and backups.
Total time spent in downloads:  00 minutes 13 seconds.
Total time spent in backups:  00 minutes 15 seconds.
Writing upgrade shell script.
Will remove 3 old packages.
Will install 17 new binary packages.
Will compile 8 ports.
All tasks completed.
Total time:  01 minutes 53 seconds.
At first sight, the shell script which has been produced, UpgradeShell
seems reasonable. Of course such a program can only gain very good
reliability by testing, but testing is always dangerous ..., except
perhaps on testing machines, but i don't have any.


Michel TALON

More information about the freebsd-hackers mailing list