extras-buildsys/builder builder.py, 1.44.2.8.2.1.2.3, 1.44.2.8.2.1.2.4

Michael Schwendt (mschwendt) fedora-extras-commits at redhat.com
Thu Jan 31 17:32:28 UTC 2008


Author: mschwendt

Update of /cvs/fedora/extras-buildsys/builder
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20834/builder

Modified Files:
      Tag: Plague-0_4_5
	builder.py 
Log Message:
plague-0.4.4.1-racecondition-and-mock07.patch


Index: builder.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/builder/Attic/builder.py,v
retrieving revision 1.44.2.8.2.1.2.3
retrieving revision 1.44.2.8.2.1.2.4
diff -u -r1.44.2.8.2.1.2.3 -r1.44.2.8.2.1.2.4
--- builder.py	31 Jan 2008 14:19:43 -0000	1.44.2.8.2.1.2.3
+++ builder.py	31 Jan 2008 17:32:28 -0000	1.44.2.8.2.1.2.4
@@ -257,29 +257,10 @@
     def _mock_is_prepping(self):
         mock_status = self._get_mock_status()
         if mock_status:
-            if mock_status == 'prep':
-                return True
-            elif mock_status == 'setu':
-                return True
-        return False
-
-    def _mock_using_repo(self):
-        mock_status = self._get_mock_status()
-        if mock_status:
-            if mock_status == 'init':
-                return True
-            elif mock_status == 'clea':
-                return True
-            elif mock_status == 'prep':
-                return True
-            elif mock_status == 'setu':
-                return True
-        return False
-
-    def _mock_is_closed(self):
-        mock_status = self._get_mock_status()
-        if mock_status and mock_status == "done":
-            return True
+            prepstates = ['init','prep','unpa','crea','setu']
+            for s in prepstates:
+                if mock_status == s:
+                    return True
         return False
 
     def _get_mock_status(self):
@@ -370,18 +351,6 @@
             self._start_cleanup()
 
     def _status_prepping(self):
-        # Refresh mock status to see whether it changed during sleep.
-        # Avoid mock/plague race condition.
-        if not self._mock_is_prepping():
-            if not self._mock_using_repo():  # status changed during sleep
-                self._status = 'building'
-            return
-        # Mock shouldn't exit at all during the prepping stage, if it does
-        # something is wrong
-        self._watch_mock('failed', 'failed')
-        if self._status != 'prepping':
-            return
-
         # We need to make sure that mock has dumped the status file withing a certain
         # amount of time, otherwise we can't tell what it's doing
         mockstatusfile = os.path.join(self._state_dir, 'status')
@@ -394,6 +363,10 @@
         else:
             if not self._mock_config and self._mock_is_prepping():
                 self._mock_config = self._read_mock_config()
+            if not self._mock_is_prepping():
+                self._status = 'building'
+                return
+            self._watch_mock('done', 'failed')
 
     def _status_building(self):
         self._watch_mock('done', 'failed')




More information about the fedora-extras-commits mailing list