/[smecontribs]/rpms/plague/contribs7/plague-0.4.4.1-filedownloader.patch
ViewVC logotype

Contents of /rpms/plague/contribs7/plague-0.4.4.1-filedownloader.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Mon Sep 8 14:04:49 2008 UTC (15 years, 8 months ago) by slords
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Import of plague-0.4.5.4-1.el4.sme.1.src.rpm

1 diff -Nur plague-0.4.4.1-orig/builder/builder.py plague-0.4.4.1/builder/builder.py
2 --- plague-0.4.4.1-orig/builder/builder.py 2006-03-13 16:09:23.000000000 +0100
3 +++ plague-0.4.4.1/builder/builder.py 2008-01-04 15:09:21.000000000 +0100
4 @@ -169,7 +169,7 @@
5 sys.stdout.write(s + string)
6 sys.stdout.flush()
7
8 - def dl_callback(self, dl_status, cb_data):
9 + def dl_callback(self, dl_status, cb_data, err_msg):
10 url = cb_data
11 if dl_status == 'done':
12 self._status = 'downloaded'
13 @@ -187,7 +187,7 @@
14 else:
15 # retry the download
16 self._status = 'init'
17 - self._log("ERROR: Failed to retrieve %s on attempt %d. Trying again...\n" % (url, self._srpm_tries))
18 + self._log("ERROR: Failed to retrieve %s on attempt %d (%s). Trying again...\n" % (url, self._srpm_tries, err_msg))
19
20 def _copy_mock_output_to_log(self):
21 if self._mock_log and os.path.exists(self._mock_log):
22 diff -Nur plague-0.4.4.1-orig/common/FileDownloader.py plague-0.4.4.1/common/FileDownloader.py
23 --- plague-0.4.4.1-orig/common/FileDownloader.py 2005-11-18 16:12:03.000000000 +0100
24 +++ plague-0.4.4.1/common/FileDownloader.py 2008-01-04 15:06:19.000000000 +0100
25 @@ -94,6 +94,7 @@
26
27 def run(self):
28 result = None
29 + err_msg = None
30 if self._url and self._target_dir and self._filename:
31 if not os.path.exists(self._target_dir):
32 os.makedirs(self._target_dir)
33 @@ -105,16 +106,21 @@
34 # if CommonErrors.canIgnoreSSLError(e):
35 # pass
36 except socket.error, e:
37 - if CommonErrors.canIgnoreSocketError(e):
38 - pass
39 + if not CommonErrors.canIgnoreSocketError(e):
40 + err_msg = "Socket Error: %s" % e
41 except IOError, e:
42 - if CommonErrors.canIgnoreSocketError(e):
43 - pass
44 + if not CommonErrors.canIgnoreSocketError(e):
45 + err_msg = "IOError Error: %s" % e
46
47 + if result: # extra check to examine mysterious add_to_repo errors
48 + if not os.path.exists(target_file) or not os.access(target_file, os.
49 +R_OK):
50 + err_msg = "Downloaded file is inaccessible!"
51 + result = False
52 if result:
53 - self._callback('done', self._cb_data)
54 + self._callback('done', self._cb_data, err_msg)
55 else:
56 - self._callback('failed', self._cb_data)
57 + self._callback('failed', self._cb_data, err_msg)
58
59
60
61 diff -Nur plague-0.4.4.1-orig/server/ArchJob.py plague-0.4.4.1/server/ArchJob.py
62 --- plague-0.4.4.1-orig/server/ArchJob.py 2006-02-23 20:10:30.000000000 +0100
63 +++ plague-0.4.4.1/server/ArchJob.py 2008-01-04 15:08:14.000000000 +0100
64 @@ -196,7 +196,7 @@
65 dl_dict[DL_WAIT_TIME] = 0
66 self._downloads[uf] = dl_dict
67
68 - def dl_callback(self, status, cb_data):
69 + def dl_callback(self, status, cb_data, err_msg):
70 url = cb_data
71 self._download_lock.acquire()
72 dl_dict = self._downloads[url]
73 @@ -207,8 +207,8 @@
74 if dl_dict[DL_RETRIES] >= 10:
75 dl_dict[DL_STATUS] = STATUS_ERROR
76 else:
77 - print "%s (%s/%s): Failed to retrieve %s (attempt %d), trying again..." % (self.par_job.uid,
78 - self.par_job.package, self._target_dict['arch'], url, dl_dict[DL_RETRIES])
79 + print "%s (%s/%s): Failed to retrieve %s (attempt %d) (Error %s), trying again..." % (self.par_job.uid,
80 + self.par_job.package, self._target_dict['arch'], url, dl_dict[DL_RETRIES], err_msg)
81 dl_dict[DL_STATUS] = STATUS_WAITING
82 dl_dict[DL_WAIT_TIME] = 5 # Wait a bit before trying again
83 dl_dict[DL_RETRIES] = dl_dict[DL_RETRIES] + 1

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed