Merge pull request #58 from nanliu/tb/ppa

Fix dependency issues introduced with anchor.
This commit is contained in:
Ryan Coleman 2012-05-09 13:12:42 -07:00
commit a2422f7f7b
4 changed files with 7 additions and 18 deletions

View file

@ -3,8 +3,6 @@
define apt::builddep() {
include apt::update
Class['apt'] -> Apt::Builddep[$name]
exec { "apt-builddep-${name}":
command => "/usr/bin/apt-get -y --force-yes build-dep ${name}",
notify => Exec['apt_update'],

View file

@ -3,9 +3,6 @@
define apt::ppa(
$release = $::lsbdistcodename
) {
Class['apt'] -> Apt::Ppa[$title]
include apt::params
include apt::update
@ -26,7 +23,8 @@ define apt::ppa(
exec { "add-apt-repository-${name}":
command => "/usr/bin/add-apt-repository ${name}",
creates => "${sources_list_d}/${sources_list_d_filename}",
require => Package['python-software-properties'],
require => [ File[$sources_list_d],
Package['python-software-properties'] ],
notify => Exec['apt_update'],
}

View file

@ -3,22 +3,15 @@ describe 'apt::builddep', :type => :define do
let(:title) { 'my_package' }
describe "should succeed with a Class['apt']" do
let(:pre_condition) { 'class {"apt": } ' }
describe "should require apt-get update" do
it { should contain_exec("apt_update").with({
'command' => "/usr/bin/apt-get update",
'refreshonly' => true
})
}
end
describe "should fail without Class['apt']" do
it { expect {should contain_exec("apt-update-#{title}").with({
'command' => "/usr/bin/apt-get update",
'refreshonly' => true
}).to raise_error(Puppet::Error)
}
it { should contain_anchor("apt::builddep::my_package").with({
'require' => 'Class[Apt::Update]',
})
}
end

View file

@ -29,7 +29,7 @@ describe 'apt::ppa', :type => :define do
it { should contain_exec("add-apt-repository-#{t}").with(
'command' => "/usr/bin/add-apt-repository #{t}",
'creates' => "/etc/apt/sources.list.d/#{filename}",
'require' => "Package[python-software-properties]",
'require' => ["File[/etc/apt/sources.list.d]", "Package[python-software-properties]"],
'notify' => "Exec[apt_update]"
)
}