Skip to content

Commit 076dc16

Browse files
authored
Merge pull request #331 from rikwasmus/master
Do not try to reinstall packages installed via the OS
2 parents bc5eb8c + af932f0 commit 076dc16

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

manifests/pip.pp

+3-3
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@
219219
# Explicit version.
220220
exec { "pip_install_${name}":
221221
command => "${pip_env} wheel --help > /dev/null 2>&1 && { ${pip_env} wheel --version > /dev/null 2>&1 || wheel_support_flag='--no-use-wheel'; } ; { ${pip_env} --log ${log}/pip.log install ${install_args} \$wheel_support_flag ${pypi_index} ${proxy_flag} ${install_args} ${install_editable} ${source}==${ensure} || ${pip_env} --log ${log}/pip.log install ${install_args} ${pypi_index} ${proxy_flag} ${install_args} ${install_editable} ${source}==${ensure} ;}",
222-
unless => "${pip_env} freeze | grep -i -e ${grep_regex}",
222+
unless => "${pip_env} freeze | grep -i -e ${grep_regex} || ${pip_env} list | sed -e 's/[ ]\+/==/' -e 's/[()]//g' | grep -i -e ${grep_regex}",
223223
user => $owner,
224224
group => $group,
225225
cwd => $cwd,
@@ -228,12 +228,12 @@
228228
path => $path,
229229
}
230230
}
231-
231+
#
232232
present: {
233233
# Whatever version is available.
234234
exec { "pip_install_${name}":
235235
command => "${pip_env} wheel --help > /dev/null 2>&1 && { ${pip_env} wheel --version > /dev/null 2>&1 || wheel_support_flag='--no-use-wheel'; } ; { ${pip_env} --log ${log}/pip.log install \$wheel_support_flag ${pypi_index} ${proxy_flag} ${install_args} ${install_editable} ${source} || ${pip_env} --log ${log}/pip.log install ${pypi_index} ${proxy_flag} ${install_args} ${install_editable} ${source} ;}",
236-
unless => "${pip_env} freeze | grep -i -e ${grep_regex}",
236+
unless => "${pip_env} freeze | grep -i -e ${grep_regex} || ${pip_env} list | sed -e 's/[ ]\+/==/' -e 's/[()]//g' | grep -i -e ${grep_regex}",
237237
user => $owner,
238238
group => $group,
239239
cwd => $cwd,

0 commit comments

Comments
 (0)