diff options
author | rillig <rillig@pkgsrc.org> | 2005-07-20 16:56:24 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2005-07-20 16:56:24 +0000 |
commit | 134872c6801711ad7a0580fce874ec6ccd891ba5 (patch) | |
tree | efa3a2e1c12a86c79f613569b6a61ecdadcc2148 /pkgtools | |
parent | be35fe2dc1cddfd723d55ef246d686c1dd135d86 (diff) | |
download | pkgsrc-134872c6801711ad7a0580fce874ec6ccd891ba5.tar.gz |
Changed the default value of $pkgname from "" to undefined.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 1fa5c030d59..e439492da7b 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -11,7 +11,7 @@ # Freely redistributable. Absolutely no warranty. # # From Id: portlint.pl,v 1.64 1998/02/28 02:34:05 itojun Exp -# $NetBSD: pkglint.pl,v 1.205 2005/07/20 16:52:28 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.206 2005/07/20 16:56:24 rillig Exp $ # # This version contains lots of changes necessary for NetBSD packages # done by: @@ -386,7 +386,7 @@ sub init_global_vars() { %seen_Makefile_include = (); $seen_Makefile_common = false; %predefined_sites = (); - $pkgname = ""; + $pkgname = undef; %make_vars_typemap = (); } @@ -1565,7 +1565,7 @@ sub checkfile_Makefile($$) { $extractsufx = '.tar.gz'; } - if ($pkgname ne '' && $pkgname eq $distname) { + if (defined($pkgname) && $pkgname eq $distname) { $opt_warn_vague && log_warning(NO_FILE, NO_LINE_NUMBER, "PKGNAME is \${DISTNAME} by default, ". "you don't need to define PKGNAME."); } @@ -1575,7 +1575,7 @@ sub checkfile_Makefile($$) { "than 5 characters."); } } - my $i = ($pkgname eq '') ? $distname : $pkgname; + my $i = defined($pkgname) ? $pkgname : $distname; $i =~ s/\${DISTNAME[^}]*}/$distname/g; if ($i =~ /-([^-]+)$/) { my ($j, $k) = ($`, $1); @@ -1590,14 +1590,14 @@ sub checkfile_Makefile($$) { "looks fine."); } else { $opt_warn_vague && log_error(NO_FILE, NO_LINE_NUMBER, "Version number part of PKGNAME". - (($pkgname eq '') + (!defined($pkgname) ? ', which is derived from DISTNAME, ' : ' '). "looks illegal. You should modify \"-$k\"."); } } else { $opt_warn_vague && log_error(NO_FILE, NO_LINE_NUMBER, "PKGNAME". - (($pkgname eq '') + (!defined($pkgname) ? ', which is derived from DISTNAME, ' : ' '). "must come with version number, like \"foobaa-1.0\"."); @@ -1632,7 +1632,7 @@ sub checkfile_Makefile($$) { } # make an advice only in certain cases. - if ($pkgname ne '' && $distfiles =~ /^$pkgname([-\.].+)$/) { + if (defined($pkgname) && $distfiles =~ /^$pkgname([-\.].+)$/) { $opt_warn_vague && log_warning(NO_FILE, NO_LINE_NUMBER, "How about \"DISTNAME=$pkgname\"". (($1 eq '.tar.gz') ? "" |