]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
fetch/git: Remove a possible trailing '/' in subpath
authorAnders Darander <anders@chargestorm.se>
Fri, 17 Apr 2015 05:49:42 +0000 (07:49 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 17 Apr 2015 10:51:47 +0000 (11:51 +0100)
If the subpath parameter to the git fetcher ends with a trailing '/',
 bb.utils.prunedir() will be called on '/'...

Fixes [YOCTO #7620].

Signed-off-by: Anders Darander <anders@chargestorm.se>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/fetch2/git.py

index 44fc27193eb4dccb8b4f46b5366511e1db5cbd2d..0fd9beee1957ae6dce0164a789a28ca77e8077d5 100644 (file)
@@ -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/"