bitbake: fetch/hg: Improve user/password handling
Trying to use a server with username and password authentication within the URL of the SRC_URI variable doesn't appear to work. This patch adds the missing parts to the hg fetcher to make this work properly. (Bitbake master rev: dc3d6d73e44802c203b3f7247f6f212acc2f69bf) (Bitbake rev: 76b50d0d72c4e2b03fc53fade255e87c1922e88d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
1c8c9f1e53
commit
c5989a9e51
|
@ -92,7 +92,10 @@ class Hg(FetchMethod):
|
||||||
if not ud.user:
|
if not ud.user:
|
||||||
hgroot = host + ud.path
|
hgroot = host + ud.path
|
||||||
else:
|
else:
|
||||||
hgroot = ud.user + "@" + host + ud.path
|
if ud.pswd:
|
||||||
|
hgroot = ud.user + ":" + ud.pswd + "@" + host + ud.path
|
||||||
|
else:
|
||||||
|
hgroot = ud.user + "@" + host + ud.path
|
||||||
|
|
||||||
if command == "info":
|
if command == "info":
|
||||||
return "%s identify -i %s://%s/%s" % (basecmd, proto, hgroot, ud.module)
|
return "%s identify -i %s://%s/%s" % (basecmd, proto, hgroot, ud.module)
|
||||||
|
@ -112,7 +115,10 @@ class Hg(FetchMethod):
|
||||||
# do not pass options list; limiting pull to rev causes the local
|
# do not pass options list; limiting pull to rev causes the local
|
||||||
# repo not to contain it and immediately following "update" command
|
# repo not to contain it and immediately following "update" command
|
||||||
# will crash
|
# will crash
|
||||||
cmd = "%s pull" % (basecmd)
|
if ud.user and ud.pswd:
|
||||||
|
cmd = "%s --config auth.default.prefix=* --config auth.default.username=%s --config auth.default.password=%s --config \"auth.default.schemes=%s\" pull" % (basecmd, ud.user, ud.pswd, proto)
|
||||||
|
else:
|
||||||
|
cmd = "%s pull" % (basecmd)
|
||||||
elif command == "update":
|
elif command == "update":
|
||||||
cmd = "%s update -C %s" % (basecmd, " ".join(options))
|
cmd = "%s update -C %s" % (basecmd, " ".join(options))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue