apt: always create new AptPkg::Cache object.

To re-open database - else we get old/cached entries.
This commit is contained in:
Dietmar Maurer 2013-06-18 09:50:31 +02:00
parent b688d4389b
commit c06e9cc8cf

View File

@ -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;
};