/[smeserver]/rpms/e-smith-backup/sme10/e-smith-backup-2.6.0-replacehal.patch
ViewVC logotype

Diff of /rpms/e-smith-backup/sme10/e-smith-backup-2.6.0-replacehal.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.1 by chrissn, Sat Jan 30 20:30:14 2021 UTC Revision 1.3 by chrissn, Fri Feb 12 18:52:48 2021 UTC
# Line 1  Line 1 
1  diff -urN e-smith-backup-2.6.0.old/root/etc/e-smith/events/actions/workstation-backup-dar e-smith-backup-2.6.0/root/etc/e-smith/events/actions/workstation-backup-dar  diff -urN e-smith-backup-2.6.0.old/root/etc/e-smith/events/actions/workstation-backup-dar e-smith-backup-2.6.0/root/etc/e-smith/events/actions/workstation-backup-dar
2  --- e-smith-backup-2.6.0.old/root/etc/e-smith/events/actions/workstation-backup-dar     2021-01-30 20:13:44.698955067 +0000  --- e-smith-backup-2.6.0.old/root/etc/e-smith/events/actions/workstation-backup-dar     2021-02-09 21:26:24.961634134 +0000
3  +++ e-smith-backup-2.6.0/root/etc/e-smith/events/actions/workstation-backup-dar 2021-01-30 20:18:00.982571819 +0000  +++ e-smith-backup-2.6.0/root/etc/e-smith/events/actions/workstation-backup-dar 2021-02-09 21:29:49.256523741 +0000
4  @@ -31,6 +31,7 @@  @@ -31,6 +31,7 @@
5   use File::Glob qw(bsd_glob);   use File::Glob qw(bsd_glob);
6   use esmith::ConfigDB;   use esmith::ConfigDB;
# Line 9  diff -urN e-smith-backup-2.6.0.old/root/ Line 9  diff -urN e-smith-backup-2.6.0.old/root/
9    
10   sub ldie;   sub ldie;
11   sub start_dar_killer;   sub start_dar_killer;
12  @@ -312,77 +313,61 @@  @@ -312,77 +313,60 @@
13       return $code;       return $code;
14   }   }
15    
# Line 81  diff -urN e-smith-backup-2.6.0.old/root/ Line 81  diff -urN e-smith-backup-2.6.0.old/root/
81  -                if ($vollbl =~ /^\s/) {$vollbl = 'nolabel';}  -                if ($vollbl =~ /^\s/) {$vollbl = 'nolabel';}
82  -            }  -            }
83  +        my $devices = esmith::BlockDevices->new ('allowmount' => 'disabled');  +        my $devices = esmith::BlockDevices->new ('allowmount' => 'disabled');
84  +        my ($valid, $invalid) = $devices->checkBackupDrives(0, 1);  +        my ($valid, $invalid) = $devices->checkBackupDrives(0);
85    
86  -            chomp $vollbl;  -            chomp $vollbl;
87  -            chomp $blkdev;  -            chomp $blkdev;
# Line 89  diff -urN e-smith-backup-2.6.0.old/root/ Line 89  diff -urN e-smith-backup-2.6.0.old/root/
89  -            if ($vollbl eq $share) {$device = $blkdev;}  -            if ($vollbl eq $share) {$device = $blkdev;}
90  +        if ( ${$valid}[0] ) {  +        if ( ${$valid}[0] ) {
91  +            foreach ( @{$valid} ) {  +            foreach ( @{$valid} ) {
 +                warn $_;  
92  +                $vollbl = $devices->label($_);  +                $vollbl = $devices->label($_);
93  +                if ( $share eq "media/$vollbl" ) {  +                if ( $share eq "media/$vollbl" ) {
94  +                    $device = "/dev/$_";  +                    $device = "/dev/$_";
# Line 111  diff -urN e-smith-backup-2.6.0.old/root/ Line 110  diff -urN e-smith-backup-2.6.0.old/root/
110    
111   sub removeTree   sub removeTree
112  diff -urN e-smith-backup-2.6.0.old/root/etc/e-smith/web/functions/backup e-smith-backup-2.6.0/root/etc/e-smith/web/functions/backup  diff -urN e-smith-backup-2.6.0.old/root/etc/e-smith/web/functions/backup e-smith-backup-2.6.0/root/etc/e-smith/web/functions/backup
113  --- e-smith-backup-2.6.0.old/root/etc/e-smith/web/functions/backup      2021-01-30 20:13:44.674956230 +0000  --- e-smith-backup-2.6.0.old/root/etc/e-smith/web/functions/backup      2021-02-09 21:26:24.926635870 +0000
114  +++ e-smith-backup-2.6.0/root/etc/e-smith/web/functions/backup  2021-01-30 20:17:32.531942610 +0000  +++ e-smith-backup-2.6.0/root/etc/e-smith/web/functions/backup  2021-02-09 21:29:21.581890670 +0000
115  @@ -27,6 +27,7 @@  @@ -27,6 +27,7 @@
116   use esmith::ConfigDB;   use esmith::ConfigDB;
117   use esmith::Backup;   use esmith::Backup;
# Line 141  diff -urN e-smith-backup-2.6.0.old/root/ Line 140  diff -urN e-smith-backup-2.6.0.old/root/
140  -        foreach my $udi (qx(hal-find-by-property --key volume.fsusage --string filesystem)) {  -        foreach my $udi (qx(hal-find-by-property --key volume.fsusage --string filesystem)) {
141  -            $udi =~ m/^(\S+)/;  -            $udi =~ m/^(\S+)/;
142  +        my $devices = esmith::BlockDevices->new ('allowmount' => 'disabled');  +        my $devices = esmith::BlockDevices->new ('allowmount' => 'disabled');
143  +        my ($valid, $invalid) = $devices->checkBackupDrives(0, 1);  +        my ($valid, $invalid) = $devices->checkBackupDrives(0);
144    
145  -            my $is_mounted = qx(hal-get-property --udi $1 --key volume.is_mounted);  -            my $is_mounted = qx(hal-get-property --udi $1 --key volume.is_mounted);
146  -  -
# Line 225  diff -urN e-smith-backup-2.6.0.old/root/ Line 224  diff -urN e-smith-backup-2.6.0.old/root/
224  -          }  -          }
225  +  +
226  +        my $devices = esmith::BlockDevices->new ('allowmount' => 'disabled');  +        my $devices = esmith::BlockDevices->new ('allowmount' => 'disabled');
227  +        my ($valid, $invalid) = $devices->checkBackupDrives(0, 1);  +        my ($valid, $invalid) = $devices->checkBackupDrives(0);
228  +  +
229  +        if ( ${$valid}[0] ) {  +        if ( ${$valid}[0] ) {
230  +            foreach ( @{$valid} ) {  +            foreach ( @{$valid} ) {
# Line 262  diff -urN e-smith-backup-2.6.0.old/root/ Line 261  diff -urN e-smith-backup-2.6.0.old/root/
261   }   }
262    
263   sub bmount   sub bmount
 diff -urN e-smith-backup-2.6.0.old/root/usr/share/perl5/vendor_perl/esmith/BlockDevices.pm e-smith-backup-2.6.0/root/usr/share/perl5/vendor_perl/esmith/BlockDevices.pm  
 --- e-smith-backup-2.6.0.old/root/usr/share/perl5/vendor_perl/esmith/BlockDevices.pm    2021-01-30 20:13:44.702954873 +0000  
 +++ e-smith-backup-2.6.0/root/usr/share/perl5/vendor_perl/esmith/BlockDevices.pm        2021-01-30 20:16:39.613490616 +0000  
 @@ -200,7 +200,7 @@  
  # Return two arrays, valid drives, invalid drives  
  sub checkBackupDrives  
  {  
 -    my ($self,$bsize) = @_;  
 +    my ($self,$bsize,$removable) = @_;  
      my @valid   = ();  
      my @invalid = ();  
      $self->scanBlocks;       # scan all block devices  
 @@ -209,6 +209,7 @@  
      my $checks = 'UU RO FS'; # These checks are always valid  
      $checks .= ' MO' if ($allowmount eq 'enabled');  
      $checks .= ' SZ' if ($bsize); # Only run the size check when a valid size is given  
 +    $checks .= ' RM' if ($removable); # Only run the removable check if asked  
   
      foreach my $drive (keys %{$hashref})  
      {  
 @@ -239,6 +240,10 @@  
                  {  
                      $hashref->{$drive}{REASON} .='MO ' if $self->mountpoint ($drive); last;  
                  }  
 +                if (/^RM/si) # Non-removable  
 +                {  
 +                    $hashref->{$drive}{REASON} .='RM ' unless $self->removable ($drive); last;  
 +                }  
                  if (/^SZ/si) # filesystem size, this includes mounting to check free space  
                  {  
                      $hashref->{$drive}{REASON} .='SZ ' if $self->checkBackupDriveSize ($drive, $bsize);  
 @@ -360,13 +365,20 @@  
      return ($hashref->{$kname}{MODEL});  
  }  
   
 +sub removable  
 +{  
 +    my ($self,$kname) = @_;  
 +    my $hashref = $self->{_blox};  
 +    return ($hashref->{$kname}{RM}) ? 1 : $EMPTY;  
 +}  
 +  
  # Given the KNAME return the label  
  # returns 'no label' if none found  
  sub label  
  {  
      my ($self,$kname) = @_;  
      my $hashref = $self->{_blox};  
 -    return ($hashref->{$kname}{LABEL}) || gettext('no label');  
 +    return ($hashref->{$kname}{LABEL}) || gettext('nolabel');  
  }  
   
  sub size  


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed