public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Roman Gaufman <hackeron@dsl.pipex.com>
To: gentoo-portage-dev@lists.gentoo.org
Subject: [gentoo-portage-dev] Downloading while compiling - FETCHCOMMAND inside.
Date: Mon, 29 Mar 2004 14:39:05 +0000	[thread overview]
Message-ID: <200403291439.05887.hackeron@dsl.pipex.com> (raw)
In-Reply-To: <200403280021.08657.hackeron@dsl.pipex.com>

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


  reply	other threads:[~2004-03-29 14:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-07 13:18 [gentoo-portage-dev] emerge feature request: Downloads managed by lock file system Thomas Horsten
2004-02-07 17:04 ` Simon Mika
2004-02-07 17:17   ` Sven Vermeulen
2004-02-07 22:07     ` Jeff Smelser
2004-02-08  0:59       ` Thomas Horsten
2004-03-28  0:21         ` Roman Gaufman
2004-03-29 14:39           ` Roman Gaufman [this message]
2004-03-29 18:10             ` [gentoo-portage-dev] Downloading while compiling - FETCHCOMMAND inside Wiebel
2004-03-29 19:35               ` Roman Gaufman
2004-03-30  0:37                 ` Wiebel
2004-04-04 11:38                   ` Brian Harring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200403291439.05887.hackeron@dsl.pipex.com \
    --to=hackeron@dsl.pipex.com \
    --cc=gentoo-portage-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox