Skip to contentSkip to conversation

fetch2: git: Append the password to the username on git URI reassembling

PATCH In review Joshua Watt 3 participants 6 messages Jan 14, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fetch2: git: Append the password to the username on git URI reassembling

From: Dominik Schmidt <[email protected]>

This allows the users to specify SRC_URIs of the form
git://user:[email protected]/path/to/repo.git

which allows pulling in private repositories.

[YOCTO #14065]

---
 bitbake/lib/bb/fetch2/git.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
bitbake/lib/bb/fetch2/git.py +4 -1
index df9538a60d..a1356ed9f0 100644
@@ -606,7 +606,10 @@ class Git(FetchMethod):
         # removing the password. ssh keys, ~/.netrc and ~/.ssh/config files can be used as
         # alternatives so we will not take patches adding password support here.
         if ud.user:
-            username = ud.user + '@'
+            username = ud.user
+            if ud.pswd:
+                username += ":" + ud.pswd
+            username += "@"
         else:
             username = ""
         return "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path)
Signature · 1 line
2.30.0
#1 lore raw

Argh, sorry. This is not what we want.... I was supposed to make a different change and forgot :(

Quoted 30 lines · Joshua Watt

From: Dominik Schmidt <[email protected]>

This allows the users to specify SRC_URIs of the form
git://user:[email protected]/path/to/repo.git

which allows pulling in private repositories.

[YOCTO #14065]

---
  bitbake/lib/bb/fetch2/git.py | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
bitbake/lib/bb/fetch2/git.py +4 -1
index df9538a60d..a1356ed9f0 100644
@@ -606,7 +606,10 @@ class Git(FetchMethod):
          # removing the password. ssh keys, ~/.netrc and ~/.ssh/config files can be used as
          # alternatives so we will not take patches adding password support here.
          if ud.user:
-            username = ud.user + '@'
+            username = ud.user
+            if ud.pswd:
+                username += ":" + ud.pswd
+            username += "@"
          else:
              username = ""
          return "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path)
#2 lore raw

Hi Joshua,

Quoted 13 lines · Joshua Watt

Argh, sorry. This is not what we want.... I was supposed to make a different change and forgot :(

Quoted 9 lines · Joshua Watt

From: Dominik Schmidt <[email protected]>

This allows the users to specify SRC_URIs of the form
git://user:[email protected]/path/to/repo.git

which allows pulling in private repositories.

[YOCTO #14065]

Don't forget Dominik's SoB too!

Quentin

Quoted 1 line
Quoted 1 line
#3 lore raw
Quoted 13 lines · Quentin Schulz

Hi Joshua,

Quoted 9 lines · Joshua Watt

Argh, sorry. This is not what we want.... I was supposed to make a different change and forgot :(

Quoted 5 lines · Joshua Watt

From: Dominik Schmidt <[email protected]>

This allows the users to specify SRC_URIs of the form
git://user:[email protected]/path/to/repo.git

Quoted 6 lines
Quoted 4 lines
Quoted 4 lines

which allows pulling in private repositories.

[YOCTO #14065]

Don't forget Dominik's SoB too!

Ya.... I noticed he didn't provide one on his patch after I sent it... anyway it doesn't matter because we aren't taking this patch and it should be ignored

Quoted 4 lines

Quentin

Quoted 1 line
Quoted 1 line
#4 lore raw
In reply to Joshua Watt
Quoted 7 lines · Joshua Watt

From: Dominik Schmidt <[email protected]>

This allows the users to specify SRC_URIs of the form
git://user:[email protected]/path/to/repo.git

which allows pulling in private repositories.

will this appear in package metadata in rpms/ipks etc ?

Quoted 28 lines

[YOCTO #14065]

---
  bitbake/lib/bb/fetch2/git.py | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
bitbake/lib/bb/fetch2/git.py +4 -1
index df9538a60d..a1356ed9f0 100644
@@ -606,7 +606,10 @@ class Git(FetchMethod):
          # removing the password. ssh keys, ~/.netrc and ~/.ssh/config files can be used as
          # alternatives so we will not take patches adding password support here.
          if ud.user:
-            username = ud.user + '@'
+            username = ud.user
+            if ud.pswd:
+                username += ":" + ud.pswd
+            username += "@"
          else:
              username = ""
          return "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path)
#5 lore raw
Quoted 5 lines · Khem Raj
Quoted 2 lines · Joshua Watt

From: Dominik Schmidt <[email protected]>

Quoted 7 lines
Quoted 5 lines

This allows the users to specify SRC_URIs of the form
git://user:[email protected]/path/to/repo.git

which allows pulling in private repositories.

will this appear in package metadata in rpms/ipks etc ?

Possibly. There are a lot of problems with it, so we aren't accepting this patch. I sent it in error :)

Quoted 29 lines
Quoted 29 lines

[YOCTO #14065]

---
  bitbake/lib/bb/fetch2/git.py | 5 ++++-

  1 file changed, 4 insertions(+), 1 deletion(-)
bitbake/lib/bb/fetch2/git.py +0 -0
index df9538a60d..a1356ed9f0 100644
@@ -606,7 +606,10 @@ class Git(FetchMethod):
           # removing the password. ssh keys, ~/.netrc and ~/.ssh/config files can be used as
           # alternatives so we will not take patches adding password support here.

          if ud.user:
-            username = ud.user + '@'
+            username = ud.user
+            if ud.pswd:
+                username += ":" + ud.pswd
+            username += "@"
          else:
              username = ""
          return "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path)