Here's a major tweak to both update-plist and corresponding documentation.
I'm afraid that a lot of people are not running pkglocate at all, because
it takes a lot of time when a lot of files are involved, so I propose a
"middle ground" as default, which should be acceptable to everyone.
- by default update-plist will only run pkglocate on "new files", stuff
that was not already in the existing plists.
- there's still the existing optimization of having a PKGLOCATE_COOKIE,
which means that pkglocate won't run again while adjusting some details of
the plist if it's run again.
and so, we end up with two options: -F which still prevents pkglocate from
running at all (probably unnecessary and dangerous in most cases now, even
though finding conflicts in the dependency tree takes a bit of time, I don't
think it's a lot) and -f, which should be used from time to time, in case
you want to run "full" conflict checks.
[Note that in case of version changes, assuming there are proper variables
in place in the plists, there will be no "new files", as we substitute
variables on the existing plist, so files will gracefully move over to the
new version without any human intervention]
Assuming everyone "plays ball" and dutifully checks for conflicts at least
once for a new port, -f should not even be needed.
Okays ?
Index: update-plist.1
===================================================================
RCS file: /cvs/src/share/man/man1/update-plist.1,v
retrieving revision 1.6
diff -u -p -r1.6 update-plist.1
--- update-plist.1 8 Aug 2019 20:37:08 -0000 1.6
+++ update-plist.1 8 Nov 2020 11:03:41 -0000
@@ -24,7 +24,7 @@
.Ev PORTSDIR Ns = Ns Ar path
.Op Ev FAKE_TREE_OWNER Ns = Ns Ar user Ev PORTS_TREE_OWNER Ns = Ns Ar user Nm doas
.Nm
-.Op Fl Fmnqrvx
+.Op Fl Ffmnqrvx
.Op Fl C Ar dir
.Op Fl c Ar var
.Op Fl E Ar ext
@@ -104,6 +104,10 @@ extension instead of the default
.It Fl F
Do not try to run
.Xr pkg_locate 1 .
+.It Fl f
+Force
+.Xr pkg_locate 1
+to look up every file for conflicts instead of just the new ones.
.It Fl I Ar var
Variable
.Ar var
Index: update-plist
===================================================================
RCS file: /cvs/ports/infrastructure/bin/update-plist,v
retrieving revision 1.193
diff -u -p -r1.193 update-plist
--- update-plist 7 Nov 2020 10:54:22 -0000 1.193
+++ update-plist 8 Nov 2020 11:03:14 -0000
@@ -1150,8 +1150,11 @@ sub bookmark
sub locate_files
{
- my ($self, $locator) = @_;
- $locator->add_param($self->fullname);
+ my ($self, $locator, $exact) = @_;
+ my $p = $self->fullname;
+ if (!exists $exact->{$p}) {
+ $locator->add_param($p);
+ }
}
sub write_backsubst
@@ -1383,8 +1386,8 @@ sub handle_options
},
};
- $state->SUPER::handle_options('rvI:c:qV:FC:i:j:L:s:S:X:P:w:e:E:',
- '[-Fmnrvx] [-C dir] [-c comment] [-E ext] [-e ext] [-i var]',
+ $state->SUPER::handle_options('rvI:c:qV:fFC:i:j:L:s:S:X:P:w:e:E:',
+ '[-Ffmnrvx] [-C dir] [-c comment] [-E ext] [-e ext] [-i var]',
'[-I ignored] [-j jobs] [-L logfile] [-P pkgdir] [-S var]',
'[-s var] [-V var] [-w suffix] [-X path] -- pkg_create_args ...');
$state->{pkgdir} = $state->opt('P');
@@ -1814,7 +1817,11 @@ sub locate_list
{
my ($self, $p) = @_;
my $locator = OpenBSD::Pkglocate->new($p->{state});
- $p->nlist->locate_files($locator);
+ my $exact = $self->{exact}; # by default do not look up known files
+ if ($self->{state}->opt('f')) { # unless we ask for them: neuter lookup
+ $exact = {}; # table
+ }
+ $p->nlist->locate_files($locator, $exact);
my $l = $p->nlist->conflict_list;
my $r = $locator->result;
for my $pkgname (sort keys %$r) {
No comments:
Post a Comment