X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_ASA_PostArchive_Update;h=11de07ee2aa34e57e0c526dc0341df556c2e6e50;hp=e744d0262bc1745be6659ff9781140356d3c779e;hb=40df4417247e8b3ec4e35770adbe9da62593e0e5;hpb=34311ffcf9578586eb9a2e2a766af24afd0816d4 diff --git a/bin/BackupPC_ASA_PostArchive_Update b/bin/BackupPC_ASA_PostArchive_Update index e744d02..11de07e 100755 --- a/bin/BackupPC_ASA_PostArchive_Update +++ b/bin/BackupPC_ASA_PostArchive_Update @@ -176,20 +176,21 @@ sub check_archive { } open(my $gzip, $Conf{GzipPath}." -l $filename |") || die "can't gzip -l $filename: $!"; + local $/ = undef; my $line = <$gzip>; - chomp($line); - $line = <$gzip> if ($line =~ /^\s+compressed/); + close($gzip); my ($comp, $uncomp) = (0,0); - if ($line =~ m/^\s+(\d+)\s+(\d+)\s+\d+\.\d+/) { + if ($line =~ m/\s+(\d+)\s+(\d+)\s+\d+\.\d+/s) { if (wantarray) { return [ $1, $2 ]; } else { return $2; } } else { - die "can't find size in line: $line"; + warn "ERROR can't parse: $line"; + return -s $filename; } }