diff options
author | rillig <rillig@pkgsrc.org> | 2022-08-13 10:41:21 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2022-08-13 10:41:21 +0000 |
commit | 9787a809c1506b924a4db6c9df5165558a1bdec1 (patch) | |
tree | 55d9064b02dec4be1c917a4a91e36cdcf455cf3f | |
parent | c0f2f9eb11fa5e2fe3ba2eb5a9093fabe49b4e39 (diff) | |
download | pkgsrc-9787a809c1506b924a4db6c9df5165558a1bdec1.tar.gz |
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.
-rwxr-xr-x | pkgtools/lintpkgsrc/files/lintpkgsrc.pl | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl index c93c3518570..5ba2b255299 100755 --- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl +++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl @@ -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>. # @@ -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 = undef) { 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} |