Hello,

looking at the diff to update the modules in www/nginx I noted that the
output doesn't fully take into account the current subpackage:

        % make port-lib-depends-check

        nginx-njs-1.22.0p0(www/nginx,-njs):
        Missing: m.10 (/var/www/modules/ngx_stream_js_module.so) (system lib)
        WANTLIB += m

it shows nginx-njs which is correct, but it suggests to add `m' to
WANTLIB.  What about showing the "correct" variable (i.e. WANTLIB-njs)?

        % make port-lib-depends-check

        nginx-njs-1.22.0p0(www/nginx,-njs):
        Missing: m.10 (/var/www/modules/ngx_stream_js_module.so) (system lib)
        WANTLIB-njs += m

I don't think that we can correctly tell in which WANTLIB variable the
missing library should end up (think for example if all the WANTLIBs are
missing the same library) but I think that in general it's slightly more
helpful to show the per-subpackage variable to change.

diff below shows the intended behaviour.  Due to my ignorance in perl
and in the package infrastructure it's very likely an obscenity, but i
didn't manage to come up with something better in limited time.


Index: check-lib-depends
===================================================================
RCS file: /home/cvs/ports/infrastructure/bin/check-lib-depends,v
retrieving revision 1.46
diff -u -p -r1.46 check-lib-depends
--- check-lib-depends   21 Jun 2021 15:16:52 -0000      1.46
+++ check-lib-depends   8 Jun 2022 07:48:34 -0000
@@ -595,7 +595,14 @@ sub analyze 
        unless ($state->{quiet} && keys %{$r->{wantlib}} == 0) {
                $self->print_list($state, "Extra: ", $extra);
        }
-       $self->print_list($state, "WANTLIB +=", $r->{wantlib});
+
+       my $subpkg = '';
+       my @multi = keys(%{$plist->fullpkgpath2->{'mandatory'}});
+       if (@multi) {
+               $subpkg = $multi[0];
+       }
+
+       $self->print_list($state, "WANTLIB$subpkg +=", $r->{wantlib});
        if ($state->{full}) {
                $needed_libs->dump(\*STDOUT);
        }

Reply via email to