(#11966) Update apt::ppa to use apt::update.
Change apt::ppa define type to also use the apt::update class to invoke apt-get update once.
This commit is contained in:
parent
3684f88372
commit
82967a22fa
3 changed files with 5 additions and 8 deletions
|
@ -7,6 +7,6 @@ define apt::builddep() {
|
|||
|
||||
exec { "apt-builddep-${name}":
|
||||
command => "/usr/bin/apt-get -y --force-yes build-dep ${name}",
|
||||
notify => Exec["apt update"],
|
||||
notify => Exec['apt update'],
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ define apt::ppa(
|
|||
Class['apt'] -> Apt::Ppa[$title]
|
||||
|
||||
include apt::params
|
||||
include apt::update
|
||||
|
||||
$sources_list_d = $apt::params::sources_list_d
|
||||
|
||||
|
@ -14,10 +15,6 @@ define apt::ppa(
|
|||
fail('lsbdistcodename fact not available: release parameter required')
|
||||
}
|
||||
|
||||
exec { "apt-update-${name}":
|
||||
command => "${apt::params::provider} update",
|
||||
refreshonly => true,
|
||||
}
|
||||
|
||||
$filename_without_slashes = regsubst($name,'/','-','G')
|
||||
$filename_without_ppa = regsubst($filename_without_slashes, '^ppa:','','G')
|
||||
|
@ -25,8 +22,8 @@ define apt::ppa(
|
|||
|
||||
exec { "add-apt-repository-${name}":
|
||||
command => "/usr/bin/add-apt-repository ${name}",
|
||||
notify => Exec["apt-update-${name}"],
|
||||
creates => "${sources_list_d}/${sources_list_d_filename}",
|
||||
notify => Exec['apt update'],
|
||||
}
|
||||
|
||||
file { "${sources_list_d}/${sources_list_d_filename}":
|
||||
|
|
|
@ -18,7 +18,7 @@ describe 'apt::ppa', :type => :define do
|
|||
t.sub(/^ppa:/,'').gsub('/','-') << "-" << "#{release}.list"
|
||||
end
|
||||
|
||||
it { should contain_exec("apt-update-#{t}").with(
|
||||
it { should contain_exec("apt update").with(
|
||||
'command' => '/usr/bin/apt-get update',
|
||||
'refreshonly' => true
|
||||
)
|
||||
|
@ -26,7 +26,7 @@ describe 'apt::ppa', :type => :define do
|
|||
|
||||
it { should contain_exec("add-apt-repository-#{t}").with(
|
||||
'command' => "/usr/bin/add-apt-repository #{t}",
|
||||
'notify' => "Exec[apt-update-#{t}]",
|
||||
'notify' => "Exec[apt update]",
|
||||
'creates' => "/etc/apt/sources.list.d/#{filename}"
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue