rootfs: fix target name parsing
authorTimo Savola <tsavola@movial.fi>
Tue, 29 Jul 2008 12:14:06 +0000 (15:14 +0300)
committerTimo Savola <tsavola@movial.fi>
Tue, 29 Jul 2008 12:14:06 +0000 (15:14 +0300)
matrix/rootfs.py

index 5f8badd..ed2f328 100644 (file)
@@ -145,8 +145,11 @@ class Builder(object):
        chown_owner = {}
 
        def __init__(self, rootpath, targetname = None):
+               while rootpath.endswith(os.sep):
+                       rootpath = rootpath[:-1]
+
                self.path = rootpath
-               self.target = targetname or os.path.split(rootpath)[-1]
+               self.target = targetname or os.path.basename(rootpath)
 
        def include_paths(self, paths):
                old_dir = os.getcwd()