summaryrefslogtreecommitdiffstats
path: root/lib/App/BorgRestore
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-09-09 13:20:10 +0200
committerFlorian Pritz <bluewind@xinu.at>2018-09-09 15:45:11 +0200
commit4618b97a5ee76a9b7bf469ff5d10d8ccacbce011 (patch)
treecf0caef3a500c5d1853a0ee306ae55d4f9a22255 /lib/App/BorgRestore
parent0c56663e09dd80a2c5225446a46b5bd908eb829d (diff)
downloadApp-BorgRestore-4618b97a5ee76a9b7bf469ff5d10d8ccacbce011.tar.gz
App-BorgRestore-4618b97a5ee76a9b7bf469ff5d10d8ccacbce011.tar.xz
Get settings via hash instead of direct variable access
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'lib/App/BorgRestore')
-rw-r--r--lib/App/BorgRestore/Settings.pm30
1 files changed, 16 insertions, 14 deletions
diff --git a/lib/App/BorgRestore/Settings.pm b/lib/App/BorgRestore/Settings.pm
index 2aea1ae..81c2cac 100644
--- a/lib/App/BorgRestore/Settings.pm
+++ b/lib/App/BorgRestore/Settings.pm
@@ -153,6 +153,21 @@ method new_no_defaults($class: $deps = {}) {
return $self;
}
+method get_config() {
+ return {
+ borg => {
+ repo => $borg_repo,
+ path_prefixes => [@backup_prefixes],
+ },
+ cache => {
+ base_path => $cache_path_base,
+ database_path => "$cache_path_base/v3/archives.db",
+ prepare_data_in_memory => $prepare_data_in_memory,
+ sqlite_memory_cache_size => $sqlite_cache_size,
+ }
+ };
+}
+
fun load_config_files() {
my @configfiles;
@@ -173,23 +188,10 @@ fun load_config_files() {
}
}
-fun get_cache_base_dir_path($path) {
+method get_cache_base_dir_path($path) {
return "$cache_path_base/$path";
}
-fun get_cache_dir() {
- return "$cache_path_base/v3";
-}
-
-fun get_cache_path($item) {
- return get_cache_dir()."/$item";
-}
-
-fun get_db_path() {
- return get_cache_path('archives.db');
-}
-
-
1;
__END__