diff options
author | Andre McCurdy <armccurdy@gmail.com> | 2018-06-05 12:13:50 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-06-15 17:57:30 +0100 |
commit | 783829427157b82dd021be345fe00afdf4d84a68 (patch) | |
tree | 46f95f4f37aabbcb5dc6101f222469cd25c914b6 /bitbake/lib/bb/fetch2/repo.py | |
parent | b054015357b2b03f308af00a41b29c649cbca171 (diff) | |
download | poky-783829427157b82dd021be345fe00afdf4d84a68.tar.gz |
bitbake: fetch2: unify the way fetchers determine DL_DIR and FETCHCMD
Currently there is quite some variation between the fetchers in terms
of how they determine the subdirectory within DL_DIR and the base
fetch command to run. Some rely on variables being set externally
(e.g. from bitbake.conf in oe-core), some respect these external
variables but provide fallback defaults and some use only hardcoded
internal values. Try to unify the approach used across the various
fetchers.
(Bitbake rev: efd5e35af4b08501c67e8b30f30d9457f6fdf610)
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/repo.py')
-rw-r--r-- | bitbake/lib/bb/fetch2/repo.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bitbake/lib/bb/fetch2/repo.py b/bitbake/lib/bb/fetch2/repo.py index c22d9b5578..8c7e81853a 100644 --- a/bitbake/lib/bb/fetch2/repo.py +++ b/bitbake/lib/bb/fetch2/repo.py | |||
@@ -45,6 +45,8 @@ class Repo(FetchMethod): | |||
45 | "master". | 45 | "master". |
46 | """ | 46 | """ |
47 | 47 | ||
48 | ud.basecmd = d.getVar("FETCHCMD_repo") or "/usr/bin/env repo" | ||
49 | |||
48 | ud.proto = ud.parm.get('protocol', 'git') | 50 | ud.proto = ud.parm.get('protocol', 'git') |
49 | ud.branch = ud.parm.get('branch', 'master') | 51 | ud.branch = ud.parm.get('branch', 'master') |
50 | ud.manifest = ud.parm.get('manifest', 'default.xml') | 52 | ud.manifest = ud.parm.get('manifest', 'default.xml') |
@@ -60,8 +62,8 @@ class Repo(FetchMethod): | |||
60 | logger.debug(1, "%s already exists (or was stashed). Skipping repo init / sync.", ud.localpath) | 62 | logger.debug(1, "%s already exists (or was stashed). Skipping repo init / sync.", ud.localpath) |
61 | return | 63 | return |
62 | 64 | ||
65 | repodir = d.getVar("REPODIR") or (d.getVar("DL_DIR") + "/repo") | ||
63 | gitsrcname = "%s%s" % (ud.host, ud.path.replace("/", ".")) | 66 | gitsrcname = "%s%s" % (ud.host, ud.path.replace("/", ".")) |
64 | repodir = d.getVar("REPODIR") or os.path.join(d.getVar("DL_DIR"), "repo") | ||
65 | codir = os.path.join(repodir, gitsrcname, ud.manifest) | 67 | codir = os.path.join(repodir, gitsrcname, ud.manifest) |
66 | 68 | ||
67 | if ud.user: | 69 | if ud.user: |
@@ -72,11 +74,11 @@ class Repo(FetchMethod): | |||
72 | repodir = os.path.join(codir, "repo") | 74 | repodir = os.path.join(codir, "repo") |
73 | bb.utils.mkdirhier(repodir) | 75 | bb.utils.mkdirhier(repodir) |
74 | if not os.path.exists(os.path.join(repodir, ".repo")): | 76 | if not os.path.exists(os.path.join(repodir, ".repo")): |
75 | bb.fetch2.check_network_access(d, "repo init -m %s -b %s -u %s://%s%s%s" % (ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), ud.url) | 77 | bb.fetch2.check_network_access(d, "%s init -m %s -b %s -u %s://%s%s%s" % (ud.basecmd, ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), ud.url) |
76 | runfetchcmd("repo init -m %s -b %s -u %s://%s%s%s" % (ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), d, workdir=repodir) | 78 | runfetchcmd("%s init -m %s -b %s -u %s://%s%s%s" % (ud.basecmd, ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), d, workdir=repodir) |
77 | 79 | ||
78 | bb.fetch2.check_network_access(d, "repo sync %s" % ud.url, ud.url) | 80 | bb.fetch2.check_network_access(d, "%s sync %s" % (ud.basecmd, ud.url), ud.url) |
79 | runfetchcmd("repo sync", d, workdir=repodir) | 81 | runfetchcmd("%s sync" % ud.basecmd, d, workdir=repodir) |
80 | 82 | ||
81 | scmdata = ud.parm.get("scmdata", "") | 83 | scmdata = ud.parm.get("scmdata", "") |
82 | if scmdata == "keep": | 84 | if scmdata == "keep": |