Relax dpkg version regex

For non-release builds the version will include the number of commits since last release and the commit hash with dashes, e.g. 1.20.8-46-g0881.
For downstream distros it seems it may include their identification strings, e.g. 1.20.9ubuntu2.

Make the regex match everything after the version number to avoid incorrectly erroring on such versions.

Fixes #18
pull/19/head
Raul Tambre 3 years ago
parent 8fe4fe3eda
commit c61e81a244

@ -4498,7 +4498,7 @@ sub main() {
# the --robot option was introduced in 1.20.0 but until 1.20.2 the
# output contained a string after the version, separated by a
# whitespace -- since then, it's only the version
if ($? == 0 and $content =~ /^([0-9.]+)( .*)?$/) {
if ($? == 0 and $content =~ /^([0-9.]+).*$/) {
# dpkg is new enough for the --robot option
$dpkgversion = version->new($1);
}

Loading…
Cancel
Save