- fixed problem with determining file size of tgz on disk: if there is no file, it...
[BackupPC.git] / lib / BackupPC / SearchLib.pm
index 792d5b9..0355311 100644 (file)
@@ -20,10 +20,7 @@ my $db_user = $Conf{SearchUser} || '';
 my $hest_node_url = $Conf{HyperEstraierIndex};
 
 my $dbh;
-my $Dir = $Conf{InstallDir}."/data/log";
-open(LOG, ">>", "$Dir/LOG")
-select(LOG);
-$|=1;
+
 
 
 sub get_dbh {
@@ -383,21 +380,18 @@ sub get_tgz_size_by_name($) {
        my $tgz = $Conf{InstallDir}.'/'.$Conf{GzipTempDir}.'/'.$name;
        my $size = -1;
 
+       my $Dir = $Conf{InstallDir}."/data/log";
+       $|=1;
        if (-f "${tgz}.tar.gz") {
-               print "stating ${tgz}.tar.gz...";
                $size = (stat("${tgz}.tar.gz"))[7];
-               print "size: $size\n";
        } elsif (-d $tgz) {
-               print "$tgz is dir, stating files in it...\n";
                opendir(my $dir, $tgz) || die "can't opendir $tgz: $!";
                my @parts = grep { !/^\./ && !/md5/ && -f "$tgz/$_" } readdir($dir);
                $size = 0;
                foreach my $part (@parts) {
                        my $currSize =  (stat("$tgz/$part"))[7]; 
                        $size += (stat("$tgz/$part"))[7] || die "can't stat $tgz/$part: $!";
-                       print "\t$tgz/$part: $currSize\n";
                }
-               print "\ttotal $size\n";
 
                closedir $dir;
        } else {