| @@ -1,16 +1,16 @@ | | | @@ -1,16 +1,16 @@ |
1 | #! @PERL@ | | 1 | #! @PERL@ |
2 | | | 2 | |
3 | # $NetBSD: lintpkgsrc.pl,v 1.115 2007/11/22 09:36:38 rillig Exp $ | | 3 | # $NetBSD: lintpkgsrc.pl,v 1.116 2012/05/08 23:11:48 sbd Exp $ |
4 | | | 4 | |
5 | # Written by David Brownlee <abs@netbsd.org>. | | 5 | # Written by David Brownlee <abs@netbsd.org>. |
6 | # | | 6 | # |
7 | # Caveats: | | 7 | # Caveats: |
8 | # The 'Makefile parsing' algorithm used to obtain package versions and | | 8 | # The 'Makefile parsing' algorithm used to obtain package versions and |
9 | # DEPENDS information is geared towards speed rather than perfection, | | 9 | # DEPENDS information is geared towards speed rather than perfection, |
10 | # though it has gotten somewhat better over time, it only parses the | | 10 | # though it has gotten somewhat better over time, it only parses the |
11 | # simpler Makefile conditionals. | | 11 | # simpler Makefile conditionals. |
12 | # | | 12 | # |
13 | # TODO: Handle fun DEPENDS like avifile-devel with | | 13 | # TODO: Handle fun DEPENDS like avifile-devel with |
14 | # {qt2-designer>=2.2.4,qt2-designer-kde>=2.3.1nb1} | | 14 | # {qt2-designer>=2.2.4,qt2-designer-kde>=2.3.1nb1} |
15 | | | 15 | |
16 | $^W = 1; | | 16 | $^W = 1; |
| @@ -984,27 +984,27 @@ sub parse_makefile_vars($$) { | | | @@ -984,27 +984,27 @@ sub parse_makefile_vars($$) { |
984 | $vars{'.CURDIR'} = $1; | | 984 | $vars{'.CURDIR'} = $1; |
985 | | | 985 | |
986 | } | | 986 | } |
987 | else { | | 987 | else { |
988 | $vars{'.CURDIR'} = getcwd; | | 988 | $vars{'.CURDIR'} = getcwd; |
989 | } | | 989 | } |
990 | | | 990 | |
991 | $incdirs{ $vars{'.CURDIR'} } = 1; | | 991 | $incdirs{ $vars{'.CURDIR'} } = 1; |
992 | if ( $opt{L} ) { | | 992 | if ( $opt{L} ) { |
993 | print "$file\n"; | | 993 | print "$file\n"; |
994 | } | | 994 | } |
995 | | | 995 | |
996 | while ( defined( $_ = shift(@data) ) ) { | | 996 | while ( defined( $_ = shift(@data) ) ) { |
997 | s/\s*#.*//; | | 997 | s/\s*[^\\]#.*//; |
998 | | | 998 | |
999 | # Continuation lines | | 999 | # Continuation lines |
1000 | # | | 1000 | # |
1001 | while ( substr( $_, -1 ) eq "\\" ) { | | 1001 | while ( substr( $_, -1 ) eq "\\" ) { |
1002 | substr( $_, -2 ) = shift @data; | | 1002 | substr( $_, -2 ) = shift @data; |
1003 | } | | 1003 | } |
1004 | | | 1004 | |
1005 | # Conditionals | | 1005 | # Conditionals |
1006 | # | | 1006 | # |
1007 | if (m#^\.\s*if(|def|ndef)\s+(.*)#) { | | 1007 | if (m#^\.\s*if(|def|ndef)\s+(.*)#) { |
1008 | my ( $type, $false ); | | 1008 | my ( $type, $false ); |
1009 | | | 1009 | |
1010 | $type = $1; | | 1010 | $type = $1; |