From c61e81a2445a263ab14bc1865679e177784c297a Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Sat, 6 Nov 2021 23:01:22 +0200 Subject: [PATCH] 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 --- mmdebstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmdebstrap b/mmdebstrap index ac95bd3..14060c7 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -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); } -- 2.39.5