]> git.proxmox.com Git - pve-container.git/commitdiff
setup: relax matching when detecting systemd version
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 16 Nov 2022 16:48:07 +0000 (17:48 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 16 Nov 2022 16:48:10 +0000 (17:48 +0100)
As this did not detect the version from Arch Linux, which is, for
example:

> required from libsystemd-shared-251.7-4.so:

Accept dot and minus as separator for the extra/patch/distro level of
the version and allow arbitrary many such tuple parts.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/LXC/Setup/Base.pm

index fffaf47e5731423d5c677abdf3eae35cf8b0141e..63d7d700f785a1fda93b9b564e10c0f92a2e77db 100644 (file)
@@ -524,7 +524,7 @@ sub get_systemd_version {
        ['objdump', '-p', $self->{rootdir}.$init],
        outfunc => sub {
            my $line = shift;
-           if ($line =~ /libsystemd-shared-(\d+)(?:\.[a-zA-Z0-9]*)?\.so:$/) {
+           if ($line =~ /libsystemd-shared-(\d+)(?:[-.][a-zA-Z0-9]+)*\.so:?$/) {
                $version = $1;
            }
        },