1 |
Author: zmedico |
2 |
Date: 2008-03-28 12:03:21 +0000 (Fri, 28 Mar 2008) |
3 |
New Revision: 9554 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.2/cnf/make.globals |
7 |
main/branches/2.1.2/man/make.conf.5 |
8 |
main/branches/2.1.2/pym/portage.py |
9 |
Log: |
10 |
Bug #42456 - When a checksum failure occurs during fetch, use a new |
11 |
PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS config variable to control how |
12 |
many mirrors should be tried before aborting the download. This type |
13 |
of behavior used to be enabled only in --fetchonly mode but now |
14 |
it's enabled for all fetch() calls. (trunk r9462:9466) |
15 |
|
16 |
|
17 |
Modified: main/branches/2.1.2/cnf/make.globals |
18 |
=================================================================== |
19 |
--- main/branches/2.1.2/cnf/make.globals 2008-03-28 11:59:23 UTC (rev 9553) |
20 |
+++ main/branches/2.1.2/cnf/make.globals 2008-03-28 12:03:21 UTC (rev 9554) |
21 |
@@ -48,6 +48,9 @@ |
22 |
# This option will be removed and forced to yes. |
23 |
AUTOCLEAN="yes" |
24 |
|
25 |
+# Number of mirrors to try when a downloaded file has an incorrect checksum. |
26 |
+PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS="5" |
27 |
+ |
28 |
# Number of times 'emerge --sync' will run before giving up. |
29 |
PORTAGE_RSYNC_RETRIES="3" |
30 |
|
31 |
|
32 |
Modified: main/branches/2.1.2/man/make.conf.5 |
33 |
=================================================================== |
34 |
--- main/branches/2.1.2/man/make.conf.5 2008-03-28 11:59:23 UTC (rev 9553) |
35 |
+++ main/branches/2.1.2/man/make.conf.5 2008-03-28 12:03:21 UTC (rev 9554) |
36 |
@@ -386,6 +386,9 @@ |
37 |
.B PORTAGE_ELOG_MAILSUBJECT |
38 |
Please see /etc/make.conf.example for elog documentation. |
39 |
.TP |
40 |
+\fBPORTAGE_FETCH_CHECKSUM_TRY_MIRRORS\fR = \fI5\fR |
41 |
+Number of mirrors to try when a downloaded file has an incorrect checksum. |
42 |
+.TP |
43 |
\fBPORTAGE_NICENESS\fR = \fI[number]\fR |
44 |
The value of this variable will be added to the current nice level that |
45 |
emerge is running at. In other words, this will not set the nice level, |
46 |
|
47 |
Modified: main/branches/2.1.2/pym/portage.py |
48 |
=================================================================== |
49 |
--- main/branches/2.1.2/pym/portage.py 2008-03-28 11:59:23 UTC (rev 9553) |
50 |
+++ main/branches/2.1.2/pym/portage.py 2008-03-28 12:03:21 UTC (rev 9554) |
51 |
@@ -1071,7 +1071,8 @@ |
52 |
"PORTAGE_BINHOST_CHUNKSIZE", "PORTAGE_CALLER", |
53 |
"PORTAGE_ECLASS_WARNING_ENABLE", "PORTAGE_ELOG_CLASSES", |
54 |
"PORTAGE_ELOG_MAILFROM", "PORTAGE_ELOG_MAILSUBJECT", |
55 |
- "PORTAGE_ELOG_MAILURI", "PORTAGE_ELOG_SYSTEM", "PORTAGE_GPG_DIR", |
56 |
+ "PORTAGE_ELOG_MAILURI", "PORTAGE_ELOG_SYSTEM", |
57 |
+ "PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS", "PORTAGE_GPG_DIR", |
58 |
"PORTAGE_GPG_KEY", "PORTAGE_PACKAGE_EMPTY_ABORT", |
59 |
"PORTAGE_RSYNC_EXTRA_OPTS", "PORTAGE_RSYNC_OPTS", |
60 |
"PORTAGE_RSYNC_RETRIES", "PORTAGE_USE", "PORT_LOGDIR", |
61 |
@@ -3002,6 +3003,28 @@ |
62 |
# every single available mirror is a waste of bandwidth |
63 |
# and time, so there needs to be a cap. |
64 |
checksum_failure_max_tries = 5 |
65 |
+ v = checksum_failure_max_tries |
66 |
+ try: |
67 |
+ v = int(mysettings.get("PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS", |
68 |
+ checksum_failure_max_tries)) |
69 |
+ except (ValueError, OverflowError): |
70 |
+ writemsg("!!! Variable PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS" + \ |
71 |
+ " contains non-integer value: '%s'\n" % \ |
72 |
+ mysettings["PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS"], noiselevel=-1) |
73 |
+ writemsg("!!! Using PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS " + \ |
74 |
+ "default value: %s\n" % checksum_failure_max_tries, |
75 |
+ noiselevel=-1) |
76 |
+ v = checksum_failure_max_tries |
77 |
+ if v < 1: |
78 |
+ writemsg("!!! Variable PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS" + \ |
79 |
+ " contains value less than 1: '%s'\n" % v, noiselevel=-1) |
80 |
+ writemsg("!!! Using PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS " + \ |
81 |
+ "default value: %s\n" % checksum_failure_max_tries, |
82 |
+ noiselevel=-1) |
83 |
+ v = checksum_failure_max_tries |
84 |
+ checksum_failure_max_tries = v |
85 |
+ del v |
86 |
+ |
87 |
# Behave like the package has RESTRICT="primaryuri" after a |
88 |
# couple of checksum failures, to increase the probablility |
89 |
# of success before checksum_failure_max_tries is reached. |
90 |
@@ -3464,10 +3487,7 @@ |
91 |
pass |
92 |
fetched = 1 |
93 |
continue |
94 |
- if not fetchonly: |
95 |
- fetched=2 |
96 |
- break |
97 |
- else: |
98 |
+ if True: |
99 |
# File is the correct size--check the checksums for the fetched |
100 |
# file NOW, for those users who don't have a stable/continuous |
101 |
# net connection. This way we have a chance to try to download |
102 |
|
103 |
-- |
104 |
gentoo-commits@l.g.o mailing list |