From: Brian Dolbec Date: Fri, 25 Jan 2013 04:13:40 +0000 (-0800) Subject: Remove trailing slash for consistency in variables X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7ae6fc9f048e279a23c11ebb1210715c1aebbaec;p=catalyst.git Remove trailing slash for consistency in variables remove extra slashes in paths, fix hash header --- diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index c061d9f1..005687d6 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -419,7 +419,7 @@ class StageBase(TargetBase, ClearBase, GenBase): def set_dest_path(self): if "root_path" in self.settings: self.settings["destpath"]=normpath(self.settings["chroot_path"]+\ - self.settings["root_path"]) + "/" + self.settings["root_path"]) else: self.settings["destpath"]=normpath(self.settings["chroot_path"]) @@ -465,7 +465,7 @@ class StageBase(TargetBase, ClearBase, GenBase): Things *will* break without it! """ self.settings["chroot_path"]=normpath(self.settings["storedir"]+\ - "/tmp/"+self.settings["target_subpath"]+"/") + "/tmp/"+self.settings["target_subpath"]) self.chroot_lock=LockDir(self.settings["chroot_path"]) def set_autoresume_path(self): @@ -479,8 +479,8 @@ class StageBase(TargetBase, ClearBase, GenBase): os.makedirs(self.settings["autoresume_path"],0755) def set_controller_file(self): - self.settings["controller_file"]=normpath(self.settings["sharedir"]+\ - self.settings["sharedir"]+self.settings["target"]+"/"+self.settings["target"]+\ + self.settings["controller_file"]=normpath(self.settings["shdir"] + "/" + + self.settings["target"] + "/" + self.settings["target"] + "-controller.sh") def set_iso_volume_id(self): @@ -1212,7 +1212,7 @@ class StageBase(TargetBase, ClearBase, GenBase): operations, so we get easy glob handling. """ print "livecd: removing "+x - os.system("rm -rf "+self.settings["chroot_path"]+x) + os.system("rm -rf "+self.settings["chroot_path"] + "/" + x) try: if os.path.exists(self.settings["controller_file"]): cmd(self.settings["controller_file"]+\ @@ -1303,7 +1303,7 @@ class StageBase(TargetBase, ClearBase, GenBase): if type(self.settings[x])==types.StringType: """ Prefix to prevent namespace clashes """ #os.environ[varname]=self.settings[x] - self.env[varname]=self.settings[x] + self.env[varname]=self.settings[x].rstrip('/') elif type(self.settings[x])==types.ListType: #os.environ[varname]=string.join(self.settings[x]) self.env[varname]=string.join(self.settings[x]) diff --git a/catalyst/hash_utils.py b/catalyst/hash_utils.py index b03c6ed1..cd31ad3e 100644 --- a/catalyst/hash_utils.py +++ b/catalyst/hash_utils.py @@ -97,7 +97,7 @@ class HashMap(object): h_f = lines[1].split() hash_result = h_f[0] short_file = os.path.split(h_f[1])[1] - result = header + hash_result + " " + short_file + "\n" + result = header + "\n" + hash_result + " " + short_file + "\n" if verbose: print header+" (%s) = %s" % (short_file, result) return result