We want to check for an supported compression type, but the check was
not correct as this only works if both sides are scalars, but an
assignment to an array is always "truthy", so actually check explicitly
if the compression type is supported before.
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
);
if ($archive =~ /\.tar(\.[^.]+)?$/) {
if (defined($1)) {
- @compression_opt = $compression_map{$1}
- or die "unrecognized compression format: $1\n";
+ die "unrecognized compression format: $1\n" if (!defined($compression_map{$1}));
+ @compression_opt = $compression_map{$1};
}
} else {
die "file does not look like a template archive: $archive\n";