Thursday, October 22, 2015

Downgrading a Package in MacPorts

MacPorts installed a new version of XEmacs and it broke things. So instead of fixing it I just went back to the previous version.

Here's how I did it:

  1. Create a local repository in ~/lib/macports/local:

    % mkdir ~/lib/macports/local

  2. Add the local repository to /opt/local/etc/macports/sources.conf:

    file:///Users/jim/lib/macports/local

  3. Find the previous revision of XEmacs:

    % svn log http://svn.macports.org/repository/macports/trunk/dports/editors/xemacs

    It's r141410.

  4. Check it out (into ~/lib/macports/local):

    % svn co --revision r141410 http://svn.macports.org/repository/macports/trunk/dports/editors/xemacs/ editors/xemacs/

  5. Run portindex on the local repository:

    % portindex ~/lib/macports/local

    It should report: "Ports successfully parsed: 1"

  6. Now port list xemacs shows both versions.

    xemacs  @21.4.22  editors/xemacs
    xemacs  @21.5.16  editors/xemacs


  7. Install the local version

    # port install xemacs @21.4.22

That's it.