From 2dc79e6b41c32ad0960dd70609aa810cece69419 Mon Sep 17 00:00:00 2001 From: espie Date: Fri, 29 Apr 2022 10:44:05 +0000 Subject: [PATCH] finally, turn on caching by default change the defines: TEST_CACHING -> !NO_CACHING TEST_CACHING_VERBOSE -> CACHING_VERBOSE TEST_CACHING_RECHECK -> CACHING_RECHECK okay with sthen@ --- usr.sbin/pkg_add/OpenBSD/PackageLocation.pm | 4 ++-- usr.sbin/pkg_add/OpenBSD/PackageRepository/Cache.pm | 10 +++++----- .../pkg_add/OpenBSD/PackageRepository/Installed.pm | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm index b1c541a2ba0..8094bf53c21 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackageLocation.pm,v 1.57 2022/04/19 12:51:32 espie Exp $ +# $OpenBSD: PackageLocation.pm,v 1.58 2022/04/29 10:44:05 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie # @@ -64,7 +64,7 @@ OpenBSD::Auto::cache(update_info, my $state = $self->{repository}{state}; my $info = $self->{repository}->get_cached_info($name); if (defined $info && - !defined $state->defines("TEST_CACHING_RECHECK")) { + !defined $state->defines("CACHING_RECHECK")) { return $info; } my $result = $self->plist(\&OpenBSD::PackingList::UpdateInfoOnly, diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository/Cache.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository/Cache.pm index e1a937c88db..2c65d197802 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageRepository/Cache.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository/Cache.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Cache.pm,v 1.4 2022/04/20 09:24:07 espie Exp $ +# $OpenBSD: Cache.pm,v 1.5 2022/04/29 10:44:05 espie Exp $ # # Copyright (c) 2022 Marc Espie # @@ -44,7 +44,7 @@ sub pipe_locate '-d', OpenBSD::Paths->updateinfodb, '--'); my $state = $self->{state}; $state->errsay("Running #1", join(' ', @params)) - if $state->defines("TEST_CACHING_VERBOSE"); + if $state->defines("CACHING_VERBOSE"); return @params; } @@ -97,7 +97,7 @@ sub prime_update_info_cache for my $pkgname (keys %$uncached) { delete $self->{raw_data}{$pkgname} } - return unless $state->defines("TEST_CACHING_VERBOSE"); + return unless $state->defines("CACHING_VERBOSE"); for my $k (@list) { if (!defined $found->{$k}) { $state->say("No cache entry for #1", $k); @@ -117,7 +117,7 @@ sub get_cached_info my $stem = OpenBSD::PackageName::splitstem($name); if (exists $self->{stems}{$stem}) { $state->say("Negative caching for #1", $name) - if $state->defines("TEST_CACHING_VERBOSE"); + if $state->defines("CACHING_VERBOSE"); return undef; } $content = ''; @@ -136,7 +136,7 @@ sub get_cached_info } if ($content eq '') { $state->say("Cache miss for #1", $name) - if $state->defines("TEST_CACHING_VERBOSE"); + if $state->defines("CACHING_VERBOSE"); return undef; } open my $fh2, "<", \$content; diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm index e12909bc7e0..f33e9c2ba8e 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Installed.pm,v 1.42 2022/04/28 08:39:18 espie Exp $ +# $OpenBSD: Installed.pm,v 1.43 2022/04/29 10:44:05 espie Exp $ # # Copyright (c) 2007-2014 Marc Espie # @@ -65,7 +65,7 @@ sub setup_cache my ($repo, $setlist) = @_; my $state = $repo->{state}; - return unless $state->defines("TEST_CACHING"); + return if $state->defines("NO_CACHING"); require OpenBSD::PackageRepository::Cache; -- 2.20.1