From owner-ports-jp@jp.freebsd.org  Sat Jul  5 10:39:10 1997
Received: by jaz.jp.freebsd.org (8.8.6+2.7Wbeta5/8.7.3) id KAA13357
	Sat, 5 Jul 1997 10:39:10 +0900 (JST)
Received: by jaz.jp.freebsd.org (8.8.6+2.7Wbeta5/8.7.3) with ESMTP id KAA13349
	for <ports-jp@jp.freebsd.org>; Sat, 5 Jul 1997 10:39:09 +0900 (JST)
Received: from cylon.on.rim.or.jp (ppp060.on.rim.or.jp [202.247.138.188]) by april.on.rim.or.jp (8.8.5/3.4Wbeta6-rim1.1) with ESMTP id KAA16024; Sat, 5 Jul 1997 10:36:24 +0900 (JST)
Message-Id: <199707050136.KAA16024@april.on.rim.or.jp>
Received: from on.rim.or.jp by cylon.on.rim.or.jp (8.8.5/3.5Wpl5-97062421)
	id KAA06396; Sat, 5 Jul 1997 10:36:44 +0900 (JST)
To: ports-jp@jp.freebsd.org
From: Yoshishige Arai <ryo2@on.rim.or.jp>
In-Reply-To: Your message of "Fri, 04 Jul 1997 19:38:37 +0900"
References: <19970704193837-3611L.hikura@hiro.mobile.tcc.co.jp>
X-Mailer: Mew version 1.70 on Emacs 19.28.1 / Mule 2.3
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Date: Sat, 05 Jul 1997 10:36:43 +0900
Reply-To: ryo2@on.rim.or.jp
Precedence: bulk
X-Distribute: distribute [version 2.1 (Alpha) patchlevel=19]
X-Sequence: ports-jp 1302
Subject: [ports-jp 1302] Re: portlint 1.22
Errors-To: owner-ports-jp@jp.freebsd.org
Sender: owner-ports-jp@jp.freebsd.org

$B$"$i$$!w%j%`%M%C%H$G$9!#(B

On Sat, 05 Jul 1997 01:20:50 +0900 ([ports-jp 1293] Re: portlint 1.22)
Masafumi NAKANE/$BCf:,2mJ8(B<max@wide.ad.jp> wrote:

>      > # $B$=$b$=$b!"(Bbrace $B$K$h$k;2>H$H!"(B
>      > # paren $B$K$h$k;2>H$K0c$$$,$"$C$?$+K:$l$F$7$^$$$^$7$?(B(^^;
> 
> man make $B$G8+$k8B$j!"0c$$$O$J$5$=$&$G$9!#(B
> # $B$@$+$i$h$1$$$K$I$C$A$r;H$&$Y$-$+7h$a$kI,MW$,$"$k$N$+J,$+$i$J$$(B ....

$B$G$9$h$M!#$H$j$"$($:!"(Bportlint$B$G$O(B $() $B$OA4It(B ${} $B$K$7$F$*$$$F!"%*%W%7%g(B
$B%s$G$3$l$r%9%-%C%W(B($B$b$7$/$O%*%W%7%g%s$G%A%'%C%/(B)$B$G$-$k$h$&$K$9$k$C$F$N(B
$B$O$I$&$G$7$g$&$+!#(B

On Fri, 04 Jul 1997 19:27:31 +0900 ([ports-jp 1287] Re: portlint 1.22)
Hironori Ikura/ $B0KAR9-FA(B<hikura@tcc.co.jp> wrote:

> (2) defined(NOPORTDOCS)
> ${PREFIX}/share/doc $B$X$N%$%s%9%H!<%k$r!"(B
> ".if" $B$G$+$3$C$F$J$$$H(B
> 
> WARN: use ".if defined(NOPORTDOCS)" when you install $B!D!D(B
> 
> $B$H7Y9p$5$l$^$9$,!"(B".if !defined(NOPORTDOCS)" $B$HCN$i$;$?J}$,!"(B
> $BD>46E*$KEA$o$j$d$9$$$N$G$O!)(B

$B;d$b$=$&;W$$$^$9!#(B
IS_INTERACTIVE $B$K$D$$$F$b!"$"$N%a%C%;!<%8$@$H!"(B
$B!V$($C(B? .if (IS_INTERACTIVE) $B$r(B .if (BATCH) || (FOR_CDROM) $B$K$9$k$Y$-(B
$B$J$N(B?$B!W$H;W$C$F$7$^$&$+$b$7$l$^$;$s!#(B

$B$b$&0l$D!"(Bportlint$B$,!V(BPLIST $B$K(B ${PREFIX}/share/doc/* $B$,$"$C$F!"(B
Makefile $B$K(B ${NOPORTDOCS} $B$,;H$o$l$F$$$J$1$l$P7Y9p$r=P$9!W$H$$$&;EMM$K(B
$B$J$C$F$$$^$9$,!"(BWRKSRC $B0J2<$G(B ${PREFIX}/share/doc/ $B$K%$%s%9%H!<%k$7$F(B
$B$$$k>l9g!"(B port $B$N(B Makefile $B$K5-=R$7$F$$$J$$$N$K7Y9p$,=P$F!"%]!<%?!<$,(B
$BLL?)$i$&$H;W$&$N$G!"(B
$B!V(BPLIST $B$K(B ${PREFIX}/share/doc/* $B$,$"$C$F!"(B Makefile $B$K(B ${NOPORTDOCS} 
$B;H$o$l$F$$$J$/$F!"$+$D(B (${PREFIX}|/usr/local)/share/doc $B$,$J$1$l$P(B 
$B7Y9p$r=P$9!WJ}$,NI$$5$$b$7$^$9!#(B($B9M$($9$.(B?)

$BB>!"(B
DISTNAME=       unzip-5.3
DISTFILES=      unzip53.tar.gz

$B$N$h$&$K(B PKGNAME $B$,L5$$>l9g$K(B
461$B9TL\$N(B if ($distfiles =~ /^$pkgname(.+)$/) {
$B$rDL$C$F$7$^$C$F!"(B
WARN: how about "DISTNAME=" and "EXTRACT_SUFX=unzip53.tar.gz"?
$B$H8@$o$l$F$7$^$$$^$9!#99$K!"(B
WARN: do not use DISTFILES and DISTNAME to control WRKSRC. how about
"WRKSRC=${WRKDIR}/unzip-5.3"?
$B$N7Y9p$b=P$^$9$,!"85!9(B "NO_WRKSUBDIR=   YES"$B$,IU$$$F$$$k(B port $B$J$N$G!"(B
how about "WRKSRC=${WRKDIR}"? $B$,@5$7$$7Y9p$K$J$k$O$:$G$9!#(B
$B$G!"(B#1279$B$NCf:,$5$s$N$4;XE&$N$h$&$K(B WRKSRC$B9T(B $B$OMW$i$J$/$J$j$^$9!#(B
$B<B:]$3$N(B unzip$B$NNc$O!"(B

DISTNAME=       unzip53
PKGNAME=        unzip-5.3
($BCfN,(B)
NO_WRKSUBDIR=   YES

$B$G$&$^$/$$$-$^$9!#(B
$B$3$&$$$&>l9g!"(BDISTFILES $B$r;_$a$F(B PKGNAME $B;H$&J}$,NI$$$o$1$G$9$h$M(B?

$B$3$3$$$i$r4^$a$F!">!<j$J$,$i$^$?=$@5$7$F$_$^$7$?!#(B
Makefile$B$N(B $() $B$O>o$K(B ${}$B$KJQ49$7!"(B-b $B$G7Y9p$r=P$97A$K$7$F$*$-$^$7$?!#(B
$B$h$-$K7W$i$C$F2<$5$$$^$;!d(Bitojun$B$5$s(B
$B0J2<!"0KAR$5$s$N(B [ports-jp 1287] $B$N%Q%C%A$r$"$F$?$b$N$KBP$9$k(B diff 
$B$K$J$C$F$^$9!#(B

============================
--- portlint.pl-1.23.orig	Fri Jul  4 20:57:07 1997
+++ portlint.pl-1.23	Sat Jul  5 09:52:50 1997
@@ -16,16 +16,18 @@
 while (@ARGV > 0) {
 	$_ = shift;
 	/^-h/ && do {
-		@tmp = split(/\//, $0); $prog= pop(@tmp);
+		($prog) = ($0 =~ /([^\/]+)$/);
 		print <<EOF;
 usage: $prog [-avN] [port_directory]
 	-a	additional check for scripts/* and pkg/*
+	-b	warn for use of paresized variables in the Makefile
 	-v	verbose mode
 	-N	writing a new port
 EOF
 		exit 0;
 	};
 	/^-a/ && do {$extrafile = 1; next;};
+	/^-b/ && do {$parenwarn = 1; next;};
 	/^-v/ && do {$verbose = 1; next;};
 	/^-N/ && do {$newport = 1; next;};
 	$portdir = $_;
@@ -277,6 +279,17 @@
 		&perror("FATAL: contiguous blank lines (> 2lines) found ".
 			"in $file.");
 	}
+	
+	#
+	# whole file: parensized variables
+	#
+	$paren = ($whole =~ s/\$\([\w\d]+\)/\${$1}/g);
+	if ($parenwarn) {
+	    print "OK: checking $parensized variables in $file.\n"
+		if ($verbose);
+	    &perror("WARN: use of \${} is encouraged instead of \$().")
+		if ($paren);
+	}
 
 	#
 	# whole file: IS_INTERACTIVE/NOPORTDOCS
@@ -439,26 +452,26 @@
 
 	# check DISTFILES.
 	# 
-	# if DISTFILES have only single item, it is better to avlid DISTFILES
-	# and use combination of DISTNAME and EXTRACT_SUFX.
+	# if DISTFILES have only single item, it is better to avoid DISTFILES
+	# and to use combination of DISTNAME and EXTRACT_SUFX.
 	# example:
 	#	DISTNAME= package
 	#	PKGNAME=  package-1.0
 	#	DISTFILES=package-1.0.tar.gz
 	# should be
 	#	DISTNAME= package-1.0
-	#	WRKSRC=   ${WRKDIR}/package
-	$distfiles = $1 if ($tmp =~ /\nDISTFILES[+?]?=\s*([^\n]*)\n/);
-	$pkgname = $1 if ($tmp =~ /\nPKGNAME[+?]?=\s*([^\n]*)\n/);
-	$distname = $1 if ($tmp =~ /\nDISTNAME[+?]?=\s*([^\n]*)\n/);
-	if ($distfiles ne '' && $distfiles !~ /[ \t]/) {
+	#	WRKSRC=   ${WRKDIR}/apackage
+	$distfiles = $1 if ($tmp =~ /\nDISTFILES[+?]?=\s*([^\n]+)\n/);
+	$pkgname = $1 if ($tmp =~ /\nPKGNAME[+?]?=\s*(\S+)/);
+	$distname = $1 if ($tmp =~ /\nDISTNAME[+?]?=\s*(\S+)/);
+	if ($distfiles =~ /^\S+$/) {
 		$bogusdistfiles++;
 		print "OK: seen DISTFILES with single item, checking value.\n"
 			if ($verbose);
 		&perror("WARN: use of DISTFILES with single file ".
 			"discouraged. use combination of DISTNAME and ".
 			"EXTRACT_SUFX instead.");
-		if ($distfiles =~ /^$pkgname(.+)$/) {
+		if ($pkgname ne '' && $distfiles =~ /^$pkgname(.+)$/) {
 			&perror("WARN: how about \"DISTNAME=$pkgname\"".
 				(($1 eq '.tar.gz')
 					? "?"
@@ -572,16 +585,25 @@
 	$tmp = "\n" . $tmp;	# to make the begin-of-line check easier
 
 	# check WRKSRC
-	if ($tmp =~ /\nWRKSRC[+?]?=\s*([^\n]*)\n/) {
+	if (($wrksrc) = ($tmp =~ /\nWRKSRC[+?]?=\s*([^\n]*)\n/)) {
 		print "OK: seen WRKSRC, checking value.\n" if ($verbose);
-		if ($1 eq 'work' || $1 eq '${WRKDIR}') {
-			&perror("WARN: WRKSRC is set to meaningless value ".
-				"\"$1\". use \"NO_WRKSUBDIR=yes\" instead.");
-		}
 	} else {
 		print "OK: WRKSRC not found, checking relation with others.\n"
 			if ($verbose);
+	}
+	if ($tmp =~ /\nNO_WRKSUBDIR[+?]?=\s*(\S+)/) {
 		if ($bogusdistfiles && $distname ne '') {
+			&perror("WARN: do not use DISTFILES and DISTNAME ".
+				"to control WRKSRC. how about to employ ".
+				"the trunk of \"$distfiles\" as DISTNAME".
+				" and to use \"$distname\" for PKGNAME?");
+		}
+	} else {
+		if ($wrksrc eq 'work' || $wrksrc eq '${WRKDIR}') {
+			&perror("WARN: WRKSRC is set to meaningless value ".
+				"\"$wrksrc\". use \"NO_WRKSUBDIR=yes\" instead.");
+		}
+		if ($wrksrc || $bogusdistfiles && $distname ne '') {
 			&perror("WARN: do not use DISTFILES and DISTNAME ".
 				"to control WRKSRC. ".
 				"how about \"WRKSRC=\${WRKDIR}/$distname\"?");
============================

$B:G8e$K0l$D!"(B
>do-install:
>	install -d -m 555 -o ${SHAREOWN} -g ${SHAREGRP} ${PREFIX}/share/doc/unzip
$B$C$F$N$KBP$7!"(B
WARN: possible direct use of command "install" found. use ${INSTALL} instead.
$B$,=P$^$9$,!"$3$N>l9g$O(B bsd.port.mk $B$,(B
INSTALL_DOCDIR= \
        ${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE}
$B$H$+$9$k$N$,6Z$_$?$$$J5$$b$7$^$9!#(B
porlint $B$H$7$F$O8=>u$N$^$^$GNI$$$H;W$$$^$9$,!#(B
--------
 $B9S0fNI=E(B(Yoshishige Arai)
 E-Mail: ryo2@on.rim.or.jp
