finish rename to BackupPC::Search
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 9 Jan 2011 14:38:05 +0000 (14:38 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 9 Jan 2011 14:38:05 +0000 (14:38 +0000)
bin/BackupPC_burnArchiveCLI
bin/BackupPC_incPartsUpdate
bin/BackupPC_removeBurnedArchives
bin/BackupPC_tarIncCreate
bin/BackupPC_updatedb
lib/BackupPC/CGI/BurnMedia.pm
lib/BackupPC/CGI/SearchArchives.pm
lib/BackupPC/Search.pm

index 3a6d8dc..a1488c3 100755 (executable)
@@ -6,7 +6,7 @@ use lib "/usr/local/BackupPC/lib";
 
 use DBI;
 use BackupPC::Lib;
 
 use DBI;
 use BackupPC::Lib;
-use BackupPC::SearchLib;
+use BackupPC::Search;
 use Time::HiRes qw/time/;
 use POSIX qw/strftime/;
 use Term::Menus;
 use Time::HiRes qw/time/;
 use POSIX qw/strftime/;
 use Term::Menus;
@@ -23,7 +23,7 @@ $|=1;
 # don't check for user
 my $bpc = BackupPC::Lib->new(undef, undef, 1) || die;
 my %Conf = $bpc->Conf();
 # don't check for user
 my $bpc = BackupPC::Lib->new(undef, undef, 1) || die;
 my %Conf = $bpc->Conf();
-%BackupPC::SearchLib::Conf = %Conf;
+%BackupPC::Search::Conf = %Conf;
 
 my $conf_bin;
 
 
 my $conf_bin;
 
@@ -404,7 +404,7 @@ foreach my $copy_nr ( 1 .. $copies ) {
 
                        # this part
                        my $p = {
 
                        # this part
                        my $p = {
-                               filename => BackupPC::SearchLib::getGzipName($row->{'host'}, $row->{'share'}, $row->{'num'}),
+                               filename => BackupPC::Search::getGzipName($row->{'host'}, $row->{'share'}, $row->{'num'}),
                                host => $row->{'host'},
                                share => $row->{'share'},
                                num => $row->{'num'}
                                host => $row->{'host'},
                                share => $row->{'share'},
                                num => $row->{'num'}
@@ -585,7 +585,7 @@ SKIP:
 
 }
 
 
 }
 
-#my $tar_file = BackupPC::SearchLib::getGzipName($row->{'host'}, $row->{'share'}, $row->{'num'});
+#my $tar_file = BackupPC::Search::getGzipName($row->{'host'}, $row->{'share'}, $row->{'num'});
 #print curr_time, sprintf(" %s:%s %-3d ", $row->{'host'}, $row->{'share'}, $row->{'num'}), " -> $tar_file ";
 
 print "Recoding finished, exiting...\n";
 #print curr_time, sprintf(" %s:%s %-3d ", $row->{'host'}, $row->{'share'}, $row->{'num'}), " -> $tar_file ";
 
 print "Recoding finished, exiting...\n";
index 2a5913a..bed439f 100755 (executable)
@@ -72,8 +72,8 @@ $pidfile->write;
 my $bpc = BackupPC::Lib->new || die "can't create BackupPC::Lib";
 my %Conf = $bpc->Conf();
 
 my $bpc = BackupPC::Lib->new || die "can't create BackupPC::Lib";
 my %Conf = $bpc->Conf();
 
-use BackupPC::SearchLib;
-%BackupPC::SearchLib::Conf = %Conf;
+use BackupPC::Search;
+%BackupPC::Search::Conf = %Conf;
 
 my $path = abs_path($0);
 $path =~ s#/[^/]+$#/#;
 
 my $path = abs_path($0);
 $path =~ s#/[^/]+$#/#;
@@ -413,10 +413,10 @@ while (my $row = $sth->fetchrow_hashref) {
 
        $curr_backup++;
 
 
        $curr_backup++;
 
-       my $tar_file = BackupPC::SearchLib::getGzipName($row->{'host'}, $row->{'share'}, $row->{'num'});
+       my $tar_file = BackupPC::Search::getGzipName($row->{'host'}, $row->{'share'}, $row->{'num'});
 
        # this will return -1 if file doesn't exist
 
        # this will return -1 if file doesn't exist
-       my $size = BackupPC::SearchLib::get_tgz_size_by_name($tar_file);
+       my $size = BackupPC::Search::get_tgz_size_by_name($tar_file);
 
        print "# host: ".$row->{host}.", share: ".$row->{'share'}.", backup_num:".$row->{num}." size: $size backup.size: ", $row->{inc_size},"\n" if ($opt{d});
 
 
        print "# host: ".$row->{host}.", share: ".$row->{'share'}.", backup_num:".$row->{num}." size: $size backup.size: ", $row->{inc_size},"\n" if ($opt{d});
 
index b209f4b..19faadd 100755 (executable)
@@ -5,12 +5,12 @@ no utf8;
 use lib "/usr/local/BackupPC/lib";
 use DBI;
 use BackupPC::Lib;
 use lib "/usr/local/BackupPC/lib";
 use DBI;
 use BackupPC::Lib;
-use BackupPC::SearchLib;
+use BackupPC::Search;
 use Data::Dumper;
 my $bpc = BackupPC::Lib->new || die "can't create BackupPC::Lib";
 my %Conf = $bpc->Conf();
 my $tar_dir = $Conf{InstallDir}."/".$Conf{GzipTempDir};
 use Data::Dumper;
 my $bpc = BackupPC::Lib->new || die "can't create BackupPC::Lib";
 my %Conf = $bpc->Conf();
 my $tar_dir = $Conf{InstallDir}."/".$Conf{GzipTempDir};
-%BackupPC::SearchLib::Conf = %Conf;
+%BackupPC::Search::Conf = %Conf;
 #die(Dumper(\%Conf));
 my $dsn = $Conf{SearchDSN} || die "need searchdsn in config.pl\n";
 my $user = $Conf{SearchUser} || '';
 #die(Dumper(\%Conf));
 my $dsn = $Conf{SearchDSN} || die "need searchdsn in config.pl\n";
 my $user = $Conf{SearchUser} || '';
@@ -31,7 +31,7 @@ my $totalRemoved = 0;
 $sth->execute();
 
 while (my $row = $sth->fetchrow_hashref()) {
 $sth->execute();
 
 while (my $row = $sth->fetchrow_hashref()) {
-       my $filename = BackupPC::SearchLib::getGzipName($row->{'host'}, $row->{'share'}, $row->{'num'});
+       my $filename = BackupPC::Search::getGzipName($row->{'host'}, $row->{'share'}, $row->{'num'});
        
        $filename .= ".tar.gz";
        $filename = $tar_dir . "/" . $filename;
        
        $filename .= ".tar.gz";
        $filename = $tar_dir . "/" . $filename;
index 9b55b2f..4e7bb72 100755 (executable)
@@ -69,7 +69,7 @@ use BackupPC::Lib;
 use BackupPC::Attrib qw(:all);
 use BackupPC::FileZIO;
 use BackupPC::View;
 use BackupPC::Attrib qw(:all);
 use BackupPC::FileZIO;
 use BackupPC::View;
-use BackupPC::SearchLib;
+use BackupPC::Search;
 use Time::HiRes qw/time/;
 use POSIX qw/strftime/;
 use File::Which;
 use Time::HiRes qw/time/;
 use POSIX qw/strftime/;
 use File::Which;
@@ -80,7 +80,7 @@ die("BackupPC::Lib->new failed\n") if ( !(my $bpc = BackupPC::Lib->new) );
 my $TopDir = $bpc->TopDir();
 my $BinDir = $bpc->BinDir();
 my %Conf   = $bpc->Conf();
 my $TopDir = $bpc->TopDir();
 my $BinDir = $bpc->BinDir();
 my %Conf   = $bpc->Conf();
-%BackupPC::SearchLib::Conf = %Conf;
+%BackupPC::Search::Conf = %Conf;
 my %opts;
 my $in_backup_increment;
 
 my %opts;
 my $in_backup_increment;
 
@@ -201,7 +201,7 @@ my $max_file_size = $Conf{'MaxArchiveFileSize'} || die "problem with MaxArchiveF
 my $tar_dir = $Conf{InstallDir}.'/'.$Conf{GzipTempDir};
 die "problem with $tar_dir, check GzipTempDir in configuration\n" unless (-d $tar_dir && -w $tar_dir);
 
 my $tar_dir = $Conf{InstallDir}.'/'.$Conf{GzipTempDir};
 die "problem with $tar_dir, check GzipTempDir in configuration\n" unless (-d $tar_dir && -w $tar_dir);
 
-my $tar_file = BackupPC::SearchLib::getGzipName($Host, $ShareName, $Num) || die "can't getGzipName($Host, $ShareName, $Num)";
+my $tar_file = BackupPC::Search::getGzipName($Host, $ShareName, $Num) || die "can't getGzipName($Host, $ShareName, $Num)";
 
 my $tar_path_final = $tar_dir . '/' . $tar_file;
 my $tar_path = $tar_path_final . '.tmp';
 
 my $tar_path_final = $tar_dir . '/' . $tar_file;
 my $tar_path = $tar_path_final . '.tmp';
index 2e9e49c..2290a19 100755 (executable)
@@ -11,7 +11,7 @@ use Getopt::Std;
 use Time::HiRes qw/time/;
 use File::Pid;
 use POSIX qw/strftime/;
 use Time::HiRes qw/time/;
 use File::Pid;
 use POSIX qw/strftime/;
-use BackupPC::SearchLib;
+use BackupPC::Search;
 use Cwd qw/abs_path/;
 use Data::Dump qw(dump);
 
 use Cwd qw/abs_path/;
 use Data::Dump qw(dump);
 
index 8f29a07..7d7eff3 100644 (file)
@@ -2,7 +2,7 @@ package BackupPC::CGI::BurnMedia;
 
 use strict;
 use BackupPC::CGI::Lib qw(:all);
 
 use strict;
 use BackupPC::CGI::Lib qw(:all);
-use BackupPC::SearchLib;
+use BackupPC::Search;
 use Data::Dumper;
 use vars qw($Cgi %In $MyURL $User %Conf $TopDir $BinDir $bpc);
 
 use Data::Dumper;
 use vars qw($Cgi %In $MyURL $User %Conf $TopDir $BinDir $bpc);
 
@@ -31,7 +31,7 @@ sub action() {
 EOF
              
                $cont .= "Backups that have not been archived:<br>";
 EOF
              
                $cont .= "Backups that have not been archived:<br>";
-               $cont .= BackupPC::SearchLib::displayBackupsGrid( \%In );
+               $cont .= BackupPC::Search::displayBackupsGrid( \%In );
            
        } else {
 
            
        } else {
 
@@ -46,7 +46,7 @@ EOF
 
                                my ($host_id, $backup_num, $backup_id) = ($1,$2,$3);
                                push @selected_backup_ids, $backup_id;
 
                                my ($host_id, $backup_num, $backup_id) = ($1,$2,$3);
                                push @selected_backup_ids, $backup_id;
-                               my $currSize = BackupPC::SearchLib::getGzipSizeFromBackupID($backup_id);
+                               my $currSize = BackupPC::Search::getGzipSizeFromBackupID($backup_id);
                                my $sth_size = $dbh->prepare(q{select inc_size from backups where id = ?});
                                $sth_size -> execute( $backup_id );
                                my $db_size = $sth_size->fetchrow_hashref()->{inc_size};
                                my $sth_size = $dbh->prepare(q{select inc_size from backups where id = ?});
                                $sth_size -> execute( $backup_id );
                                my $db_size = $sth_size->fetchrow_hashref()->{inc_size};
index 3e1ce0a..0425225 100644 (file)
@@ -7,7 +7,7 @@ package BackupPC::CGI::SearchArchives;
 
 use strict;
 use BackupPC::CGI::Lib qw(:all);
 
 use strict;
 use BackupPC::CGI::Lib qw(:all);
-use BackupPC::SearchLib;
+use BackupPC::Search;
 use Data::Dumper;
 use HTML::FillInForm;
 use vars qw($Cgi %In $MyURL $User %Conf $TopDir $BinDir $bpc);
 use Data::Dumper;
 use HTML::FillInForm;
 use vars qw($Cgi %In $MyURL $User %Conf $TopDir $BinDir $bpc);
@@ -17,7 +17,7 @@ sub action() {
 
     
        BackupPC::CGI::Lib::NewRequest();
 
     
        BackupPC::CGI::Lib::NewRequest();
-       my @hosts = BackupPC::SearchLib::getUnits();
+       my @hosts = BackupPC::Search::getUnits();
 
        foreach my $host (@hosts) {
                $hosts_html .= "<option value=" . $host->{'id'} . "> " . $host->{'share'} . " </option>\n";
 
        foreach my $host (@hosts) {
                $hosts_html .= "<option value=" . $host->{'id'} . "> " . $host->{'share'} . " </option>\n";
@@ -86,7 +86,7 @@ sub action() {
                my $fif = new HTML::FillInForm;
                $html .= $fif->fill(scalarref => \$form, fdat => \%In);
 
                my $fif = new HTML::FillInForm;
                $html .= $fif->fill(scalarref => \$form, fdat => \%In);
 
-               $html .= BackupPC::SearchLib::displayGrid( \%In );
+               $html .= BackupPC::Search::displayGrid( \%In );
        }
 
        Header( eval("qq{$Lang->{Search_archive}}"), "", 1, "", $html );
        }
 
        Header( eval("qq{$Lang->{Search_archive}}"), "", 1, "", $html );
index 8fe2541..742f3f2 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
 #!/usr/bin/perl
-package BackupPC::SearchLib;
+package BackupPC::Search;
 
 use strict;
 use BackupPC::CGI::Lib qw(:all);
 
 use strict;
 use BackupPC::CGI::Lib qw(:all);