From 1476350ca4fe1b9d6bb31e7b4dc979bd6ce15160 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Thu, 24 Jan 2013 20:13:40 -0800 Subject: [PATCH] Remove trailing slash for consistency in variables remove extra slashes in paths, fix hash header --- catalyst/base/stagebase.py | 12 ++++++------ catalyst/hash_utils.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 405f47ab..71e166a5 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): @@ -1208,7 +1208,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"]+\ @@ -1299,7 +1299,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 -- 2.26.2