fix a logic error from 2018: be silent if any of -S, -n, -q are mentioned.
authorespie <espie@openbsd.org>
Tue, 1 Nov 2022 17:25:33 +0000 (17:25 +0000)
committerespie <espie@openbsd.org>
Tue, 1 Nov 2022 17:25:33 +0000 (17:25 +0000)
The actual bug reverted in 1.128 was from "make print-plist-libs"
which would invoke pkg_create -n -Q  and filter out the libs: but
in that case, pkg_create would not be silent, thus yielding
    reading plist|-/usr/local/lib/libpython3.9.so.0.0
to filter, which obviously wouldn't work.

So, turn on silent mode for -Q as well.

usr.sbin/pkg_add/OpenBSD/PkgCreate.pm

index 592a19b..b85ecca 100644 (file)
@@ -1,6 +1,6 @@
 #! /usr/bin/perl
 # ex:ts=8 sw=4:
-# $OpenBSD: PkgCreate.pm,v 1.182 2022/06/28 09:01:45 espie Exp $
+# $OpenBSD: PkgCreate.pm,v 1.183 2022/11/01 17:25:33 espie Exp $
 #
 # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
 #
@@ -127,8 +127,9 @@ sub handle_options
        } 
 
        $state->{base} = $base;
-       $state->{silent} = defined $state->opt('n') && defined $state->opt('n')
-           || defined $state->opt('S');
+       # switch to silent mode for *any* introspection option
+       $state->{silent} = defined $state->opt('n') || defined $state->opt('q')
+           || defined $state->opt('Q') || defined $state->opt('S');
        if (defined $state->opt('u')) {
                $state->{userlist} = $state->parse_userdb($state->opt('u'));
        }