Gentoo Archives: gentoo-portage-dev

From: Roman Gaufman <hackeron@×××××××××.com>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] Downloading while compiling - FETCHCOMMAND inside.
Date: Mon, 29 Mar 2004 19:35:09
Message-Id: 200403291935.31558.hackeron@dsl.pipex.com
In Reply to: Re: [gentoo-portage-dev] Downloading while compiling - FETCHCOMMAND inside. by Wiebel2001@t-online.de (Wiebel)
1 Well, that also works I suppose, I just don't like prozilla. In anycase with
2 your solution if for the first URL you get file not found, or any other fetch
3 error, you will need to remove lock file manually, you don't have that
4 problem with my solution.
5
6 On Monday 29 March 2004 18:10, Wiebel wrote:
7 > My understanding of a lockfile seems to be different from your's so i'd
8 > come up with something like:
9 >
10 >
11 > FETCHPROG=proz
12 > FETCHCOMMAND="(
13 > while [ -e \${DISTDIR}/`basename \${URI}`.lock ]; do
14 > sleep 5; done &&
15 > if [ ! -e \${DISTDIR}/`basename \${URI}` ]; then
16 > touch \${DISTDIR}/`basename \${URI}`.lock;
17 > \$FETCHPROG \${URI};
18 > rm \${DISTDIR}/`basename \${URI}`.lock;
19 > fi
20 > )"
21 >
22 > in this case error handling remains on the FETCHPROG side.
23 >
24 >
25 >
26 > On Mon, 29 Mar 2004 14:39:05 +0000
27 >
28 > Roman Gaufman <hackeron@×××××××××.com> wrote:
29 > > This fetchcommand will make sure portage doesn't download file
30 > > simulatneously if you emerge -f package and emerge package in another
31 > > terminal, it will make it wait for package to finish download.
32 > >
33 > > I improved it a little. Now if download fails (e.g. file not found), it
34 > > wont freeze portage and will carry on, enjoy:
35 > >
36 > > FETCHCOMMAND="(
37 > > while [ -e \${DISTDIR}/`basename \${URI}`.lock ]; do
38 > > sleep 5; done &&
39 > > if [ ! -e \${DISTDIR}/`basename \${URI}` ]; then
40 > > /usr/bin/wget -t 5 --passive-ftp \${URI} -O \${DISTDIR}/`basename
41 > > \${URI}`.lock &&
42 > > mv \${DISTDIR}/`basename \${URI}`.lock \${DISTDIR}/`basename \${URI}` ||
43 > > rm \${DISTDIR}/`basename \${URI}`.lock; fi
44 > > )"
45 > >
46 > > Please help test. And suggest a solution to remove lock file if user
47 > > ctrl+c out of the wget.
48 >
49 > --
50 > gentoo-portage-dev@g.o mailing list
51
52 --
53 gentoo-portage-dev@g.o mailing list

Replies