Remove trailing slash for consistency in variables
authorBrian Dolbec <dolsen@gentoo.org>
Fri, 25 Jan 2013 04:13:40 +0000 (20:13 -0800)
committerBrian Dolbec <dolsen@gentoo.org>
Mon, 4 Mar 2013 04:44:21 +0000 (20:44 -0800)
remove extra slashes in paths,
fix hash header

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

index 405f47aba2380f5bc84b7dc36e119cd568ce59f5..71e166a588cfe377defdf889d22e15fe17bb5a29 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):
@@ -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])
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