From owner-freebsd-ports Wed Dec 15 7:40: 9 1999 Delivered-To: freebsd-ports@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id D490E1526D for ; Wed, 15 Dec 1999 07:40:06 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id HAA70987; Wed, 15 Dec 1999 07:40:06 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from news.uni-kl.de (news.uni-kl.de [131.246.137.51]) by hub.freebsd.org (Postfix) with SMTP id 3DA3B15220 for ; Wed, 15 Dec 1999 07:30:58 -0800 (PST) (envelope-from naddy@unix-ag.uni-kl.de) Received: from sushi.unix-ag.uni-kl.de ( sushi.unix-ag.uni-kl.de [131.246.89.13] ) by news.uni-kl.de id aa25993 for ; 15 Dec 1999 16:33 MEZ Received: from fettuccini.unix-ag.uni-kl.de (fettuccini.unix-ag.uni-kl.de [131.246.89.27]) by sushi.unix-ag.uni-kl.de (8.9.3/8.9.1) with ESMTP id QAA24918 for ; Wed, 15 Dec 1999 16:30:48 +0100 Received: (from naddy@localhost) by fettuccini.unix-ag.uni-kl.de (8.9.3/8.9.3) id QAA44121; Wed, 15 Dec 1999 16:30:55 +0100 (CET) (envelope-from naddy) Message-Id: <199912151530.QAA44121@fettuccini.unix-ag.uni-kl.de> Date: Wed, 15 Dec 1999 16:30:55 +0100 (CET) From: Christian Weisgerber Reply-To: naddy@unix-ag.uni-kl.de To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: ports/15495: Add "addsum" target to bsd.port.mk Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 15495 >Category: ports >Synopsis: Add "addsum" target to bsd.port.mk >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Dec 15 07:40:00 PST 1999 >Closed-Date: >Last-Modified: >Originator: Christian Weisgerber >Release: FreeBSD 4.0-CURRENT i386 >Organization: Unix-AG, Uni Kaiserslautern >Environment: >Description: The appended patch adds an "addsum" target to bsd.port.mk. As the name implies, "addsum" puts additional checksums into files/md5 rather than overwriting it completely as "makesum" does. This is very handy in the (admittedly rather rare) case where your DISTFILES/PATCHFILES change depending on options such as NO_X11. From Marc Espie 's work on OpenBSD. >How-To-Repeat: >Fix: --- bsd.port.mk.old Wed Dec 15 16:04:52 1999 +++ bsd.port.mk Wed Dec 15 16:04:58 1999 @@ -292,6 +292,8 @@ # the same file. # checksum - Use files/md5 to ensure that your distfiles are valid. # makesum - Generate files/md5 (only do this for your own ports!). +# addsum - update files/md5 in a non-destructive way +# (your own ports only!) # # Default sequence for "all" is: fetch checksum extract patch configure build # @@ -878,8 +880,11 @@ SED?= /usr/bin/sed SETENV?= /usr/bin/env SH?= /bin/sh +SORT?= /usr/bin/sort TR?= /usr/bin/tr TRUE?= /usr/bin/true +UNIQ?= /usr/bin/uniq +WC?= /usr/bin/wc WHICH?= /usr/bin/which # Used to print all the '===>' style prompts - override this to turn them off. @@ -2118,6 +2123,24 @@ # this line goes after the ${MD5} above # echo "SIZE ($$file) = "`wc -c < $$file` >> ${MD5_FILE}; \ +.if !target(addsum) +addsum: fetch + @${MKDIR} ${FILESDIR} && ${TOUCH} ${MD5_FILE} + @(cd ${DISTDIR}; \ + for file in ${_CKSUMFILES}; do \ + ${MD5} $$file >> ${MD5_FILE}; \ + done) + @for file in ${_IGNOREFILES}; do \ + ${ECHO} "MD5 ($$file) = IGNORE" >> ${MD5_FILE}; \ + done + @${SORT} -u -o ${MD5_FILE} ${MD5_FILE} + @if [ `${SED} -e 's/\=.*$$//' ${MD5_FILE} | ${UNIQ} -d | ${WC} -l` -ne 0 ]; then \ + ${ECHO} "Inconsistent checksum in ${MD5_FILE}"; \ + exit 1; \ + else \ + ${ECHO} "${MD5_FILE} updated okay, don't forget to remove cruft"; \ + fi +.endif .if !target(checksum) checksum: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message