Subject: Re: pkglint and variable with number (was Re: CVS commit: wip/XFree86-docs)
To: Jeremy C. Reed <reed@reedmedia.net>
From: Alistair Crooks <agc@wasabisystems.com>
List: tech-pkg
Date: 07/24/2003 15:05:11
On Wed, Jul 23, 2003 at 10:12:09PM -0700, Jeremy C. Reed wrote:
> (Previously mentioned on pkgsrc-wip-discuss where this message is also
> bcc'd.)
> 
> Is this fix okay?
> 
> --- /usr/pkg/bin/pkglint	Sat Apr  5 17:54:31 2003
> +++ /home/reed/netbsd/pkglint	Wed Jul 23 22:07:18 2003
> @@ -1084,7 +1084,7 @@
>  				(($pkgname eq '') ? "DISTNAME." : "PKGNAME."));
>  		}
>  		# Be very smart. Kids, don't do this at home.
> -		if ($k =~ /\$(\(|\{)([A-Z_-]+)(\)|\})/) {
> +		if ($k =~ /\$(\(|\{)([A-Z][A-Z0-9_-]*)(\)|\})/) {
>  			$k1 = $2;
>  			$k = $1 if ($rawwhole =~ /\n$k1[ \t]*?=[ \t]*([^\n]+)\n/);
>  		}
> 
> By the way, make(1) says: "Variables in make are much like variables in
> the shell, and, by tradition, consist of all upper-case letters."

make(1) is wrong - variable names can also contain the '.' character,
as well as underscores, and lower case letters.  I believe that it's
only convention that makes us use upper case for variables, and lower
case for targets.

Regards,
Alistair