From fdc7a9c9fd3cbb169e784ec4a1783424b7783e09 Mon Sep 17 00:00:00 2001 From: espie Date: Tue, 22 Nov 2011 16:44:53 +0000 Subject: [PATCH] subtle effect of equivalence: sometimes, we do not get back the subdir we asked for. This can be a problem, as rescan relies on it to reenter the path in the various queues. So, when we build the equivalence hash, give special treatment to extra paths that match the actual subdirs list. Problem reported by naddy@, who sees sporadic errors linked to NFS lag, which mean that paths sometimes get flagged as errors, then later the error vanishes automatically when the package appears... well, this makes darn sure the correct pkgpath does not vanish. --- infrastructure/lib/DPB/PkgPath.pm | 22 ++++++++++++++++++++-- infrastructure/lib/DPB/Vars.pm | 4 ++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/infrastructure/lib/DPB/PkgPath.pm b/infrastructure/lib/DPB/PkgPath.pm index c106268a72a..e32639e02ca 100644 --- a/infrastructure/lib/DPB/PkgPath.pm +++ b/infrastructure/lib/DPB/PkgPath.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PkgPath.pm,v 1.21 2011/11/13 22:18:04 espie Exp $ +# $OpenBSD: PkgPath.pm,v 1.22 2011/11/22 16:44:53 espie Exp $ # # Copyright (c) 2010 Marc Espie # @@ -222,17 +222,35 @@ sub simplifies_to print $quicklog $self->fullpkgpath, " -> ", $simpler->fullpkgpath, "\n"; } +# XXX +# this is complicated, we want to mark equivalent paths, but we do not want +# to record them as to build by default, but if we're asking for explicit +# subdirs, we have to deal with them. +# so, create $h that holds all paths, and selectively copy the ones from +# todo, along with the set in $want that corresponds to the subdirlist. + sub handle_equivalences { - my ($class, $state, $todo) = @_; + my ($class, $state, $todo, $want) = @_; my $h = {}; + my $result = {}; for my $v (values %$todo) { $h->{$v} = $v; + $result->{$v} = $v; $v->handle_default_flavor($h, $state); $v->handle_default_subpackage($h, $state); } DPB::Job::Port->equates($h); DPB::Heuristics->equates($h); + + if (defined $want) { + for my $v (values %$h) { + if ($want->{$v->fullpkgpath}) { + $result->{$v} = $v; + } + } + } + return $result; } sub zap_default diff --git a/infrastructure/lib/DPB/Vars.pm b/infrastructure/lib/DPB/Vars.pm index b4a6c54b962..d75d5034e5a 100644 --- a/infrastructure/lib/DPB/Vars.pm +++ b/infrastructure/lib/DPB/Vars.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Vars.pm,v 1.23 2011/11/14 19:03:41 espie Exp $ +# $OpenBSD: Vars.pm,v 1.24 2011/11/22 16:44:53 espie Exp $ # # Copyright (c) 2010 Marc Espie # @@ -118,7 +118,7 @@ sub grab_list my $subdir; my $category; my $reset = sub { - DPB::PkgPath->handle_equivalences($grabber->{state}, $h); + $h = DPB::PkgPath->handle_equivalences($grabber->{state}, $h, $subdirs); $grabber->{fetch}->build_distinfo($h, $grabber->{state}->{fetch_only}); DPB::PkgPath->merge_depends($h);