Created
September 30, 2009 01:59
-
-
Save eqhmcow/197635 to your computer and use it in GitHub Desktop.
This automates (more or less) the process described at http://trac.macports.org/wiki/Migration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This automates (more or less) the process described at http://trac.macports.org/wiki/Migration | |
export PATH=/opt/local/bin:/opt/local/sbin:$PATH | |
port installed active | /usr/bin/perl -p -e 'undef $_ unless $b++; # the first line is info for humans | |
s/^\s*(.*)\s*\(active\).*/$1/; s/\s\@[^+\n]+//; # remove (active) and the version number | |
s/(\+[^+\n]+)/ $1/g' > active.macports # put spaces before each + | |
port clean --all all | |
port -f uninstall installed | |
# I'm sure there's a better way to do this, but it works... | |
IFS=$'\n'; /bin/cat active.macports | while read i; do /bin/bash -c "port install $i"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment