From: Nick Berard Date: Sat, 2 Jul 2016 00:31:05 +0000 (-0700) Subject: After the repository is added, the ${::apt::sources_list_d}/${sources_list_d_filename... X-Git-Tag: 2.3.0~8^2~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=38263ac768349bf0eab56194aa70f4a78fb664af;p=puppet-modules%2Fpuppetlabs-apt.git After the repository is added, the ${::apt::sources_list_d}/${sources_list_d_filename} file is created as an empty file. The unless condition of Exec["add-apt-repository-${name}"] calls test -s, which returns 1 if the file is empty. Because the file is empty, the unless condition is never true and the repository is added on every execution. This commit replaces the -s test condition with -f, which is true if the file exists or false otherwise. --- diff --git a/manifests/ppa.pp b/manifests/ppa.pp index dfa3d08..6b025d7 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -48,7 +48,7 @@ define apt::ppa( exec { "add-apt-repository-${name}": environment => $_proxy_env, command => "/usr/bin/add-apt-repository ${options} ${name}", - unless => "/usr/bin/test -s ${::apt::sources_list_d}/${sources_list_d_filename}", + unless => "/usr/bin/test -f ${::apt::sources_list_d}/${sources_list_d_filename}", user => 'root', logoutput => 'on_failure', notify => Class['apt::update'],