summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2006-10-05 21:09:31 +0000
committerrillig <rillig@pkgsrc.org>2006-10-05 21:09:31 +0000
commit1f3af58308e6fe30cf0bac2e44e7d8f305127854 (patch)
tree6be1264c7f0fd726cecc31bda19bdc143c67d141 /pkgtools
parent106f64fad150780f91b73489146d9f0fe7a24fdb (diff)
downloadpkgsrc-1f3af58308e6fe30cf0bac2e44e7d8f305127854.tar.gz
Improved the heuristics for absolute pathnames.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl13
1 files changed, 8 insertions, 5 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 204ac59290c..aa4d2eecc56 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.677 2006/10/05 12:25:38 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.678 2006/10/05 21:09:31 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -3611,11 +3611,11 @@ sub checkline_source_absolute_pathname($$) {
$opt_debug_trace and $line->log_debug("checkline_source_absolute_pathname(${text})");
- if ($text =~ qr"(.*)\"(/[^\"]*)\"") {
- my ($before, $string) = ($1, $2);
+ if ($text =~ qr"(.*)([\"'])(/[^\"']*)\2") {
+ my ($before, $delim, $string) = ($1, $2, $3);
-
- if ($before =~ qr"[A-Z_]+\s*") {
+ $opt_debug_misc and $line->log_debug("checkline_source_absolute_pathname(before=${before}, string=${string})");
+ if ($before =~ qr"[A-Z_]+\s*$") {
# allowed: PREFIX "/bin/foo"
} elsif ($string =~ qr"^/[*/]") {
@@ -3687,6 +3687,9 @@ sub checkline_other_absolute_pathname($$) {
} elsif ($before =~ qr"\w$") {
# Something like $dir/lib
+ } elsif ($before =~ qr"\.$") {
+ # ../foo is not an absolute pathname.
+
} else {
$opt_debug_misc and $line->log_debug("before=${before}");
checkword_absolute_pathname($line, $path);