diff --git a/manifests/pear/module.pp b/manifests/pear/module.pp index 4d11b16..789a65a 100644 --- a/manifests/pear/module.pp +++ b/manifests/pear/module.pp @@ -59,13 +59,13 @@ } $pear_exec_unless = $ensure ? { - present => "pear info ${pear_source}", + present => "pear shell-test ${pear_source} > 0", absent => undef } $pear_exec_onlyif = $ensure ? { present => undef, - absent => "pear info ${pear_source}", + absent => "pear shell-test ${pear_source} > 0", } $real_service = $service ? { diff --git a/spec/defines/php_pear_module_spec.rb b/spec/defines/php_pear_module_spec.rb index 3603ead..89e652a 100644 --- a/spec/defines/php_pear_module_spec.rb +++ b/spec/defines/php_pear_module_spec.rb @@ -39,7 +39,7 @@ it 'should install pear module with exec commands' do should contain_exec('pear-Crypt-CHAP').with( 'command' => 'pear -d preferred_state=stable install pear.php.net/Crypt-CHAP', - 'unless' => 'pear info pear.php.net/Crypt-CHAP | iconv -c' + 'unless' => 'pear shell-test pear.php.net/Crypt-CHAP > 0' ) end end