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.
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'],