From: espie Date: Sun, 29 May 2022 10:48:41 +0000 (+0000) Subject: final part of caching for always-update: the new annotation doesn't need X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=efe01a68322951673b992f4ebe0121e7fadd1f3c;p=openbsd final part of caching for always-update: the new annotation doesn't need any specific handling. --- diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository/Cache.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository/Cache.pm index d450331c9ec..e4a7ff6c1d1 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.10 2022/05/20 20:31:38 espie Exp $ +# $OpenBSD: Cache.pm,v 1.11 2022/05/29 10:48:41 espie Exp $ # # Copyright (c) 2022 Marc Espie # @@ -63,7 +63,6 @@ sub prime_update_info_cache my ($self, $state, $setlist) = @_; my $progress = $state->progress; - my $uncached = {}; my $found = {}; my $pseudo_search = [$self]; @@ -114,9 +113,6 @@ sub prime_update_info_cache $found->{OpenBSD::PackageName::splitstem($pkgname)} = 1; $self->{raw_data}{$pkgname} //= ''; $self->{raw_data}{$pkgname} .= "$value\n"; - if ($value =~ m/\@option\s+always-update/) { - $uncached->{$pkgname} = 1; - } if ($pkgname ne $oldname) { $oldname = $pkgname; $done++; @@ -125,9 +121,6 @@ sub prime_update_info_cache } } close($fh); - for my $pkgname (keys %$uncached) { - delete $self->{raw_data}{$pkgname} - } return unless $state->defines("CACHING_VERBOSE"); for my $k (@list) { if (!defined $found->{$k}) { diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm index ec02d539b33..b143ae78d13 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingList.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingList.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingList.pm,v 1.147 2020/01/02 12:27:04 espie Exp $ +# $OpenBSD: PackingList.pm,v 1.148 2022/05/29 10:48:41 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -279,8 +279,9 @@ sub UpdateInfoOnly { my ($fh, $cont) = @_; while (<$fh>) { - # if alwaysupdate, all info is sig - if (m/^\@option\s+always-update\b/o) { + # if old alwaysupdate, all info is sig + # if new, we don't need the rest + if (m/^\@option\s+always-update$/o) { &$cont($_); while (<$fh>) { &$cont($_); diff --git a/usr.sbin/pkg_add/OpenBSD/Signature.pm b/usr.sbin/pkg_add/OpenBSD/Signature.pm index a98e31fa301..37f84e2ce54 100644 --- a/usr.sbin/pkg_add/OpenBSD/Signature.pm +++ b/usr.sbin/pkg_add/OpenBSD/Signature.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Signature.pm,v 1.26 2022/05/19 09:20:31 espie Exp $ +# $OpenBSD: Signature.pm,v 1.27 2022/05/29 10:48:41 espie Exp $ # # Copyright (c) 2010 Marc Espie # @@ -236,11 +236,11 @@ sub new { my ($class, $pkgname, $extra, $plist) = @_; my $o = $class->SUPER::new($pkgname, $extra); - my $hash; - open my $fh, '>', \$hash; - $plist->write_without_variation($fh); - close $fh; - $o->{hash} = $hash; + my $a = $plist->get('always-update'); + if (!defined $a->{hash}) { + $a->hash_plist($plist); + } + $o->{hash} = $a->{hash}; return $o; }