From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8649 invoked from network); 29 Mar 2004 14:38:47 +0000 Received: from smtp.gentoo.org (128.193.0.39) by eagle.gentoo.oregonstate.edu with DES-CBC3-SHA encrypted SMTP; 29 Mar 2004 14:38:47 +0000 Received: from lists.gentoo.org ([128.193.0.34] helo=eagle.gentoo.org) by smtp.gentoo.org with esmtp (Exim 4.24) id 1B7xuY-00021Z-Cl for arch-gentoo-portage-dev@lists.gentoo.org; Mon, 29 Mar 2004 14:38:46 +0000 Received: (qmail 13588 invoked by uid 50004); 29 Mar 2004 14:38:45 +0000 Mailing-List: contact gentoo-portage-dev-help@gentoo.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail Reply-To: gentoo-portage-dev@lists.gentoo.org X-BeenThere: gentoo-portage-dev@gentoo.org Received: (qmail 16944 invoked from network); 29 Mar 2004 14:38:44 +0000 From: Roman Gaufman Reply-To: hackeron@dsl.pipex.com To: gentoo-portage-dev@lists.gentoo.org Date: Mon, 29 Mar 2004 14:39:05 +0000 User-Agent: KMail/1.6.1 References: <200402071318.47224.thomas@horsten.com> <200402080059.14318.thomas@horsten.com> <200403280021.08657.hackeron@dsl.pipex.com> In-Reply-To: <200403280021.08657.hackeron@dsl.pipex.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <200403291439.05887.hackeron@dsl.pipex.com> Subject: [gentoo-portage-dev] Downloading while compiling - FETCHCOMMAND inside. X-Archives-Salt: 86a96d40-f818-4616-a9a4-ee306b07775f X-Archives-Hash: a8f3dfd198260e79f2aa7299b638b0ab This fetchcommand will make sure portage doesn't download file simulatneously if you emerge -f package and emerge package in another terminal, it will make it wait for package to finish download. I improved it a little. Now if download fails (e.g. file not found), it wont freeze portage and will carry on, enjoy: FETCHCOMMAND="( while [ -e \${DISTDIR}/`basename \${URI}`.lock ]; do sleep 5; done && if [ ! -e \${DISTDIR}/`basename \${URI}` ]; then /usr/bin/wget -t 5 --passive-ftp \${URI} -O \${DISTDIR}/`basename \${URI}`.lock && mv \${DISTDIR}/`basename \${URI}`.lock \${DISTDIR}/`basename \${URI}` || rm \${DISTDIR}/`basename \${URI}`.lock; fi )" Please help test. And suggest a solution to remove lock file if user ctrl+c out of the wget. On Sunday 28 March 2004 00:21, Roman Gaufman wrote: > I'm no coder, but I wrote a little fetchcommand for this based on > suggestions by Sven: > > FETCHCOMMAND="( > while [ -e \${DISTDIR}/`basename \${URI}`.lock ]; do > sleep 5; done && > if [ ! -e \${DISTDIR}/`basename \${URI}` ]; then > wget -t 5 --passive-ftp \${URI} -O \${DISTDIR}/`basename \${URI}`.lock && > mv \${DISTDIR}/`basename \${URI}`.lock \${DISTDIR}/`basename \${URI}`; fi > )" > > suggestions, modifications are welcome. > > On Sunday 08 February 2004 00:59, Thomas Horsten wrote: > > On Saturday 07 February 2004 22:07, Jeff Smelser wrote: > > > On Saturday 07 February 2004 11:17 am, Sven Vermeulen wrote: > > > > A quick 'n dirty hack in the FETCHCOMMAND should suffice. Something > > > > along the lines of (pseudocode): > > > > > > > > FETCHCOMMAND="if exists \${DISTDIR}/`basename \${URL}.lck`; then > > > > skip; else \ touch \${DISTDIR}/`basename \${URL}.lck`; \ > > > > /usr/bin/wget ...; \ > > > > rm \${DISTDIR}/`basename \${URL}.lck`; fi" > > > > > > I tried this, and got: > > >[..] Errors > > > > Notice that Sven said it's pseudocode, just to describe the concept. It's > > incomplete, and has an invalid syntax. For example, "if exists ..." > > should be "if [ -e ...]" to be proper sh code. > > > > The real thing would be a bit more complex. > > > > // Thomas > > > > > > -- > > gentoo-portage-dev@gentoo.org mailing list > > -- > gentoo-portage-dev@gentoo.org mailing list -- gentoo-portage-dev@gentoo.org mailing list