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-12-03 17:51:31 +0000
commitc5989a9e51b62b848449025d90a0bc8263b826e9 (patch)
tree17421b77a521c96ec7be8cf7bde7d3bfeac43192 /bitbake
parent1c8c9f1e532ad29731feb4e63a3f74934105e69c (diff)
downloadpoky-c5989a9e51b62b848449025d90a0bc8263b826e9.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 master rev: dc3d6d73e44802c203b3f7247f6f212acc2f69bf) (Bitbake rev: 76b50d0d72c4e2b03fc53fade255e87c1922e88d) 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: