diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-12-17 16:20:20 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-12-17 16:20:20 +0100 |
commit | 20e07437f413e338f2b54447133e1533f5262c13 (patch) | |
tree | c76b32b67ada1fdda9d52314a1f7445ebf9761eb /lib/App/ArchLinux/PackagerTools/Config.pm | |
parent | a64d07890544d2d2a503c52a6d92ff3e064c5585 (diff) | |
download | App-ArchLinux-PackagerTools-20e07437f413e338f2b54447133e1533f5262c13.tar.gz App-ArchLinux-PackagerTools-20e07437f413e338f2b54447133e1533f5262c13.tar.xz |
WIP Add cache
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'lib/App/ArchLinux/PackagerTools/Config.pm')
-rw-r--r-- | lib/App/ArchLinux/PackagerTools/Config.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/App/ArchLinux/PackagerTools/Config.pm b/lib/App/ArchLinux/PackagerTools/Config.pm index a44c845..470a1ae 100644 --- a/lib/App/ArchLinux/PackagerTools/Config.pm +++ b/lib/App/ArchLinux/PackagerTools/Config.pm @@ -37,9 +37,12 @@ method new($class: $deps = {}) { } method new_no_defaults($class: $deps = {}) { + return $deps->{context}->{$class} if defined $deps->{context}->{$class}; + my $self = {}; bless $self, $class; $self->{deps} = $deps; + $deps->{context}->{$class} = $self; return $self; } @@ -80,6 +83,10 @@ Return a hash with the default config values. method _get_default_config() { return { + cache => { + root_dir => path(($ENV{XDG_CACHE_HOME} // $ENV{HOME}."/.cache")."/perlpkg/v1/")->stringify(), + cache_size => '50M', + }, }; } |