diff --git a/Build.PL b/Build.PL index b6de0f4..9fbfdc1 100644 --- a/Build.PL +++ b/Build.PL @@ -10,6 +10,7 @@ my $build = Simba::Build->new requires => { 'Readonly' => 0, 'Digest::SHA1' => 0, + 'Config::YAML' => 0, }, script_files => [ 'scripts/da', diff --git a/lib/Simba/DA.pm b/lib/Simba/DA.pm index e31cf49..1d5ee85 100644 --- a/lib/Simba/DA.pm +++ b/lib/Simba/DA.pm @@ -11,6 +11,7 @@ use List::Util qw(min); use IO::Handle; use Simba::Util qw(quote unquote typestr); use POSIX qw(strftime); +use Config::YAML; Readonly my $BUFSIZE => 128 * 1024; #my $BUFSIZE = 128 * 1024; @@ -35,15 +36,22 @@ sub new { # * Other system dependent parameters, e.g., whether to use ACLs # # For now we just hardcode the stuff: - - $self->{prune} = { - # directories to prune. These are relative - # paths which may not be ideal. - './proc' => 1, - './sys' => 1, - './nfs' => 1, - './backup' => 1, - }; + my $config = Config::YAML->new( config => '/etc/simba/ca.conf'); + if ($config->{prune}) { + for (@{ $config->{prune} }) { + $_ = ".$_" if (m{^/}); + $self->{prune}{$_} = 1; + } + } else { + $self->{prune} = { + # directories to prune. These are relative + # paths which may not be ideal. + './proc' => 1, + './sys' => 1, + './nfs' => 1, + './backup' => 1, + }; + } $self->{charset} = 'utf-8'; $self->{fh_out} = exists($opt->{fh_out}) ? $opt->{fh_out} : \*STDOUT; $self->{fh_log} = exists($opt->{fh_log}) ? $opt->{fh_log} : \*STDERR;