pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/lintpkgsrc



Module Name:    pkgsrc
Committed By:   rillig
Date:           Sat Jan  1 13:27:37 UTC 2022

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 pkgsrc/pkgtools/lintpkgsrc/Makefile
cvs rdiff -u -r1.20 -r1.21 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/Makefile
diff -u pkgsrc/pkgtools/lintpkgsrc/Makefile:1.36 pkgsrc/pkgtools/lintpkgsrc/Makefile:1.37
--- pkgsrc/pkgtools/lintpkgsrc/Makefile:1.36    Mon May 24 19:53:41 2021
+++ pkgsrc/pkgtools/lintpkgsrc/Makefile Sat Jan  1 13:27:37 2022
@@ -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

Index: pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl
diff -u pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.20 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.21
--- pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.20 Thu Dec 17 16:17:45 2020
+++ pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl      Sat Jan  1 13:27:37 2022
@@ -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 @@ 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: $!";
         }



Home | Main Index | Thread Index | Old Index