Skip to content

Commit 0d580e0

Browse files
committed
Make latest version detection portable
This is currently broken on FreeBSD do to the usage of GNU-grep specific grep(1) flag: `-P`. We can use a single sed(1) command with an extended regular expression to achieve the same goal, so use this instead.
1 parent 1433b2a commit 0d580e0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

manifests/pip.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
$latest_version = join([
221221
"${pip_install} ${legacy_resolver} ${pypi_index} ${pypi_extra_index} ${proxy_flag}",
222222
" ${install_args} ${install_editable} ${real_pkgname}==notreallyaversion 2>&1",
223-
' | grep -oP "\(from versions: .*\)" | sed -E "s/\(from versions: (.*?, )*(.*)\)/\2/g"',
223+
" | sed -nE 's/.*\\(from versions: (.*, )*(.*)\\)/\\2/p'",
224224
' | tr -d "[:space:]"',
225225
])
226226

0 commit comments

Comments
 (0)