Permalink
Browse files

Accept Launchpad-style "ppa:foo/bar" URLs

  • Loading branch information...
sometimesfood committed Mar 8, 2012
1 parent 7221746 commit b134d79c7173ed972c1b6d734b1c4c8f2da0391a
Showing with 4 additions and 2 deletions.
  1. +4 −2 definitions/apt-repo.rb
View
@@ -44,9 +44,11 @@
directory "/etc/apt/sources.list.d"
- # only add deb-src entries if source_packages parameter was specified
- src_entry = "#{params[:url]} #{distribution} #{components} ##{description}"
+ url = params[:url].gsub(/^ppa:/, '')
+ src_entry = "#{url} #{distribution} #{components} ##{description}"
file_content = "deb #{src_entry}\n"
+
+ # only add deb-src entry if source_packages parameter was specified
file_content << "deb-src #{src_entry}\n" if params[:source_packages]
file "/etc/apt/sources.list.d/#{params[:name]}.list" do

0 comments on commit b134d79

Please sign in to comment.