From owner-freebsd-ports Sun May 21 15:40: 6 2000 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 C5F2637B88F for ; Sun, 21 May 2000 15:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id PAA14249; Sun, 21 May 2000 15:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from mail.surf1.de (mail.surf1.de [194.25.165.21]) by hub.freebsd.org (Postfix) with ESMTP id C459437B850 for ; Sun, 21 May 2000 15:32:20 -0700 (PDT) (envelope-from alex@cichlids.com) Received: from cichlids.com (p3E9D38E7.dip0.t-ipconnect.de [62.157.56.231]) by mail.surf1.de (8.9.3/8.9.3) with ESMTP id AAA16846 for ; Mon, 22 May 2000 00:31:46 +0200 Received: from cichlids.cichlids.com (cichlids.cichlids.com [192.168.0.10]) by cichlids.com (Postfix) with ESMTP id EB293AC2C for ; Mon, 22 May 2000 00:31:55 +0200 (CEST) Received: (from alex@localhost) by cichlids.cichlids.com (8.9.3/8.9.3) id AAA06982; Mon, 22 May 2000 00:31:23 +0200 (CEST) (envelope-from alex) Message-Id: <200005212231.AAA06982@cichlids.cichlids.com> Date: Mon, 22 May 2000 00:31:23 +0200 (CEST) From: Alexander Langer Reply-To: alex@cichlids.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: ports/18723: add checksum.sh for the Tools dir Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 18723 >Category: ports >Synopsis: add checksum.sh for the Tools dir >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: Sun May 21 15:40:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Alexander Langer >Release: FreeBSD 5.0-CURRENT i386 >Organization: none >Environment: >Description: Hello. I've always wanted to write it, now I had time. Basic idea: bento only copies the files to the ftp.freebsd.org mastersite, if the checksum succeeds. That means, on ftp.freebsd.org there _should_ be always the distfile with the old checksum. Using that, next steps are easy: Fetch new and old distfiles and compare them with diff -rNu All checksum patches I sent over the last hour are verified with this script. I REALLY speeds up the work. >How-To-Repeat: >Fix: --- snip --- #!/bin/sh if [ -z $1 ]; then echo "Usage: $0 " exit 1 fi if [ -z $TMPDIR ]; then TMPDIR=/tmp fi if [ -z $PORTSDIR ]; then PORTSDIR=/usr/ports fi cd $PORTSDIR DIR=`grep $1 INDEX| cut -f2 -d\|` cd $DIR make fetch broken=`make checksum 2>&1 | grep "Checksum mismatch for" | awk '{print $5}' \ | sed -e 's:\.$::'` if [ -z $broken ]; then make checksum echo "Checksum ok, exiting..." exit 1 fi rm -rf $TMPDIR/checksum mkdir $TMPDIR/checksum cd $TMPDIR/checksum mkdir $TMPDIR/checksum/orig mkdir $TMPDIR/checksum/new echo Fetching $broken fetch ftp://ftp.FreeBSD.ORG/pub/FreeBSD/distfiles/$broken if [ ! -r $broken ]; then echo "File $broken not found, fetch error?" exit 1 fi if file $broken | grep "gzip compressed data" >/dev/null; then cd orig tar -zxf ../$broken cd ../new tar -zxf $PORTSDIR/distfiles/$broken cd .. elif file $broken | grep "zip archive file" >/dev/null ; then cd orig unzip ../$broken cd ../new unzip $PORTSDIR/distfiles/$broken cd .. else cp $broken orig/ cp $PORTSDIR/distfiles/$broken new/ fi echo Diff follows: diff -rNu orig new ---- snap ---- >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message