summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorVolker Vogelhuber <v.vogelhuber@digitalendoscopy.de>2013-11-01 17:53:09 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-01 17:59:31 +0000
commit1c7bbf8deceed6ffd572fb565de3dc1e3c3ef032 (patch)
tree3d2b3066983a8b072a3fb55562215f14025fd8f1 /bitbake
parentfe3e26509da8d25fc5878f0a5d6d7ebaec54dbbf (diff)
downloadpoky-1c7bbf8deceed6ffd572fb565de3dc1e3c3ef032.tar.gz
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 rev: dc3d6d73e44802c203b3f7247f6f212acc2f69bf) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch2/hg.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/hg.py b/bitbake/lib/bb/fetch2/hg.py
index b1c8675dd4..cf214816b7 100644
--- a/bitbake/lib/bb/fetch2/hg.py
+++ b/bitbake/lib/bb/fetch2/hg.py
@@ -92,7 +92,10 @@ class Hg(FetchMethod):
92 if not ud.user: 92 if not ud.user:
93 hgroot = host + ud.path 93 hgroot = host + ud.path
94 else: 94 else:
95 hgroot = ud.user + "@" + host + ud.path 95 if ud.pswd:
96 hgroot = ud.user + ":" + ud.pswd + "@" + host + ud.path
97 else:
98 hgroot = ud.user + "@" + host + ud.path
96 99
97 if command == "info": 100 if command == "info":
98 return "%s identify -i %s://%s/%s" % (basecmd, proto, hgroot, ud.module) 101 return "%s identify -i %s://%s/%s" % (basecmd, proto, hgroot, ud.module)
@@ -112,7 +115,10 @@ class Hg(FetchMethod):
112 # do not pass options list; limiting pull to rev causes the local 115 # do not pass options list; limiting pull to rev causes the local
113 # repo not to contain it and immediately following "update" command 116 # repo not to contain it and immediately following "update" command
114 # will crash 117 # will crash
115 cmd = "%s pull" % (basecmd) 118 if ud.user and ud.pswd:
119 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)
120 else:
121 cmd = "%s pull" % (basecmd)
116 elif command == "update": 122 elif command == "update":
117 cmd = "%s update -C %s" % (basecmd, " ".join(options)) 123 cmd = "%s update -C %s" % (basecmd, " ".join(options))
118 else: 124 else: