pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/lintpkgsrc/files lintpkgsrc: cleanup: reduce ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/4318d03b3592
branches: trunk
changeset: 383323:4318d03b3592
user: rillig <rillig%pkgsrc.org@localhost>
date: Wed Aug 17 18:25:26 2022 +0000
description:
lintpkgsrc: cleanup: reduce indentation of parse_makefile_pkgsrc
diffstat:
pkgtools/lintpkgsrc/files/lintpkgsrc.pl | 93 +++++++++++++++-----------------
1 files changed, 45 insertions(+), 48 deletions(-)
diffs (113 lines):
diff -r 15a7757222d8 -r 4318d03b3592 pkgtools/lintpkgsrc/files/lintpkgsrc.pl
--- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl Wed Aug 17 18:22:26 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl Wed Aug 17 18:25:26 2022 +0000
@@ -1,5 +1,5 @@
#!@PERL5@
-# $NetBSD: lintpkgsrc.pl,v 1.112 2022/08/17 18:22:26 rillig Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.113 2022/08/17 18:25:26 rillig Exp $
# Written by David Brownlee <abs%netbsd.org@localhost>.
#
@@ -988,58 +988,55 @@
}
}
- if (defined $pkgname) {
- $pkgname = canonicalize_pkgname($pkgname);
+ defined $pkgname or return ();
+
+ $pkgname = canonicalize_pkgname($pkgname);
+
+ my $pkgrevision = $vars->{PKGREVISION};
+ if (defined $pkgrevision && $pkgrevision !~ /^\s*$/) {
+ if ($pkgrevision =~ /^\$\{ (?:
+ _CVS_PKGVERSION |
+ _GIT_PKGVERSION_CMD |
+ _HG_PKGVERSION_CMD |
+ _SVN_PKGREVISION_CMD) :.* \}$ /x) {
+ # See wip/mk/*-package.mk.
+ } elsif ($pkgrevision =~ /\D/) {
+ print "\n";
+ print "Bogus: PKGREVISION $pkgrevision (from $file)\n";
+
+ } elsif ($pkgrevision > 0) {
+ $pkgname .= "nb$pkgrevision";
+ }
+ }
- my $pkgrevision = $vars->{PKGREVISION};
- if (defined $pkgrevision && $pkgrevision !~ /^\s*$/) {
- if ($pkgrevision =~ /^\$\{ (?:
- _CVS_PKGVERSION |
- _GIT_PKGVERSION_CMD |
- _HG_PKGVERSION_CMD |
- _SVN_PKGREVISION_CMD) :.* \}$ /x) {
- # See wip/mk/*-package.mk.
- } elsif ($pkgrevision =~ /\D/) {
- print "\n";
- print "Bogus: PKGREVISION $pkgrevision (from $file)\n";
+ if ($pkgname =~ /\$/) {
+ print "\nBogus: $pkgname (from $file)\n";
+
+ } elsif ($pkgname =~ /(.*)-(\d.*)/) {
+ if (defined $pkgdata) {
+ my $pkgver = $pkgdata->add($1, $2);
+
+ debug("add $1 $2");
- } elsif ($pkgrevision > 0) {
- $pkgname .= "nb$pkgrevision";
+ foreach my $var (qw(DEPENDS RESTRICTED OSVERSION_SPECIFIC BROKEN)) {
+ $pkgver->var($var, $vars->{$var});
+ }
+
+ if (defined $vars->{NO_BIN_ON_FTP}) {
+ $pkgver->var('RESTRICTED', 'NO_BIN_ON_FTP');
+ }
+
+ if ($file =~ m:([^/]+/[^/]+)/Makefile$:) {
+ $pkgver->var('dir', $1);
+ } else {
+ $pkgver->var('dir', 'unknown');
}
}
-
- if ($pkgname =~ /\$/) {
- print "\nBogus: $pkgname (from $file)\n";
-
- } elsif ($pkgname =~ /(.*)-(\d.*)/) {
- if (defined $pkgdata) {
- my $pkgver = $pkgdata->add($1, $2);
-
- debug("add $1 $2");
-
- foreach my $var (qw(DEPENDS RESTRICTED OSVERSION_SPECIFIC BROKEN)) {
- $pkgver->var($var, $vars->{$var});
- }
+ } else {
+ print "Cannot extract $pkgname version ($file)\n";
+ }
- if (defined $vars->{NO_BIN_ON_FTP}) {
- $pkgver->var('RESTRICTED', 'NO_BIN_ON_FTP');
- }
-
- if ($file =~ m:([^/]+/[^/]+)/Makefile$:) {
- $pkgver->var('dir', $1);
- } else {
- $pkgver->var('dir', 'unknown');
- }
- }
- } else {
- print "Cannot extract $pkgname version ($file)\n";
- }
-
- return ($pkgname, $vars);
-
- } else {
- return (undef);
- }
+ ($pkgname, $vars);
}
Home |
Main Index |
Thread Index |
Old Index