]> git.ipfire.org Git - pakfire.git/commitdiff
Fix some bugs that crashed installations on a native system.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Oct 2011 17:51:37 +0000 (17:51 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Oct 2011 19:43:59 +0000 (19:43 +0000)
python/pakfire/actions.py

index 3ee64c9be8aa76d8e75c9ee9d096c2feaf06d2ff..ba757891596e54cb5a9ff1e40afd5d9c69dd3e38 100644 (file)
@@ -86,7 +86,11 @@ class Action(object):
                # Find suitable cwd.
                cwd = "/"
                for i in ("tmp", "root"):
-                       _cwd = os.path.join(chroot_path, i)
+                       if chroot_path:
+                               _cwd = os.path.join(chroot_path, i)
+                       else:
+                               _cwd = i
+
                        if os.path.exists(_cwd):
                                cwd = _cwd
                                break
@@ -152,7 +156,7 @@ class ActionScript(Action):
                script_file_chroot = os.path.join("/", LOCAL_TMP_PATH,
                        "scriptlet_%s" % util.random_string(10))
                script_file = os.path.join(self.pakfire.path, script_file_chroot[1:])
-               assert script_file.startswith("%s/" % self.pakfire.path)
+               assert script_file.startswith(self.pakfire.path)
 
                # Create script directory, if it does not exist.
                script_dir = os.path.dirname(script_file)