Cerebro Seco

Se faciliter la vie informatique sans sacrifier ses principes!

Aller au contenu | Aller au menu | Aller à la recherche

Upgrading to MacPorts v2.3.0 dodging upgrade bugs.

Tonight I decided to upgrade my dusty MacPorts, and as usual, nothing went as planned. Well, seems that third-party hindrances raised against my innocent intentions.

Upgrading MacPorts is usually a rather simple two-step operation:

$ sudo port selfupdate

then

$ sudo port upgrade outdated

the latter being quite long and power-hungry, depending on your installed ports, since it needs to fecth and compile all the packages from source.

For some reason, though, it seems the access point I was using at the time of the upgrade, the infamous Meraki-issued captive portal decided it was time to lock me out, and instead of downloading the .bz2 archive, it downloaded a .html file. On the one hand, MacPorts apparently was able to recognize it has downloaded something, but not the file it expected. But on the other hand, it could have simply tried to re-fetch the archive, right? Nope. It just sat there, failing the checksum because file wasn't present in the expected location.

Log file shows the problem clearly:

:debug:main Skipping completed org.macports.archivefetch (llvm-3.4)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:main Skipping completed org.macports.fetch (llvm-3.4)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:checksum checksum phase started at Sat Jun 14 23:59:00 EDT 2014
:notice:checksum --->  Verifying checksums for llvm-3.4
:debug:checksum Executing org.macports.checksum (llvm-3.4)
:info:checksum --->  Checksumming llvm-3.4.src.tar.gz
:error:checksum org.macports.checksum for port llvm-3.4 returned: llvm-3.4.src.tar.gz does not exist in /opt/local/var/macports/distfiles/llvm
:debug:checksum Error code: NONE
:debug:checksum Backtrace: llvm-3.4.src.tar.gz does not exist in /opt/local/var/macports/distfiles/llvm
    while executing

Which is inconsistent with what shows up in the Finder:

Capture_d_e_cran_2014-06-15_a__00.04.59.png

What would a good, though not necessarily techie, computer user do? That's right, just follow the message output by the Terminal to open the log file in a Console viewer! Sure there are other ways to access this file, but I found it is the easiest. In such a simple case, turns out it wasn't necessary and that a simple look in printed directory would have revealed the problem easily.

To circumvent MacPorts' apparent inability to recover from non-ideal network conditions, I typed the exact name of the missing package in a search engine, and the very first link sent me directly in the archives of the official website, where I could download the source code, compressed in .tar.gz format, exactly as required. The last step was to open a Finder window and manually reach the destination directory with [Shift]+[cmd]+[G], and type in the path printed in the Terminal, then drag and drop the downloaded file from Downloads. The OS will tell you that's a forbidden operation unless you authenticate – which makes sense, after all you need sudo to perform administrative operations, and tinkering in an obscure root directory surely is one.

Once the file is there, simply relaunch the 

$ sudo port upgrade outdated
command.

Done!