Skip to content

Commit

Permalink
Make latest version detection portable
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
smortex committed Jan 1, 2024
1 parent 1433b2a commit 0d580e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/pip.pp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
$latest_version = join([
"${pip_install} ${legacy_resolver} ${pypi_index} ${pypi_extra_index} ${proxy_flag}",
" ${install_args} ${install_editable} ${real_pkgname}==notreallyaversion 2>&1",
' | grep -oP "\(from versions: .*\)" | sed -E "s/\(from versions: (.*?, )*(.*)\)/\2/g"',
" | sed -nE 's/.*\\(from versions: (.*, )*(.*)\\)/\\2/p'",
' | tr -d "[:space:]"',
])

Expand Down

0 comments on commit 0d580e0

Please sign in to comment.