Remove trailing slash for consistency in variables
authorBrian Dolbec <dolsen@gentoo.org>
Fri, 25 Jan 2013 04:13:40 +0000 (20:13 -0800)
committerW. Trevor King <wking@tremily.us>
Sun, 15 Dec 2013 04:25:07 +0000 (20:25 -0800)
remove extra slashes in paths,
fix hash header

catalyst/base/stagebase.py
catalyst/hash_utils.py

index c061d9f103fc59bfe0cf8a5b0fc4cd5fc8f461aa..005687d65b6304b787e7dfd6a8612a14caa5d8a4 100644 (file)
@@ -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])
index b03c6ed1cd94a28f2a11c80d680ea9e818c36ea8..cd31ad3edbdd412c0da4d968596777a71fbd4beb 100644 (file)
@@ -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