From 20e07437f413e338f2b54447133e1533f5262c13 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 17 Dec 2018 16:20:20 +0100 Subject: WIP Add cache Signed-off-by: Florian Pritz --- lib/App/ArchLinux/PackagerTools/Config.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/App/ArchLinux/PackagerTools/Config.pm') 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', + }, }; } -- cgit v1.2.3-24-g4f1b