Created
May 12, 2009 16:09
-
-
Save mnutt/110555 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env ruby | |
port_list = `port installed` | |
port_list.each_line do |port_line| | |
port_line =~ / ([^\s]+) @([^\+\s]+)(\+?[^\s]*)/ | |
name, version, variants = $1, $2, $3 | |
next if name.nil? | |
variants = variants.split('+') rescue [] | |
puts "sudo port install #{name} #{variants.map{|v| " +"+v unless v == '' }.join}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment