projects
/
BackupPC.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e55a4b2
)
remove Filesys::Df dependency
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 3 Jan 2011 21:56:20 +0000
(21:56 +0000)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 3 Jan 2011 21:56:20 +0000
(21:56 +0000)
bin/BackupPC_burnArchiveCLI
patch
|
blob
|
history
diff --git
a/bin/BackupPC_burnArchiveCLI
b/bin/BackupPC_burnArchiveCLI
index
399e2a4
..
3a6d8dc
100755
(executable)
--- a/
bin/BackupPC_burnArchiveCLI
+++ b/
bin/BackupPC_burnArchiveCLI
@@
-2,7
+2,7
@@
use strict;
use strict;
-use lib "
__INSTALLDIR__
/lib";
+use lib "
/usr/local/BackupPC
/lib";
use DBI;
use BackupPC::Lib;
use DBI;
use BackupPC::Lib;
@@
-12,7
+12,6
@@
use POSIX qw/strftime/;
use Term::Menus;
use File::Which;
use File::Path;
use Term::Menus;
use File::Which;
use File::Path;
-use Filesys::Df;
use Cwd qw/abs_path/;
use Data::Dumper;
use Cwd qw/abs_path/;
use Data::Dumper;
@@
-64,6
+63,14
@@
die "problem with $iso_dir, check ISOTempDir in configuration\n" unless (-d $iso
#---- subs ----
#---- subs ----
+sub df_bytes_available {
+ my $path = shift;
+ my $out = `df -P $path`;
+ my $bytes = (split(/\s+/, (split(/\n/,$out))[-1]))[3];
+ return $bytes * 1024;
+
+}
+
sub fmt_time {
my $t = shift || return;
my $out = "";
sub fmt_time {
my $t = shift || return;
my $out = "";
@@
-413,8
+420,7
@@
foreach my $copy_nr ( 1 .. $copies ) {
# check available disk space
# check available disk space
- my $df = df($iso_dir)->{bavail} || die "can't get free space on $iso_dir";
- $df *= 1024; # calulate space in bytes
+ my $df = df_bytes_available($iso_dir);
if ($df < $v_size) {
warn "ABORTED: not enough disk space to create ISO ! [need ", fmt_mb($v_size), " have ", fmt_mb( $df ), " on $iso_dir]\n";
next;
if ($df < $v_size) {
warn "ABORTED: not enough disk space to create ISO ! [need ", fmt_mb($v_size), " have ", fmt_mb( $df ), " on $iso_dir]\n";
next;