|
35 | 35 | # Boolean. If true the package is installed as an editable resource.
|
36 | 36 | #
|
37 | 37 | # [*environment*]
|
38 |
| -# Additional environment variables required to install the packages. Default: none |
| 38 | +# Additional environment variables required to install the packages. |
| 39 | +# Default: none |
39 | 40 | #
|
40 | 41 | # [*timeout*]
|
41 |
| -# The maximum time in seconds the "pip install" command should take. Default: 1800 |
| 42 | +# The maximum time in seconds the "pip install" command should take. |
| 43 | +# Default: 1800 |
42 | 44 | #
|
43 | 45 | # [*install_args*]
|
44 | 46 | # String. Any additional installation arguments that will be supplied
|
45 | 47 | # when running pip install.
|
46 | 48 | #
|
47 |
| -# [*uninstall_args*] |
| 49 | +# [*uninstall args*] |
48 | 50 | # String. Any additional arguments that will be supplied when running
|
49 | 51 | # pip uninstall.
|
50 | 52 | #
|
|
82 | 84 | $log_dir = '/tmp',
|
83 | 85 | ) {
|
84 | 86 |
|
| 87 | + $pip_freeze_pkgname = regsubst($pkgname, '_', '-', 'G') |
| 88 | + notice("Pip freeze pkgname: ${pip_freeze_pkgname}") |
85 | 89 | # Parameter validation
|
86 | 90 | if ! $virtualenv {
|
87 | 91 | fail('python::pip: virtualenv parameter must not be empty')
|
|
135 | 139 | }
|
136 | 140 |
|
137 | 141 | # Check if searching by explicit version.
|
138 |
| - if $ensure =~ /^((19|20)[0-9][0-9]-(0[1-9]|1[1-2])-([0-2][1-9]|3[0-1])|[0-9]+\.[0-9]+(\.[0-9]+)?)$/ { |
139 |
| - $grep_regex = "^${pkgname}==${ensure}\$" |
| 142 | + if $ensure =~ /^((19|20)[0-9][0-9]-(0[1-9]|1[1-2])-([0-2][1-9]|3[0-1])|[0-9]+\.[0-9]+(\.[0-9]+)?)$/ { #lint:ignore:80chars |
| 143 | + $grep_regex = "^${pip_freeze_pkgname}==${ensure}\$" |
140 | 144 | } else {
|
141 |
| - $grep_regex = $pkgname ? { |
142 |
| - /==/ => "^${pkgname}\$", |
143 |
| - default => "^${pkgname}==", |
| 145 | + $grep_regex = $pip_freeze_pkgname ? { |
| 146 | + /==/ => "^${pip_freeze_pkgname}\$", |
| 147 | + default => "^${pip_freeze_pkgname}==", |
144 | 148 | }
|
145 | 149 | }
|
146 | 150 |
|
|
0 commit comments