]> git.pld-linux.org Git - packages/bacula-backup-mysql.git/commitdiff
- Config class returns arrayref if there are multiple items, deref it if array is...
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 27 May 2009 12:53:00 +0000 (12:53 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    bacula-backup-mysql -> 1.4

bacula-backup-mysql

index d6c6c5deb3b3af271818f39973cc4faf207d947b..46e5ea348d9a6e27c7b33426d0758223835cc06d 100644 (file)
@@ -45,6 +45,8 @@ for my $cluster ($c->get('clusters', 'cluster')) {
 sub mysqlhotcopy {
        my ($cluster, $database, $user, $password, $socket) = @_;
 
+       print ">>>> mysqlhotcopy $database\n";
+
        my $dstdir = tempdir("bbm.XXXXXX", DIR => $tmpdir);
 
        # make backup with mysqlhotcopy
@@ -70,6 +72,8 @@ sub mysqlhotcopy {
        rename($srcdir, $dirname) or die "Rename '$srcdir'->'$dirname' failed: $!\n";
 
        rmdir($dstdir) or warn $!;
+
+       print "<<<< mysqlhotcopy $database\n";
 }
 
 sub backup_cluster {
@@ -86,6 +90,7 @@ sub backup_cluster {
 
        # start with include list
        my %dbs = map { $_ => 1 } @include;
+
        if (@exclude or !@include) {
                my $dbh = new BBM::DB($user, $password, $socket);
                my $sth = $dbh->prepare("show databases");
@@ -147,5 +152,9 @@ sub get {
        # pay attention if callee wanted arrays
        return wantarray ? () : undef unless exists $h->{$section};
        return wantarray ? () : undef unless exists $h->{$section}->{$key};
+
+       # deref if wanted array and is arrayref
+       return @{$h->{$section}->{$key}} if wantarray && ref $h->{$section}->{$key} eq 'ARRAY';
+
        return $h->{$section}->{$key};
 }
This page took 0.082515 seconds and 4 git commands to generate.