Skip to content

Instantly share code, notes, and snippets.

@btm
Created June 11, 2013 18:12
Show Gist options
  • Save btm/5759302 to your computer and use it in GitHub Desktop.
Save btm/5759302 to your computer and use it in GitHub Desktop.
portsnap update
if File.exists?("/usr/ports")
execute "Update Ports Tree" do
command <<-EOS
sed -e 's/\\[ ! -t 0 \\]/false/' /usr/sbin/portsnap > /tmp/portsnap
chmod +x /tmp/portsnap
/tmp/portsnap update
EOS
end
else
execute "Create Ports Tree" do
command <<-EOS
sed -e 's/\\[ ! -t 0 \\]/false/' /usr/sbin/portsnap > /tmp/portsnap
chmod +x /tmp/portsnap
/tmp/portsnap fetch extract
EOS
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment