Skip to content

Commit

Permalink
Accept Launchpad-style "ppa:foo/bar" URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
sometimesfood committed Mar 8, 2012
1 parent 7221746 commit b134d79
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions definitions/apt-repo.rb
Expand Up @@ -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
Expand Down

0 comments on commit b134d79

Please sign in to comment.