From owner-freebsd-ports Tue Sep 22 09:32:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA04528 for freebsd-ports-outgoing; Tue, 22 Sep 1998 09:32:07 -0700 (PDT) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from vader.cs.berkeley.edu (vader.CS.Berkeley.EDU [128.32.38.234]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA04017; Tue, 22 Sep 1998 09:29:11 -0700 (PDT) (envelope-from asami@vader.cs.berkeley.edu) Received: from silvia.hip.berkeley.edu (sji-ca3-55.ix.netcom.com [209.109.233.55]) by vader.cs.berkeley.edu (8.8.7/8.7.3) with ESMTP id JAA17109; Tue, 22 Sep 1998 09:27:45 -0700 (PDT) Received: (from asami@localhost) by silvia.hip.berkeley.edu (8.8.8/8.6.9) id JAA08248; Tue, 22 Sep 1998 09:27:37 -0700 (PDT) Date: Tue, 22 Sep 1998 09:27:37 -0700 (PDT) Message-Id: <199809221627.JAA08248@silvia.hip.berkeley.edu> To: ports@FreeBSD.ORG CC: se@FreeBSD.ORG Subject: fetch + size From: asami@cs.berkeley.edu (Satoshi Asami) Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, I got the following (slightly changed) from Stefan Esser (se). It adds support for file size checking (-S) option to fetch. I'm torn whether it should go in before the release, for two reasons: (1) The -S flag of "fetch" just went into -current, if it doesn't work as well as it's supposed to this might cause a great instability in ports (2) The patch adds a SIZE line to files/md5. That is quite displeasing aesthetically (there's a reason why the file was called "md5" in the first place...) What do people think? I'm leaning towards leaving this out for 3.0R, for reasons stated above. (We'll be dealing with a whole bunch of diffs to files/md5 if this goes in, so it's going to be a royal pain to change it later....) Satoshi ------- Index: bsd.port.mk =================================================================== RCS file: /home/ncvs/src/share/mk/bsd.port.mk,v retrieving revision 1.227.2.54 diff -u -r1.227.2.54 bsd.port.mk --- bsd.port.mk 1998/09/17 01:22:32 1.227.2.54 +++ bsd.port.mk 1998/09/21 10:23:46 @@ -573,4 +573,5 @@ .if exists(/usr/bin/fetch) FETCH_CMD?= /usr/bin/fetch +FETCH_BEFORE_ARGS+= $${CKSIZE:+-S $$CKSIZE} .else FETCH_CMD?= /usr/bin/ftp @@ -1152,6 +1158,8 @@ ${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \ for site in ${MASTER_SITES}; do \ ${ECHO_MSG} ">> Attempting to fetch from $${site}."; \ + DIR=${DIST_SUBDIR}; \ + CKSIZE=`${GREP} "^SIZE ($${DIR:+$$DIR/}$$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \ if ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} ${FETCH_AFTER_ARGS}; then \ continue 2; \ fi \ @@ -1174,6 +1182,8 @@ ${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \ for site in ${PATCH_SITES}; do \ ${ECHO_MSG} ">> Attempting to fetch from $${site}."; \ + DIR=${DIST_SUBDIR}; \ + CKSIZE=`${GREP} "^SIZE ($${DIR:+$$DIR/}$$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \ if ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} ${FETCH_AFTER_ARGS}; then \ continue 2; \ fi \ @@ -1614,6 +1624,8 @@ for file in ${DISTFILES}; do \ if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ for site in ${MASTER_SITES}; do \ + DIR=${DIST_SUBDIR}; \ + CKSIZE=`${GREP} "^SIZE ($${DIR:+$$DIR/}$$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \ ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '||' ; \ break; \ done; \ @@ -1625,6 +1637,8 @@ for file in ${PATCHFILES}; do \ if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ for site in ${PATCH_SITES}; do \ + DIR=${DIST_SUBDIR}; \ + CKSIZE=`${GREP} "^SIZE ($${DIR:+$$DIR/}$$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \ ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '||' ; \ break; \ done; \ @@ -1643,6 +1657,7 @@ @(cd ${DISTDIR}; \ for file in ${_CKSUMFILES}; do \ ${MD5} $$file >> ${MD5_FILE}; \ + echo "SIZE ($$file) = "`wc -c < $$file` >> ${MD5_FILE}; \ done) @for file in ${_IGNOREFILES}; do \ ${ECHO} "MD5 ($$file) = IGNORE" >> ${MD5_FILE}; \ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message