pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/lintpkgsrc/files lintpkgsrc: clean up code fo...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f7458748eed7
branches:  trunk
changeset: 383244:f7458748eed7
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Mon Aug 15 21:09:13 2022 +0000

description:
lintpkgsrc: clean up code for listing required packages

diffstat:

 pkgtools/lintpkgsrc/files/lintpkgsrc.pl |  19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diffs (35 lines):

diff -r e5dbf7ad2df0 -r f7458748eed7 pkgtools/lintpkgsrc/files/lintpkgsrc.pl
--- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Mon Aug 15 21:00:56 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Mon Aug 15 21:09:13 2022 +0000
@@ -1,5 +1,5 @@
 #!@PERL5@
-# $NetBSD: lintpkgsrc.pl,v 1.95 2022/08/14 12:54:01 rillig Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.96 2022/08/15 21:09:13 rillig Exp $
 
 # Written by David Brownlee <abs%netbsd.org@localhost>.
 #
@@ -1574,20 +1574,11 @@
        foreach my $pkgver (@update) {
                my $pkgbase = $pkgver->pkgbase;
                print "$pkgbase:";
-               if (open(PKGINFO, "$conf_pkg_info -R $pkgbase |")) {
-                       my ($list);
-
-                       while (<PKGINFO>) {
-                               if (/Required by:/) {
-                                       $list = 1;
-                               } elsif ($list) {
-                                       chomp;
-                                       s/-\d.*//;
-                                       print " $_";
-                               }
-                       }
-                       close(PKGINFO);
+               open(PKGINFO, "$conf_pkg_info -q -R $pkgbase |") or die;
+               while (<PKGINFO>) {
+                       print " $1" if /^(.*?)-\d/;
                }
+               close(PKGINFO);
                print "\n";
        }
 



Home | Main Index | Thread Index | Old Index