diff options
author | rillig <rillig> | 2006-05-15 07:20:45 +0000 |
---|---|---|
committer | rillig <rillig> | 2006-05-15 07:20:45 +0000 |
commit | be81bd9bb3a8382ff904d2c51229bb3c67a9d16d (patch) | |
tree | 6e8059308e2d4eb3e64ad03603ae9a753c629a16 /pkgtools | |
parent | fc712871a5fb17536d0df32755c3001aa0f2b169 (diff) | |
download | pkgsrc-be81bd9bb3a8382ff904d2c51229bb3c67a9d16d.tar.gz |
Allow the compressed form of duplicate elimination for BUILDLINK_PACKAGES.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 4e388a4f960..1ca5cadfeed 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.581 2006/05/13 11:24:28 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.582 2006/05/15 07:20:45 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -3198,7 +3198,15 @@ sub checkline_mk_vartype_basic($$$$$$$) { } } elsif ($type eq "BuildlinkPackages") { - if ($value !~ qr"^(?:\$\{BUILDLINK_PACKAGES:N[+\-.0-9A-Z_a-z]+\}|[+\-.0-9A-Z_a-z]+)$") { + my $re_del = qr"\$\{BUILDLINK_PACKAGES:N[+\-.0-9A-Z_a-z]+\}"; + my $re_add = qr"[+\-.0-9A-Z_a-z]+"; + + if (($op eq ":=" && $value =~ qr"^${re_del}$") || + ($op eq ":=" && $value =~ qr"^${re_del}\s+${re_add}$") || + ($op eq "+" && $value =~ qr"^${re_add}$")) { + # Fine. + + } else { $line->log_warning("Invalid value for ${varname}."); } @@ -4344,13 +4352,18 @@ sub checkfile_buildlink3_mk($) { expect_empty_line($lines, \$lineno); # Third paragraph: Duplicate elimination. - if (!expect($lines, \$lineno, qr"^BUILDLINK_PACKAGES:=\t+\$\{BUILDLINK_PACKAGES:N\Q${bl_pkgbase}\E\}$")) { - $lines->[$lineno]->log_warning("Expected duplicate elimination line."); - return; - } - if (!expect($lines, \$lineno, qr"^BUILDLINK_PACKAGES\+=\t+\Q${bl_pkgbase}\E$")) { - $lines->[$lineno]->log_warning("Expected package addition line."); - return; + if (expect($lines, \$lineno, qr"^BUILDLINK_PACKAGES:=\t+\$\{BUILDLINK_PACKAGES:N\Q${bl_pkgbase}\E\}\s+\Q${bl_pkgbase}\E$")) { + # The compressed form of duplicate elimination. + + } else { + if (!expect($lines, \$lineno, qr"^BUILDLINK_PACKAGES:=\t+\$\{BUILDLINK_PACKAGES:N\Q${bl_pkgbase}\E\}$")) { + $lines->[$lineno]->log_warning("Expected duplicate elimination line."); + return; + } + if (!expect($lines, \$lineno, qr"^BUILDLINK_PACKAGES\+=\t+\Q${bl_pkgbase}\E$")) { + $lines->[$lineno]->log_warning("Expected package addition line."); + return; + } } expect_empty_line($lines, \$lineno); |