Skip to contentSkip to conversation

Remove a possible trailing '/' in subpath

PATCH New Anders Darander 1 participant 1 message Apr 17, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove a possible trailing '/' in subpath

If the subpath parameter to the git fetcher ends with a trailing '/',
bb.utils.prunedir() will be called on '/'...

Fixes [YOCTO #7620].

---
 lib/bb/fetch2/git.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/fetch2/git.py +1 -1
index 44fc271..0fd9bee 100644
@@ -246,7 +246,7 @@ class Git(FetchMethod):
         subdir = ud.parm.get("subpath", "")
         if subdir != "":
             readpathspec = ":%s" % (subdir)
-            def_destsuffix = "%s/" % os.path.basename(subdir)
+            def_destsuffix = "%s/" % os.path.basename(subdir.rstrip('/'))
         else:
             readpathspec = ""
             def_destsuffix = "git/"
Signature · 1 line
2.1.4