diff options
author | rillig <rillig@pkgsrc.org> | 2022-01-01 13:27:37 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2022-01-01 13:27:37 +0000 |
commit | 275a45f5f3665964c9ebf1ffeeb6dbe4c9735fab (patch) | |
tree | 17a560e1be2017ae282e6edc95ae7051328db0bc /pkgtools | |
parent | 1f5076b7a785b258dd3f288352764613a1392410 (diff) | |
download | pkgsrc-275a45f5f3665964c9ebf1ffeeb6dbe4c9735fab.tar.gz |
lintpkgsrc: fix bogus warning for devel/lua-moses
The warning was:
Bogus: -${DISTNAME:tl:S/-1$//1}
(from /.../devel/lua-moses/Makefile)
Previously, lintpkgsrc searched for the package name and version by
looking for '-' followed by a digit. This was too naive, as in the
above expression, the '-1' does not mark the beginning of the version
number. Fix this by resorting to 'make show-vars' in all cases in which
the PKGNAME still contains a '$'.
When running 'lintpkgsrc -Dp devel/lua-moses' with a relative directory
as argument, lintpkgsrc tried 'cd /lua-moses' and ignored the failure,
running 'make show-vars' in the current directory instead, which in my
case was the top-level pkgsrc directory.
Bump version.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/lintpkgsrc/Makefile | 5 | ||||
-rwxr-xr-x | pkgtools/lintpkgsrc/files/lintpkgsrc.pl | 7 |
2 files changed, 6 insertions, 6 deletions
diff --git a/pkgtools/lintpkgsrc/Makefile b/pkgtools/lintpkgsrc/Makefile index 7acfc67c463..5a32a00c4d9 100644 --- a/pkgtools/lintpkgsrc/Makefile +++ b/pkgtools/lintpkgsrc/Makefile @@ -1,7 +1,6 @@ -# $NetBSD: Makefile,v 1.36 2021/05/24 19:53:41 wiz Exp $ +# $NetBSD: Makefile,v 1.37 2022/01/01 13:27:37 rillig Exp $ -PKGNAME= lintpkgsrc-4.96 -PKGREVISION= 1 +PKGNAME= lintpkgsrc-4.97 CATEGORIES= pkgtools MAINTAINER= pkgsrc-users@NetBSD.org diff --git a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl index 0dcc6b2cc29..f8beeaac632 100755 --- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl +++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl @@ -1,6 +1,6 @@ #!@PERL5@ -# $NetBSD: lintpkgsrc.pl,v 1.20 2020/12/17 16:17:45 rillig Exp $ +# $NetBSD: lintpkgsrc.pl,v 1.21 2022/01/01 13:27:37 rillig Exp $ # Written by David Brownlee <abs@netbsd.org>. # @@ -961,12 +961,13 @@ sub parse_makefile_pkgsrc($) { debug("$file: DISTNAME=$vars->{DISTNAME}\n"); } - if ( !defined $pkgname || $pkgname !~ /(.*)-(\d.*)/ ) { + 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 $pid = open3( \*WTR, \*RDR, \*ERR, - "cd $pkgsrcdir ; ${conf_make} show-vars VARNAMES=PKGNAME" ); + "cd $pkgsrcdir || exit 1; ${conf_make} show-vars VARNAMES=PKGNAME" ); if ( !$pid ) { warn "$file: Unable to run make: $!"; } |