From owner-freebsd-ports Thu Nov 27 16:32:58 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA03958 for ports-outgoing; Thu, 27 Nov 1997 16:32:58 -0800 (PST) (envelope-from owner-freebsd-ports) Received: from ppp6488.on.bellglobal.com (ppp6488.on.bellglobal.com [206.172.208.80]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id QAA03915; Thu, 27 Nov 1997 16:31:38 -0800 (PST) (envelope-from tim@ppp6488.on.bellglobal.com) Received: from localhost (tim@localhost) by ppp6488.on.bellglobal.com (8.8.7/8.8.7) with SMTP id TAA02061; Thu, 27 Nov 1997 19:29:40 -0500 (EST) (envelope-from tim@ppp6488.on.bellglobal.com) Date: Thu, 27 Nov 1997 19:29:39 -0500 (EST) From: Tim Vanderhoek X-Sender: tim@ppp6488.on.bellglobal.com To: ports@FreeBSD.ORG cc: asami@FreeBSD.ORG Subject: patch to bsd.port.mk: >1 md5 hash per file Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ports@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk We handle multiple MASTER_SITES for a single file, but we do not properly handle the case where an otherwise identical file has two different md5 hashes when fetched from different MASTER_SITES. Eg. The xdeview port's distfile is available from three different sites. For some silly reason, the file on the tsx ftp site has a different md5 hash than the file on the other two sites, even though it is identical otherwise. If a user fetches from tsx (possibly because the other two sites are slow, which they often are), their md5 checksum will fail. It would be nice if the md5 hash for both versions of the file could be included in files/md5, even if the addition of the 2nd hash had to be done manually. Included below is a (one-line) patch to bsd.port.mk which enables just such a feature (surprise! :-). The alternatives are for me to tell any more people who ask why the checksum fails that they have to manually bypass the checksum because we can't handle such cases (as I had to tell the last one), to use IGNOREFILES (the thought of which makes me cringe -- too many use that already), or to comment-out the tsx site. Given that we now have ~1200 ports, I'm sure there are more ports which could use such a feature. I don't intend to do this unless I get a couple of definite affirmitives (a nice one from the portsmeister would do well :). --- bsd.port.mk Thu Nov 20 00:33:56 1997 +++ /usr/share/mk/bsd.port.mk Thu Nov 27 18:50:25 1997 @@ -1381,9 +1381,9 @@ elif [ "$$CKSUM2" = "IGNORE" ]; then \ ${ECHO_MSG} ">> Checksum for $$file is set to IGNORE in md5 file even though"; \ ${ECHO_MSG} " the file is not in the "'$$'"{IGNOREFILES} list."; \ OK="false"; \ - elif [ "$$CKSUM" = "$$CKSUM2" ]; then \ + elif expr "$$CKSUM2" : ".*$$CKSUM" > /dev/null; then \ ${ECHO_MSG} ">> Checksum OK for $$file."; \ else \ ${ECHO_MSG} ">> Checksum mismatch for $$file."; \ OK="false"; \ -- tIM...HOEk OPTIMIZATION: the process of using many one-letter variables names hoping that the resultant code will run faster.