From e3784987fce98bf3c8c6cc40e73bb6c9582c0696 Mon Sep 17 00:00:00 2001 From: Nan Liu Date: Wed, 9 May 2012 11:50:43 -0700 Subject: [PATCH] Fix dependency issues introduced with anchor. apt::ppa and apt::builddep requires apt class. The anchor introduced for containment of apt-get update causes a dependency loop. apt::ppa appears to depend on apt class sources.d direcory. While apt::builddep have no clear reason for a dependency on apt class. This change refactor both define type, so they no longer cause a dependency loop. --- manifests/builddep.pp | 2 -- manifests/ppa.pp | 6 ++---- spec/defines/ppa_spec.rb | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/manifests/builddep.pp b/manifests/builddep.pp index ce9d8fd..997a206 100644 --- a/manifests/builddep.pp +++ b/manifests/builddep.pp @@ -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'], diff --git a/manifests/ppa.pp b/manifests/ppa.pp index 578c81d..64c65bb 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -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'], } diff --git a/spec/defines/ppa_spec.rb b/spec/defines/ppa_spec.rb index ab86b93..d57c1fb 100644 --- a/spec/defines/ppa_spec.rb +++ b/spec/defines/ppa_spec.rb @@ -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]" ) } -- 2.45.2