* HG Fetch with username and password in url
@ 2013-10-29 16:28 Volker Vogelhuber
0 siblings, 0 replies; 4+ messages in thread
From: Volker Vogelhuber @ 2013-10-29 16:28 UTC (permalink / raw)
To: bitbake-devel
[-- Attachment #1.1: Type: text/plain, Size: 1650 bytes --]
We currently use an company internal mercurial server with username and
password authentication
that will be accessed during the build of a firmware image from within a
custom recipe.
The only way to access it from within the yocto toolchain seems to have
the username and password
stored within the URL of the SRC_URI variable.
But the current hg.py fetcher does not completely support this. Attached
is a patch that fixes the missing parts.
--
*Volker Vogelhuber*| Softwareentwickler
*PENTAX**MEDICA**L
*/Excellence in Focus//^TM /
Tel: +49(0)821-650566-18
v.vogelhuber@DigitalEndoscopy.de <mailto:v.vogelhuber@DigitalEndoscopy.de>
Hoya Corporation - Pentax Medical Division
*Digital**Endoscopy GmbH*
Paul-Lenz-Str. 5
86316 Friedberg - Germany
pentaxmedical.com
Handelsregister HRB 27226
Amtsgericht Augsburg
Geschäftsführer: Michael Drexel, Marc Henzler
Sitz: Paul-Lenz-Str. 5, 86316 Friedberg, Germany
_____________________________________
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in
error) please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
[-- Attachment #1.2: Type: text/html, Size: 6137 bytes --]
[-- Attachment #2: hg_with_user_name_and_passwd.patch --]
[-- Type: text/x-patch, Size: 1358 bytes --]
diff --git a/bitbake/lib/bb/fetch2/hg.py b/bitbake/lib/bb/fetch2/hg.py
index b1c8675..cf21481 100644
--- a/bitbake/lib/bb/fetch2/hg.py
+++ b/bitbake/lib/bb/fetch2/hg.py
@@ -92,7 +92,10 @@ class Hg(FetchMethod):
if not ud.user:
hgroot = host + ud.path
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":
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
# repo not to contain it and immediately following "update" command
# 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":
cmd = "%s update -C %s" % (basecmd, " ".join(options))
else:
^ permalink raw reply related [flat|nested] 4+ messages in thread
* HG Fetch with username and password in url
@ 2013-10-29 16:31 Volker Vogelhuber
2013-11-01 17:56 ` Richard Purdie
0 siblings, 1 reply; 4+ messages in thread
From: Volker Vogelhuber @ 2013-10-29 16:31 UTC (permalink / raw)
To: bitbake-devel
[-- Attachment #1: Type: text/plain, Size: 515 bytes --]
We currently use an company internal mercurial server with username and
password authentication
that will be accessed during the build of a firmware image from within a
custom recipe.
The only way to access it from within the yocto toolchain seems to have
the username and password
stored within the URL of the SRC_URI variable.
But the current hg.py fetcher does not completely support this. Attached
is a patch that fixes the missing parts.
// This time in plain text, sorry for doing HTML mail
[-- Attachment #2: hg_with_user_name_and_passwd.patch --]
[-- Type: text/x-patch, Size: 1360 bytes --]
diff --git a/bitbake/lib/bb/fetch2/hg.py b/bitbake/lib/bb/fetch2/hg.py
index b1c8675..cf21481 100644
--- a/bitbake/lib/bb/fetch2/hg.py
+++ b/bitbake/lib/bb/fetch2/hg.py
@@ -92,7 +92,10 @@ class Hg(FetchMethod):
if not ud.user:
hgroot = host + ud.path
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":
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
# repo not to contain it and immediately following "update" command
# 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":
cmd = "%s update -C %s" % (basecmd, " ".join(options))
else:
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: HG Fetch with username and password in url
2013-10-29 16:31 Volker Vogelhuber
@ 2013-11-01 17:56 ` Richard Purdie
0 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2013-11-01 17:56 UTC (permalink / raw)
To: Volker Vogelhuber; +Cc: bitbake-devel
On Tue, 2013-10-29 at 17:31 +0100, Volker Vogelhuber wrote:
> We currently use an company internal mercurial server with username
> and
> password authentication
> that will be accessed during the build of a firmware image from within
> a
> custom recipe.
> The only way to access it from within the yocto toolchain seems to
> have
> the username and password
> stored within the URL of the SRC_URI variable.
>
> But the current hg.py fetcher does not completely support this.
> Attached
> is a patch that fixes the missing parts.
Thanks. In the future, a commit message and a Signed-off-by line would
help but I've merged this change.
Cheers,
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
* HG Fetch with username and password in url
@ 2014-04-29 15:34 Volker Vogelhuber
0 siblings, 0 replies; 4+ messages in thread
From: Volker Vogelhuber @ 2014-04-29 15:34 UTC (permalink / raw)
To: bitbake-devel
[-- Attachment #1: Type: text/plain, Size: 191 bytes --]
Following up a previous patch for mercurial fetcher, I just fixed a
problem when calling update on a repository with subrepositories enabled.
Attached a patch that fixes this problem
[-- Attachment #2: 0001-fixed-authentication-issues-in-case-of-using-sub-rep.patch --]
[-- Type: text/x-patch, Size: 1143 bytes --]
From caae519a2bd64bf7c729bb26aff344827def47fb Mon Sep 17 00:00:00 2001
From: Volker Vogelhuber <v.vogelhuber@digitalendoscopy.de>
Date: Tue, 29 Apr 2014 15:29:47 +0200
Subject: [PATCH] - fixed authentication issues in case of using sub
repositories
Signed-off-by: Volker Vogelhuber <v.vogelhuber@digitalendoscopy.de>
---
bitbake/lib/bb/fetch2/hg.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bitbake/lib/bb/fetch2/hg.py b/bitbake/lib/bb/fetch2/hg.py
index cf21481..2b56e86 100644
--- a/bitbake/lib/bb/fetch2/hg.py
+++ b/bitbake/lib/bb/fetch2/hg.py
@@ -120,7 +120,7 @@ class Hg(FetchMethod):
else:
cmd = "%s pull" % (basecmd)
elif command == "update":
- cmd = "%s update -C %s" % (basecmd, " ".join(options))
+ cmd = "%s update --config auth.default.prefix=* --config auth.default.username=%s --config auth.default.password=%s --config \"auth.default.schemes=%s\" -C %s" % (basecmd, ud.user, ud.pswd, proto, " ".join(options))
else:
raise FetchError("Invalid hg command %s" % command, ud.url)
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-04-29 15:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-29 16:28 HG Fetch with username and password in url Volker Vogelhuber
-- strict thread matches above, loose matches on Subject: below --
2013-10-29 16:31 Volker Vogelhuber
2013-11-01 17:56 ` Richard Purdie
2014-04-29 15:34 Volker Vogelhuber
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox