|
204 | 204 | # Unfortunately this is the smartest way of getting the latest available package version with pip as of now |
205 | 205 | # Note: we DO need to repeat ourselves with "from version" in both grep and sed as on some systems pip returns |
206 | 206 | # more than one line with paretheses. |
207 | | - $latest_version = join( |
208 | | - ["${pip_install} ${pypi_index} ${proxy_flag} ${install_args} ${install_editable} ${real_pkgname}==notreallyaversion 2>&1", |
209 | | - ' | grep -oP "\(from versions: .*\)" | sed -E "s/\(from versions: (.*?, )*(.*)\)/\2/g"', |
210 | | - ' | tr -d "[:space:]"',] |
211 | | - ) |
| 207 | + $latest_version = join( [ |
| 208 | + "${pip_install} ${pypi_index} ${proxy_flag} ${install_args} ${install_editable} ${real_pkgname}==notreallyaversion 2>&1", |
| 209 | + ' | grep -oP "\(from versions: .*\)" | sed -E "s/\(from versions: (.*?, )*(.*)\)/\2/g"', |
| 210 | + ' | tr -d "[:space:]"', |
| 211 | + ]) |
212 | 212 |
|
213 | 213 | # Packages with underscores in their names are listed with dashes in their place in `pip freeze` output |
214 | 214 | $pkgname_with_dashes = regsubst($real_pkgname, '_', '-', 'G') |
215 | 215 | $grep_regex_pkgname_with_dashes = "^${pkgname_with_dashes}==" |
216 | | - $installed_version = join( |
217 | | - ["${pip_env} freeze --all", |
218 | | - " | grep -i -e ${grep_regex_pkgname_with_dashes} | cut -d= -f3", |
219 | | - " | tr -d '[:space:]'",] |
220 | | - ) |
| 216 | + $installed_version = join( ["${pip_env} freeze --all", " | grep -i -e ${grep_regex_pkgname_with_dashes} | cut -d= -f3", " | tr -d '[:space:]'",]) |
221 | 217 |
|
222 | 218 | $command = "${pip_install} --upgrade ${pip_common_args}" |
223 | 219 | $unless_command = "[ \$(${latest_version}) = \$(${installed_version}) ]" |
|
0 commit comments