Just like this guy when trying to do $ port selfupdate I’d get errors like:

Selfupdate failed: couldn't open
".../var/db/dports/sources/rsync.rsync.opendarwin.org_dpupdate1/base/dp_version":
no such file or directory

The problem is that my macports version is very old and after an rsync dp_version is now in base/config rather than just base. Furthermore because the rsync happens before you check dp_config putting in a symlink or just copying the file over won’t work as it gets deleted again before it is checked. The solution I found was to edit /Library/Tcl/darwinports1.0/darwinports.tcl and find this bit of code:

# get new darwinports version and write the old version back
set fd [open [file join $dp_base_path dp_version] r]
gets $fd dp_version_new
close $fd
ui_msg "New DarwinPorts base version $dp_version_new"

Then change the first line after the comment so that it reads (i.e. insert ‘config’):

# get new darwinports version and write the old version back
set fd [open [file join $dp_base_path config dp_version] r]
gets $fd dp_version_new
close $fd
ui_msg "New DarwinPorts base version $dp_version_new"

And hey presto! selfupdate now works.

7 Responses to “Problems with selfupdate when updating a very old macports”

  1. Michael Guterl Says:

    Excellent. This was just what I was looking for.

    Thanks so much!

  2. Nick Says:

    Ditto.

    Thanks!

  3. Jack Loveless Says:

    Thanks so much - worked like a charm.

  4. DarwinPorts/MacPorts Selfupdate Says:

    […] (Lösung gefunden bei: miscellaneous factZ) […]

  5. elmex Says:

    Thanks so much, without your help i was not able to selfupdate my ports!

  6. manuel.blanc@ Says:

    Thanks!

  7. Kat Says:

    Perfect… exactly what I was looking for. Thanks!!

Leave a Reply