pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Improved the heuristics for abs...
details: https://anonhg.NetBSD.org/pkgsrc/rev/0a1ed666c8ac
branches: trunk
changeset: 519580:0a1ed666c8ac
user: rillig <rillig%pkgsrc.org@localhost>
date: Thu Oct 05 21:09:31 2006 +0000
description:
Improved the heuristics for absolute pathnames.
diffstat:
pkgtools/pkglint/files/pkglint.pl | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diffs (37 lines):
diff -r 60336869821a -r 0a1ed666c8ac pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Thu Oct 05 18:51:01 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Thu Oct 05 21:09:31 2006 +0000
@@ -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 @@
$opt_debug_trace and $line->log_debug("checkline_source_absolute_pathname(${text})");
- if ($text =~ qr"(.*)\"(/[^\"]*)\"") {
- my ($before, $string) = ($1, $2);
-
-
- if ($before =~ qr"[A-Z_]+\s*") {
+ if ($text =~ qr"(.*)([\"'])(/[^\"']*)\2") {
+ my ($before, $delim, $string) = ($1, $2, $3);
+
+ $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 @@
} 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);
Home |
Main Index |
Thread Index |
Old Index