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 2007-09-19 02:53:00.000000000 +0200 |
4 |
@@ -370,11 +370,17 @@ |
5 |
self._start_cleanup() |
6 |
|
7 |
def _status_prepping(self): |
8 |
+ # Refresh mock status to see whether it changed during sleep. |
9 |
+ # Avoid mock/plague race condition. |
10 |
+ if not self._mock_is_prepping(): |
11 |
+ if not self._mock_using_repo(): # status changed during sleep |
12 |
+ self._status = 'building' |
13 |
+ return |
14 |
# Mock shouldn't exit at all during the prepping stage, if it does |
15 |
# something is wrong |
16 |
self._watch_mock('failed', 'failed') |
17 |
if self._status != 'prepping': |
18 |
- return |
19 |
+ return |
20 |
|
21 |
# We need to make sure that mock has dumped the status file withing a certain |
22 |
# amount of time, otherwise we can't tell what it's doing |
23 |
@@ -388,8 +394,6 @@ |
24 |
else: |
25 |
if not self._mock_config and self._mock_is_prepping(): |
26 |
self._mock_config = self._read_mock_config() |
27 |
- if not self._mock_using_repo(): |
28 |
- self._status = 'building' |
29 |
|
30 |
def _status_building(self): |
31 |
self._watch_mock('done', 'failed') |