Commit 60f00375 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Don't use bareword filehandles

parent ebac439a
......@@ -862,7 +862,7 @@ sub backup
}
# File list to backup
open(MANIFEST,"> $dest/$path/dbackup$seq.manifest")
open(my $fh,">","$dest/$path/dbackup$seq.manifest")
or die "Failed to open '[$dest]/($path)/dbackup$seq.manifest': $!";
foreach my $item (@manifestList) {
# Sanity check to see if this filename is going to work
......@@ -872,13 +872,13 @@ sub backup
}
# If this is not the top dir, use /
if ($path ne "") {
print(MANIFEST "$path/$item$manifestDelim");
print($fh "$path/$item$manifestDelim");
# If it is, don't use /
} else {
print(MANIFEST "$item$manifestDelim");
print($fh "$item$manifestDelim");
}
}
close(MANIFEST);
close($fh);
# tar specifics...
if ($newPathAttribs{$path}->{'format'} eq "tar") {
......@@ -1556,19 +1556,23 @@ sub getTarVer
{
my $tar = shift;
open(TAR, $config{'tar'} . " --version |")
# Open tar and grab its version string
open(my $ph, "-|", $config{'tar'} . " --version")
or die "FAILED to execute '".$config{'tar'}."': $!";
if (!($tarVer = <TAR>)) {
if (!($tarVer = <$ph>)) {
print(STDERR "ERROR: Failed to read tar version\n");
exit 1;
}
close($ph);
# Convert version string into integer and return it
($tarVer) = ($tarVer =~ /([0-9]+\.[0-9]+)/);
if (!defined($tarVer) || $tarVer eq "") {
print(STDERR "ERROR: Failed to parse tar version\n");
exit 1;
}
$tarVer =~ s/\.//g;
close(TAR);
if ($tarVer < 100) {
print(STDERR "ERROR: Failed to read tar version or your version is simply too old\n");
exit 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment