From 31cf249aed7e47a59bc1ae231fb4c31810d9912a Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Tue, 19 Oct 2021 21:50:13 -0400 Subject: [PATCH] S3Backup: check for bzip2 and xz Nix Config support (Use of uninitialized value ::Config::xz in concatenation) --- src/lib/Hydra/Plugin/S3Backup.pm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/lib/Hydra/Plugin/S3Backup.pm b/src/lib/Hydra/Plugin/S3Backup.pm index bdd23b2f..a67082ec 100644 --- a/src/lib/Hydra/Plugin/S3Backup.pm +++ b/src/lib/Hydra/Plugin/S3Backup.pm @@ -21,11 +21,18 @@ sub isEnabled { } my $client; -my %compressors = ( - xz => "| $Nix::Config::xz", - bzip2 => "| $Nix::Config::bzip2", - none => "" -); +my %compressors = (); + +$compressors{"none"} = ""; + +if (defined($Nix::Config::bzip2)) { + $compressors{"bzip2"} = "| $Nix::Config::bzip2", +} + +if (defined($Nix::Config::xz)) { + $compressors{"xz"} = "| $Nix::Config::xz", +} + my $lockfile = Hydra::Model::DB::getHydraPath . "/.hydra-s3backup.lock"; sub buildFinished {