1 |
My understanding of a lockfile seems to be different from your's so i'd come up with something like: |
2 |
|
3 |
|
4 |
FETCHPROG=proz |
5 |
FETCHCOMMAND="( |
6 |
while [ -e \${DISTDIR}/`basename \${URI}`.lock ]; do |
7 |
sleep 5; done && |
8 |
if [ ! -e \${DISTDIR}/`basename \${URI}` ]; then |
9 |
touch \${DISTDIR}/`basename \${URI}`.lock; |
10 |
\$FETCHPROG \${URI}; |
11 |
rm \${DISTDIR}/`basename \${URI}`.lock; |
12 |
fi |
13 |
)" |
14 |
|
15 |
in this case error handling remains on the FETCHPROG side. |
16 |
|
17 |
|
18 |
|
19 |
On Mon, 29 Mar 2004 14:39:05 +0000 |
20 |
Roman Gaufman <hackeron@×××××××××.com> wrote: |
21 |
|
22 |
> This fetchcommand will make sure portage doesn't download file simulatneously |
23 |
> if you emerge -f package and emerge package in another terminal, it will make |
24 |
> it wait for package to finish download. |
25 |
> |
26 |
> I improved it a little. Now if download fails (e.g. file not found), it wont |
27 |
> freeze portage and will carry on, enjoy: |
28 |
> |
29 |
> FETCHCOMMAND="( |
30 |
> while [ -e \${DISTDIR}/`basename \${URI}`.lock ]; do |
31 |
> sleep 5; done && |
32 |
> if [ ! -e \${DISTDIR}/`basename \${URI}` ]; then |
33 |
> /usr/bin/wget -t 5 --passive-ftp \${URI} -O \${DISTDIR}/`basename |
34 |
> \${URI}`.lock && |
35 |
> mv \${DISTDIR}/`basename \${URI}`.lock \${DISTDIR}/`basename \${URI}` || |
36 |
> rm \${DISTDIR}/`basename \${URI}`.lock; fi |
37 |
> )" |
38 |
> |
39 |
> Please help test. And suggest a solution to remove lock file if user ctrl+c |
40 |
> out of the wget. |
41 |
> |
42 |
|
43 |
-- |
44 |
gentoo-portage-dev@g.o mailing list |