From c06e9cc8cfb705953e8d69c9f395e94974cec5c4 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 18 Jun 2013 09:50:31 +0200 Subject: [PATCH] apt: always create new AptPkg::Cache object. To re-open database - else we get old/cached entries. --- PVE/API2/APT.pm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/PVE/API2/APT.pm b/PVE/API2/APT.pm index e5c2452d..afa920a5 100644 --- a/PVE/API2/APT.pm +++ b/PVE/API2/APT.pm @@ -18,13 +18,9 @@ use AptPkg::Cache; use AptPkg::Version; use AptPkg::PkgRecords; -my $apt_cache; - my $get_apt_cache = sub { - return $apt_cache if $apt_cache; - - $apt_cache = AptPkg::Cache->new() || die "unable to initialize AptPkg::Cache\n"; + my $apt_cache = AptPkg::Cache->new() || die "unable to initialize AptPkg::Cache\n"; return $apt_cache; };