Browse Source

fetch2/git: fix subpath destination directory

Make the git fetcher's subpath (path within the git repo to fetch)
option set the destsuffix (destination directory) option by default.
This reverts the behaviour of subpath to the same as when it was
introduced.

Based on a patch by Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Paul Eggleton 12 years ago
parent
commit
3e7f8afeac
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/bb/fetch2/git.py

+ 3 - 1
lib/bb/fetch2/git.py

@@ -210,10 +210,12 @@ class Git(FetchMethod):
         subdir = ud.parm.get("subpath", "")
         if subdir != "":
             readpathspec = ":%s" % (subdir)
+            def_destsuffix = "%s/" % os.path.basename(subdir)
         else:
             readpathspec = ""
+            def_destsuffix = "git/"
 
-        destsuffix = ud.parm.get("destsuffix", "git/")
+        destsuffix = ud.parm.get("destsuffix", def_destsuffix)
         destdir = os.path.join(destdir, destsuffix)
         if os.path.exists(destdir):
             bb.utils.prunedir(destdir)