extras-buildsys/builder builder.py,1.29,1.30

Daniel Williams (dcbw) fedora-extras-commits at redhat.com
Mon Aug 8 02:54:12 UTC 2005


Author: dcbw

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

Modified Files:
	builder.py 
Log Message:
2005-08-07  Dan Williams <dcbw at redhat.com>

    Play nicely when running more than one builder instance on the same
    machine.

    * builder/builder.py
        - Try to delete actual mock work dir rather than just the buildroot

    * client/client.py
        - Prettier printing of job detail command output
        - Show builder port numbers

    * server/ArchJob.py
        - Save builder port number

    * server/BuildMaster.py
        - Add a builder port # to the archjobs table, and save builder port #
            when writing archjob status to the DB

    * server/Builder.py
        - (to_dict): return builder port # too

    * server/BuilderManager.py
        - Don't exit when adding new builders that have wrong connection
            protocol, just ignore them

    * server/UserInterface.py
        - Retrieve and return builder port numbers too

    * www/builders.psp
        - Differentiate builders and their jobs by port #
        - Only show building archjobs, not 'downloading' or 'downloaded' ones

    * www/job.psp
        - Show builder port numbers




Index: builder.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/builder/builder.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- builder.py	5 Aug 2005 19:24:49 -0000	1.29
+++ builder.py	8 Aug 2005 02:54:10 -0000	1.30
@@ -358,11 +358,17 @@
             if exit_status >= 0:
                 # We ignore mock errors when cleaning the buildroot
                 self._status = self._done_status
-                # FIXME: remove the last dir off the end of 'rootdir' here to get
-                # the real basedir and kill it.  At least what's here removes the
-                # buildroot which is where most of the space is used
-                if self._mock_config and self._mock_config.has_key('rootdir'):
-                    shutil.rmtree(self._mock_config['rootdir'], ignore_errors=True)
+                if self._mock_config and self._mock_config.has_key('rootdir') and self._mock_config.has_key('statedir'):
+                    # Kill the entire job dir, not just the rootdir
+                    job_dir = os.path.normpath(self._mock_config['rootdir'] + "/../")
+                    job_dir2 = os.path.normpath(self._mock_config['statedir'] + "/../")
+                    # Be a little paranoid about randomly removing an entire directory.
+                    # Compare the rootdir's parent to the statedir's parent and remove the
+                    # parent only if they match.
+                    if job_dir == job_dir2:
+                        shutil.rmtree(job_dir, ignore_errors=True)
+                    else:
+                        shutil.rmtree(self._mock_config['rootdir'], ignore_errors=True)
             else:
                 # mock still running
                 pass




More information about the scm-commits mailing list