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:35 +0000
commit7800f43d7e67380769f45b969f03127f889db1f8 (patch)
tree1647fc3f95a31dd1b0b0471c86840ac052c5baf1 /bitbake
parent30548aae0a68c828fa902f5c5c55c1a0ccf51905 (diff)
downloadpoky-7800f43d7e67380769f45b969f03127f889db1f8.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: f1e82236c2d30897bb863fb8948dd48614fc262a) 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: