Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
awit-dbackup
awit-dbackup
Commits
60f00375
Commit
60f00375
authored
Jul 11, 2014
by
Nigel Kukard
Browse files
Don't use bareword filehandles
parent
ebac439a
Changes
1
Hide whitespace changes
Inline
Side-by-side
dbackup
View file @
60f00375
...
...
@@ -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;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment