From mi@aldan.ziplink.net  Thu Jan 29 21:18:05 1998
Received: from aldan.ziplink.net (mi@kot.ne.mediaone.net [24.128.29.55])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA15521
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 29 Jan 1998 21:18:04 -0800 (PST)
          (envelope-from mi@aldan.ziplink.net)
Received: (from mi@localhost)
	by aldan.ziplink.net (8.8.8/8.8.7) id FAA15016;
	Fri, 30 Jan 1998 05:18:02 GMT
	(envelope-from mi)
Message-Id: <199801300518.FAA15016@aldan.ziplink.net>
Date: Fri, 30 Jan 1998 05:18:02 GMT
From: Mikhail Teterin <mi@aldan.algebra.com>
Reply-To: mi@aldan.algebra.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: bsd.port.mk computing checksum ALWAYS even when not needed
X-Send-Pr-Version: 3.2

>Number:         5602
>Category:       ports
>Synopsis:       when files/md5 does not contain a checksum -- do not compute it
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 29 21:20:01 PST 1998
>Closed-Date:    Sun Feb 1 20:04:49 PST 1998
>Last-Modified:  Sun Feb  1 20:05:59 PST 1998
>Originator:     Mikhail Teterin
>Release:        FreeBSD 3.0-CURRENT
>Organization:
Virtual Estates, Inc.
>Environment:

>Description:

	Even when files/md5 says IGNORE, or a checksum is not there,
	bsd.port.mk will still compute the checksum, only to discard it
	later.

>How-To-Repeat:

>Fix:
	
	The following seems to fix the problem. May not be the best solution
	though:

--- /usr/share/mk/bsd.port.mk.orig	Sun Jan 11 14:18:57 1998
+++ /usr/share/mk/bsd.port.mk	Fri Jan 30 00:07:31 1998
@@ -1375,3 +1375,2 @@
 		  for file in ${_CKSUMFILES}; do \
-			CKSUM=`${MD5} < $$file`; \
 			CKSUM2=`${GREP} "^MD5 ($$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \
@@ -1384,3 +1383,3 @@
 				OK="false"; \
-			elif [ "$$CKSUM" = "$$CKSUM2" ]; then \
+			elif [ "`${MD5} < $$file`" = "$$CKSUM2" ]; then \
 				${ECHO_MSG} ">> Checksum OK for $$file."; \
>Release-Note:
>Audit-Trail:

From: Tim Vanderhoek <ac199@hwcn.org>
To: Mikhail Teterin <mi@aldan.algebra.com>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: ports/5602: bsd.port.mk computing checksum ALWAYS even when not needed
Date: Sat, 31 Jan 1998 20:52:46 -0500 (EST)

 On Fri, 30 Jan 1998, Mikhail Teterin wrote:
 
 > 	The following seems to fix the problem. May not be the best solution
 > 	though:
 > 
 > --- /usr/share/mk/bsd.port.mk.orig	Sun Jan 11 14:18:57 1998
 > +++ /usr/share/mk/bsd.port.mk	Fri Jan 30 00:07:31 1998
 
 This patch isn't to the current version of bsd.port.mk.
 
 > @@ -1384,3 +1383,3 @@
 >  				OK="false"; \
 > -			elif [ "$$CKSUM" = "$$CKSUM2" ]; then \
 > +			elif [ "`${MD5} < $$file`" = "$$CKSUM2" ]; then \
 
 And you just managed to hit one of the very few lines that has
 changed in the new version.  :-)
 
 Anyways, the problem you describe won't occur if IGNOREFILES
 is correctly set in the port makefile (search for ^CKSUMFILES
 and read that portion of bsd.port.mk to see why).  The two elif
 checks before the one you change are "assert()"-type error cases
 and shouldn't happen.
 
 If you found a port where IGNOREFILES is wrong, please file a pr
 for that.
 
 
 --
  tIM...HOEk
 OPTIMIZATION: the process of using many one-letter variables names
               hoping that the resultant code will run faster.
 
State-Changed-From-To: open->closed 
State-Changed-By: hoek 
State-Changed-When: Sun Feb 1 20:04:49 PST 1998 
State-Changed-Why:  
Problem won't occur if user properly upgrades local port copy. 
>Unformatted:
