pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/lintpkgsrc/files



Module Name:    pkgsrc
Committed By:   rillig
Date:           Sat Aug 13 10:41:21 UTC 2022

Modified Files:
        pkgsrc/pkgtools/lintpkgsrc/files: lintpkgsrc.pl

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl
diff -u pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.83 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.84
--- pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.83 Sat Aug 13 10:23:40 2022
+++ pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl      Sat Aug 13 10:41:21 2022
@@ -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 $conf_x11base = '@X11BASE@';
 
 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 parse_makefile_vars($file, $cwd = un
 
 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 @@ sub parse_makefile_pkgsrc($file) {
        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 @@ sub parse_makefile_pkgsrc($file) {
        }
 
        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