From owner-freebsd-ports@FreeBSD.ORG Mon May 16 08:15:37 2011 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C8911065670 for ; Mon, 16 May 2011 08:15:37 +0000 (UTC) (envelope-from demelier.david@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 2C3A68FC0C for ; Mon, 16 May 2011 08:15:36 +0000 (UTC) Received: by wwc33 with SMTP id 33so4596659wwc.31 for ; Mon, 16 May 2011 01:15:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=09CgIzq/upxI3m2WhCk2Rb9OjuItf18DWEI+i6uu78Y=; b=MuUs9ZKID1IyYdu4n+ic0hUxF2g2BStqFx2jhQs0fsl6HLMPClEwKKmnSyWhJrjCUA tPXfTsm+3JeeMuUtk39bjhvj/xfjegr8dYtMD7gUWOFtqDNgAx/jsYFF6ONAa0UGJ0E8 wVP8ZmRlXSOmCspq+G2t09xPU+hLj3slt+UYY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=rfE/QLtSr3b7xNfn4RIzEk8vgS6Co3oASOMyh35Kp03apUVDoKM7xRh2honvdmt20Y Df0GMNMC+fIBG0dyKZ/03lRpU5UClI9fhHvPx7sG09E35/sAn7QJSDI7hmIKvPq01OOb 2JEMb+U8jjf//UhxlEhJY/f8r6hX0plUejmYY= Received: by 10.227.197.201 with SMTP id el9mr3999715wbb.22.1305533735781; Mon, 16 May 2011 01:15:35 -0700 (PDT) Received: from Melon.malikania.fr (wifi-osiris-sec-181-61.u-strasbg.fr [130.79.181.61]) by mx.google.com with ESMTPS id y29sm2071826wbd.21.2011.05.16.01.15.24 (version=SSLv3 cipher=OTHER); Mon, 16 May 2011 01:15:34 -0700 (PDT) Message-ID: <4DD0DCD3.4030906@gmail.com> Date: Mon, 16 May 2011 10:14:11 +0200 From: David Demelier User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110508 Thunderbird/3.1.10 MIME-Version: 1.0 To: freebsd-ports@freebsd.org References: <4DD0CC21.5050305@FreeBSD.org> In-Reply-To: <4DD0CC21.5050305@FreeBSD.org> Content-Type: text/plain; charset=x-viet-vps; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: patch for force fetch X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 08:15:37 -0000 On 16/05/2011 09:02, Andriy Gapon wrote: > > I've noticed the following problem. > If a distfile is updated by a distributor without renaming it (so that checksum > and possibly size change), then more often than not the port build system would > fail to fetch the distfile. > An example: > ... > => SHA256 Checksum mismatch for eclipse/javax.servlet.jsp_2.0.0.v200806031607.jar. > ... > => javax.servlet.jsp_2.0.0.v200806031607.jar doesn't seem to exist in > /usr/ports/distfiles/eclipse. > => Attempting to fetch > http://download.eclipse.org/tools/orbit/downloads/drops/R20100519200754/bundles/javax.servlet.jsp_2.0.0.v200806031607.jar > fetch: > http://download.eclipse.org/tools/orbit/downloads/drops/R20100519200754/bundles/javax.servlet.jsp_2.0.0.v200806031607.jar: > Requested Range Not Satisfiable > => Attempting to fetch > ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/eclipse/javax.servlet.jsp_2.0.0.v200806031607.jar > fetch: > ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/eclipse/javax.servlet.jsp_2.0.0.v200806031607.jar: > size mismatch: expected 63889, actual 62707 > => Couldn't fetch it - please try to retrieve this > => port manually into /usr/ports/distfiles/eclipse and try again. > *** Error code 1 > > I think that this happens because the old version of the distfile is still > present in download target location and fetch(1) thinks that it has a partially > downloaded file and tries to be smart. > > The following patch simply tries to remove the stale distfile before calling > fetch. Maybe there is a smarter way about this, like e.g. passing some option > to fetch. > > --- /usr/ports/Mk/bsd.port.mk.orig 2011-05-16 09:53:49.461968872 +0300 > +++ /usr/ports/Mk/bsd.port.mk 2011-05-16 09:56:47.995971662 +0300 > @@ -3562,6 +3562,9 @@ > ${ECHO_MSG} "=> ${DISTDIR} is not writable by you; cannot fetch."; \ > exit 1; \ > fi; \ > + if [ "$$force_fetch" = "true" ]; then \ > + rm -f $$file $$filebasename \ > + fi \ > if [ ! -z "$$select" ] ; then \ > __MASTER_SITES_TMP= ; \ > for group in $$select; do \ > make -DNO_CHECKSUM=yes ... is probably what you want, I guess. Cheers, -- David Demelier