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.
This commit is contained in:
espie 2011-11-22 16:44:53 +00:00
parent 9155010918
commit fdc7a9c9fd
2 changed files with 22 additions and 4 deletions

View File

@ -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 <espie@openbsd.org>
#
@ -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

View File

@ -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 <espie@openbsd.org>
#
@ -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);