properly clean up livecd-stage3
authorBrad House <brad_mssw@gentoo.org>
Sun, 18 Jan 2004 21:14:02 +0000 (21:14 +0000)
committerBrad House <brad_mssw@gentoo.org>
Sun, 18 Jan 2004 21:14:02 +0000 (21:14 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@179 d1e1f19c-881f-0410-ab34-b69fee027534

modules/targets.py

index 4adf5c11181168385b011db997f9ea761dbac8ab..964300fe4f33b323f82d8a3b35efee7675d3fecb 100644 (file)
@@ -514,8 +514,13 @@ class livecd_stage3_target(generic_stage_target):
 #                      raise
 
        def cdroot_setup(self):
-               if not os.path.exists(self.settings["cdroot_path"]):
-                       os.makedirs(self.settings["cdroot_path"])
+               if os.path.exists(self.settings["cdroot_path"]):
+                       print "cleaning previous livecd-stage3 build"
+                       cmd("rm -rf "+self.settings["cdroot_path"],"Could not remove existing directory: "+self.settings["cdroot_path"])
+
+               print "creating livecd-stage3 cdroot"
+               os.makedirs(self.settings["cdroot_path"])
+
                cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archscript"]+" LOOPTYPE="+self.settings["livecd/looptype"]+" /bin/bash "+self.settings["livecd/runscript"]+" setup_bootloader","setup_bootloader runscript failed.")
                cmd("env ARCH_RUNSCRIPT="+self.settings["livecd/archscript"]+" LOOPTYPE="+self.settings["livecd/looptype"]+" /bin/bash "+self.settings["livecd/runscript"]+" loop","loop runscript failed.")
                print "livecd-stage3: complete!"