pkgsrc-Changes-HG archive

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

[.joined/pkgsrc/trunk]: .joined/pkgsrc/pkgtools/lintpkgsrc lintpkgsrc: fix bo...



details:   https://anonhg.NetBSD.org/.joined/pkgsrc/rev/994ac26527a5
branches:  trunk
changeset: 370876:994ac26527a5
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Jan 01 13:27:37 2022 +0000

description:
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:

 pkgtools/lintpkgsrc/Makefile            |  5 ++---
 pkgtools/lintpkgsrc/files/lintpkgsrc.pl |  7 ++++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diffs (40 lines):

diff -r b266740d9cc3 -r 994ac26527a5 pkgtools/lintpkgsrc/Makefile
--- a/pkgtools/lintpkgsrc/Makefile      Sat Jan 01 12:59:15 2022 +0000
+++ b/pkgtools/lintpkgsrc/Makefile      Sat Jan 01 13:27:37 2022 +0000
@@ -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@localhost
diff -r b266740d9cc3 -r 994ac26527a5 pkgtools/lintpkgsrc/files/lintpkgsrc.pl
--- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Sat Jan 01 12:59:15 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Sat Jan 01 13:27:37 2022 +0000
@@ -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@localhost>.
 #
@@ -961,12 +961,13 @@
         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: $!";
         }



Home | Main Index | Thread Index | Old Index