Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Nov 1997 19:29:39 -0500 (EST)
From:      Tim Vanderhoek <hoek@FreeBSD.ORG>
To:        ports@FreeBSD.ORG
Cc:        asami@FreeBSD.ORG
Subject:   patch to bsd.port.mk: >1 md5 hash per file
Message-ID:  <Pine.BSF.3.96.971127190751.2029A-100000@ppp6488.on.bellglobal.com>

next in thread | raw e-mail | index | archive | help

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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.971127190751.2029A-100000>