Keeping selected ports to a previous version

Ken Cunningham ken.cunningham.webuse at
Mon Jul 2 18:07:06 UTC 2018

The full description is here <>, but there is a crucial concept to get.

Macports will search for a Portfile in the list of repositories, in order, specified in sources.conf.

The FIRST one it finds that meets the search criteria is the one it uses.

So you should list these in the order you want them searched.

Each repository needs to have the proper structure -- a main folder, with subfolders that match MacPorts' repo structure, and then ports in there.

After modifying a given repo, you need to run "portindex" at the head folder of that repository to update the index.

So I sometimes have three or four repos shadowing each other:

1. Ports I'm testing first
2. Ports I may have that aren't published second
3. My "settled" repos of pegged ports for each OS (eg LeopardPorts).
4. The main MacPorts repo.

You turn these repos on and off by commenting out the line in sources.conf that specifies them.

When MacPorts gets and instruction that involves a port, e.g. "sudo port install gimp" it searches those repos in order 1, 2, 3, 4 and uses the FIRST one it finds.

So the main macports repo is ALWAYS available as the fallback. The other repos are only used if you have overridden (or "shadowed") a port.

It's a powerful system, but you must keep your wits about you. It would be somewhat embarrassing to see tickets that turn out to be caused by one's own shenanigans doing this.



More information about the macports-users mailing list