diff options
author | rillig <rillig> | 2006-10-05 21:09:31 +0000 |
---|---|---|
committer | rillig <rillig> | 2006-10-05 21:09:31 +0000 |
commit | 22e9eb3379150b561613c0d4d7fde0e749050a6d (patch) | |
tree | 6be1264c7f0fd726cecc31bda19bdc143c67d141 /pkgtools | |
parent | 2bb60da0068a72f1c3f9afb2fc3e699d014a39b7 (diff) | |
download | pkgsrc-22e9eb3379150b561613c0d4d7fde0e749050a6d.tar.gz |
Improved the heuristics for absolute pathnames.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 13 |
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); |