prune some dead code
authorAndrew Gaffney <agaffney@gentoo.org>
Mon, 14 Sep 2009 00:33:49 +0000 (19:33 -0500)
committerAndrew Gaffney <agaffney@gentoo.org>
Mon, 14 Sep 2009 00:33:49 +0000 (19:33 -0500)
modules/catalyst/target/generic_stage.py
modules/catalyst/target/livecd_stage2.py

index d5a1f37f7fe38d5e6ef66538f79f56817b2ada66..d9f6cd34a97785d65ce6615067064748060d6031 100644 (file)
@@ -310,12 +310,10 @@ class generic_stage_target(generic_target):
                        self.settings["source_path"]=catalyst.util.normpath(self.settings["storedir"]+\
                                "/builds/"+self.settings["source_subpath"]+".tar.bz2")
                        if os.path.isfile(self.settings["source_path"]):
-                               # XXX: Is this even necessary if the previous check passes?
-                               if os.path.exists(self.settings["source_path"]):
-                                       self.settings["source_path_hash"]=\
-                                               catalyst.hash.generate_hash(self.settings["source_path"],\
-                                               hash_function=self.settings["hash_function"],\
-                                               verbose=False)
+                               self.settings["source_path_hash"]=\
+                                       catalyst.hash.generate_hash(self.settings["source_path"],\
+                                       hash_function=self.settings["hash_function"],\
+                                       verbose=False)
                msg("Source path set to " + self.settings["source_path"])
                if os.path.isdir(self.settings["source_path"]):
                        msg("\tIf this is not desired, remove this directory or turn off")
index 2530d3a1aef08deddcd72386b942b56deaf09894..00bf939313a0065e9572a361638733301b685930 100644 (file)
@@ -116,9 +116,7 @@ class livecd_stage2_target(generic_stage_target):
                        cmd(unpack_cmd,error_msg,env=self.env)
 
                        if "source_path_hash" in self.settings:
-                               myf=open(self.settings["autoresume_path"]+"unpack","w")
-                               myf.write(self.settings["source_path_hash"])
-                               myf.close()
+                               self.set_autoresume("unpack", self.settings["source_path_hash"])
                        else:
                                self.set_autoresume("unpack")