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: Wed Aug 17 17:47:50 UTC 2022
Modified Files:
pkgsrc/pkgtools/lintpkgsrc/files: lintpkgsrc.pl
Log Message:
lintpkgsrc: eliminate common subexpression when parsing package
To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 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.109 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.110
--- pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.109 Wed Aug 17 17:40:09 2022
+++ pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl Wed Aug 17 17:47:50 2022
@@ -1,5 +1,5 @@
#!@PERL5@
-# $NetBSD: lintpkgsrc.pl,v 1.109 2022/08/17 17:40:09 rillig Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.110 2022/08/17 17:47:50 rillig Exp $
# Written by David Brownlee <abs%netbsd.org@localhost>.
#
@@ -998,16 +998,16 @@ sub parse_makefile_pkgsrc($file) {
if (defined $pkgname) {
$pkgname = canonicalize_pkgname($pkgname);
- if (defined $vars->{PKGREVISION}
- and not $vars->{PKGREVISION} =~ /^\s*$/) {
- if ($vars->{PKGREVISION} =~ /^\$\{(_(CVS|GIT|HG|SVN)_PKGVERSION):.*\}$/) {
+ my $pkgrevision = $vars->{PKGREVISION};
+ if (defined $pkgrevision and not $pkgrevision =~ /^\s*$/) {
+ if ($pkgrevision =~ /^\$\{(_(CVS|GIT|HG|SVN)_PKGVERSION):.*\}$/) {
# See wip/mk/*-package.mk.
- } elsif ($vars->{PKGREVISION} =~ /\D/) {
- print "\nBogus: PKGREVISION $vars->{PKGREVISION} (from $file)\n";
+ } elsif ($pkgrevision =~ /\D/) {
+ print "\n";
+ print "Bogus: PKGREVISION $pkgrevision (from $file)\n";
- } elsif ($vars->{PKGREVISION}) {
- $pkgname .= 'nb';
- $pkgname .= $vars->{PKGREVISION};
+ } elsif ($pkgrevision > 0) {
+ $pkgname .= "nb$pkgrevision";
}
}
@@ -1015,8 +1015,8 @@ sub parse_makefile_pkgsrc($file) {
print "\nBogus: $pkgname (from $file)\n";
} elsif ($pkgname =~ /(.*)-(\d.*)/) {
- if ($pkgdata) {
- my ($pkgver) = $pkgdata->add($1, $2);
+ if (defined $pkgdata) {
+ my $pkgver = $pkgdata->add($1, $2);
debug("add $1 $2");
Home |
Main Index |
Thread Index |
Old Index