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: remove extra cod...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/34cd2c9fbb8f
branches:  trunk
changeset: 383153:34cd2c9fbb8f
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Aug 13 10:41:21 2022 +0000

description:
lintpkgsrc: remove extra code for determining the pkg_install version

There is no apparent reason for this code. Lintpkgsrc could already
parse the version of pkg_install, by falling back to running bmake.

When run in debug mode, 'lintpkgsrc -D .' failed because lintpkgsrc used
a wrong regular expression instead of just calling dirname. While here,
fix the variable name 'pkgsrcdir' to simply 'pkgdir', as the previous
name was highly confusing.

diffstat:

 pkgtools/lintpkgsrc/files/lintpkgsrc.pl |  15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)

diffs (53 lines):

diff -r c49bf70b0231 -r 34cd2c9fbb8f pkgtools/lintpkgsrc/files/lintpkgsrc.pl
--- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Sat Aug 13 10:23:40 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Sat Aug 13 10:41:21 2022 +0000
@@ -1,6 +1,6 @@
 #!@PERL5@
 
-# $NetBSD: lintpkgsrc.pl,v 1.83 2022/08/13 10:23:40 rillig Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.84 2022/08/13 10:41:21 rillig Exp $
 
 # Written by David Brownlee <abs%netbsd.org@localhost>.
 #
@@ -150,7 +150,6 @@
 
 my (
     $pkgdb,                    # Database of pkgsrc packages
-    $pkg_installver,           # Installed version of pkg_install pseudo-pkg
     $default_vars,             # Set for Makefiles, inc PACKAGES & PKGSRCDIR
     %opt,                      # Command line options
     @matched_prebuiltpackages, # List of obsolete prebuilt package paths
@@ -624,8 +623,6 @@
 
 sub get_default_makefile_vars() {
 
-       chomp($pkg_installver = `$conf_pkg_info -V 2>/dev/null || echo 20010302`);
-
        chomp($_ = `uname -srm`);
        (
            $default_vars->{OPSYS},
@@ -944,10 +941,10 @@
        if (!defined $pkgname || $pkgname =~ /\$/ || $pkgname !~ /(.*)-(\d.*)/) {
 
                # invoke make here as a last resort
-               my ($pkgsrcdir) = ($file =~ m:(/.*)/:);
-               debug("Running '$conf_make' in '$pkgsrcdir'\n");
+               my $pkgdir = dirname $file;
+               debug("Running '$conf_make' in '$pkgdir'\n");
                my $pid = open3(\*WTR, \*RDR, \*ERR,
-                   "cd $pkgsrcdir || exit 1; $conf_make show-vars VARNAMES=PKGNAME");
+                   "cd $pkgdir || exit 1; $conf_make show-vars VARNAMES=PKGNAME");
                if (!$pid) {
                        warn "$file: Unable to run make: $!";
                } else {
@@ -967,10 +964,6 @@
        }
 
        if (defined $pkgname) {
-               if ($pkgname =~ /^pkg_install-(\d+)$/ && $1 < $pkg_installver) {
-                       $pkgname = "pkg_install-$pkg_installver";
-               }
-
                $pkgname = canonicalize_pkgname($pkgname);
 
                if (defined $vars->{PKGREVISION}



Home | Main Index | Thread Index | Old Index