Skip to contentSkip to conversation

fetch2: make sure the uri added as expected

PATCH Superseded Yu, Mingli 2 participants 8 messages May 14, 2021 – May 19, 2021 1 message not in the archive

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Yu, Mingli

author
#0 lore raw

PATCH 1/1 fetch2: make sure the uri added as expected

From: Mingli Yu <[email protected]>

Make sure the uri added as expected in some scenarioes such as with below setting:

PREMIRRORS_append = ".*://.*/.* git:///net/SharedImage/downloads/git2/MIRRORNAME;protocol=file"

---
 lib/bb/fetch2/__init__.py | 2 ++
 1 file changed, 2 insertions(+)
lib/bb/fetch2/__init__.py +2 -0
index cf0201c4..6701654b 100644
@@ -430,6 +430,8 @@ def uri_replace(ud, uri_find, uri_replace, replacements, d, mirrortarball=None):
     uri_replace_decoded = list(decodeurl(uri_replace))
     logger.debug2("For url %s comparing %s to %s" % (uri_decoded, uri_find_decoded, uri_replace_decoded))
     result_decoded = ['', '', '', '', '', {}]
+    if uri_find_decoded[0] == '.*' and uri_replace_decoded[0] != 'file':
+        uri_find_decoded[0] = uri_replace_decoded[0]
     for loc, i in enumerate(uri_find_decoded):
         result_decoded[loc] = uri_decoded[loc]
         regexp = i
Signature · 1 line
2.17.1
#1 lore raw
Quoted 22 lines · Mingli

From: Mingli Yu <[email protected]>

Make sure the uri added as expected in some scenarioes such as with below setting:

PREMIRRORS_append = ".*://.*/.* git:///net/SharedImage/downloads/git2/MIRRORNAME;protocol=file"

---
 lib/bb/fetch2/__init__.py | 2 ++

 1 file changed, 2 insertions(+)
lib/bb/fetch2/__init__.py +0 -0
index cf0201c4..6701654b 100644
@@ -430,6 +430,8 @@ def uri_replace(ud, uri_find, uri_replace, replacements, d, mirrortarball=None):
      uri_replace_decoded = list(decodeurl(uri_replace))
      logger.debug2("For url %s comparing %s to %s" % (uri_decoded, uri_find_decoded, uri_replace_decoded))

     result_decoded = ['', '', '', '', '', {}]

lib/bb/fetch2/__init__.py +2 -0
+    if uri_find_decoded[0] == '.*' and uri_replace_decoded[0] != 'file':
+        uri_find_decoded[0] = uri_replace_decoded[0]
Quoted 3 lines

     for loc, i in enumerate(uri_find_decoded):
         result_decoded[loc] = uri_decoded[loc]
         regexp = i

I've not thought too much about the fix itself but for these kinds of changes we do ask that the tests be updated too in lib/bb/tests/ (run with bitbake-selftest).

Cheers,

Richard

author
#2 lore raw
Quoted 15 lines · Richard Purdie

[Please note: This e-mail is from an EXTERNAL e-mail address]

Quoted 12 lines · Mingli

From: Mingli Yu <[email protected]>

Make sure the uri added as expected in some scenarioes such as with below setting:

PREMIRRORS_append = ".*://.*/.* git:///net/SharedImage/downloads/git2/MIRRORNAME;protocol=file"

---
  lib/bb/fetch2/__init__.py | 2 ++
  1 file changed, 2 insertions(+)
Quoted 16 lines

lib/bb/fetch2/__init__.py def uri_replace(ud, uri_find, uri_replace, replacements, d, mirrortarball=None): · line 437

Quoted 13 lines
lib/bb/fetch2/__init__.py +2 -0
index cf0201c4..6701654b 100644
@@ -430,6 +430,8 @@ def uri_replace(ud, uri_find, uri_replace, replacements, d, mirrortarball=None):
      uri_replace_decoded = list(decodeurl(uri_replace))
      logger.debug2("For url %s comparing %s to %s" % (uri_decoded, uri_find_decoded, uri_replace_decoded))
      result_decoded = ['', '', '', '', '', {}]
+    if uri_find_decoded[0] == '.*' and uri_replace_decoded[0] != 'file':
+        uri_find_decoded[0] = uri_replace_decoded[0]
      for loc, i in enumerate(uri_find_decoded):
          result_decoded[loc] = uri_decoded[loc]
          regexp = i

I've not thought too much about the fix itself but for these kinds of changes we do ask that the tests be updated too in lib/bb/tests/ (run with bitbake-selftest).

Hi RP,

I think the current testcase(lib/bb/tests/fetch.py) is enough if this patch doesn't introduce regression issue(run with bitbake-selftest).

BTW, the patch solves the problem which I stated in the comments.

Thanks,

Quoted 9 lines

Cheers,

Richard

author
#5 lore raw
In reply to a message not in the archive

Ping.

Thanks,

Quoted 58 lines · Mingli
Quoted 25 lines · Richard Purdie

[Please note: This e-mail is from an EXTERNAL e-mail address]

Quoted 22 lines · Mingli

From: Mingli Yu <[email protected]>

Make sure the uri added as expected in some scenarioes such as with below setting:

PREMIRRORS_append = ".*://.*/.* git:///net/SharedImage/downloads/git2/MIRRORNAME;protocol=file"

---
  lib/bb/fetch2/__init__.py | 2 ++

  1 file changed, 2 insertions(+)
lib/bb/fetch2/__init__.py +0 -0
index cf0201c4..6701654b 100644
@@ -430,6 +430,8 @@ def uri_replace(ud, uri_find, uri_replace, 

replacements, d, mirrortarball=None):
      uri_replace_decoded = list(decodeurl(uri_replace))
      logger.debug2("For url %s comparing %s to %s" % (uri_decoded, uri_find_decoded, uri_replace_decoded)) result_decoded = ['', '', '', '', '', {}]
+    if uri_find_decoded[0] == '.*' and uri_replace_decoded[0] !=

Quoted 8 lines
Quoted 5 lines

'file':
+        uri_find_decoded[0] = uri_replace_decoded[0] for loc, i in enumerate(uri_find_decoded):
          result_decoded[loc] = uri_decoded[loc] regexp = i

I've not thought too much about the fix itself but for these kinds of changes we do ask that the tests be updated too in lib/bb/tests/ (run with bitbake-selftest).

Hi RP,

I think the current testcase(lib/bb/tests/fetch.py) is enough if this patch doesn't introduce regression issue(run with bitbake-selftest).

BTW, the patch solves the problem which I stated in the comments.

Thanks,

Quoted 9 lines

Cheers,

Richard

#3 lore raw
In reply to Yu, Mingli
Quoted 34 lines · Mingli
Quoted 15 lines · Richard Purdie

[Please note: This e-mail is from an EXTERNAL e-mail address]

Quoted 12 lines · Mingli

From: Mingli Yu <[email protected]>

Make sure the uri added as expected in some scenarioes such as with below setting:

PREMIRRORS_append = ".*://.*/.* git:///net/SharedImage/downloads/git2/MIRRORNAME;protocol=file"

---
  lib/bb/fetch2/__init__.py | 2 ++

  1 file changed, 2 insertions(+)
Quoted 16 lines
Quoted 10 lines
lib/bb/fetch2/__init__.py +0 -0
index cf0201c4..6701654b 100644
@@ -430,6 +430,8 @@ def uri_replace(ud, uri_find, uri_replace, replacements, d, mirrortarball=None):
       uri_replace_decoded = list(decodeurl(uri_replace))
       logger.debug2("For url %s comparing %s to %s" % (uri_decoded, uri_find_decoded, uri_replace_decoded))

      result_decoded = ['', '', '', '', '', {}]

lib/bb/fetch2/__init__.py +2 -0
+    if uri_find_decoded[0] == '.*' and uri_replace_decoded[0] != 'file':
+        uri_find_decoded[0] = uri_replace_decoded[0]
Quoted 3 lines

      for loc, i in enumerate(uri_find_decoded):
          result_decoded[loc] = uri_decoded[loc]
          regexp = i

I've not thought too much about the fix itself but for these kinds of changes we do ask that the tests be updated too in lib/bb/tests/ (run with bitbake-selftest).

Quoted 6 lines

Hi RP,

I think the current testcase(lib/bb/tests/fetch.py) is enough if this patch doesn't introduce regression issue(run with bitbake-selftest).

BTW, the patch solves the problem which I stated in the comments.

I understand that. My point is the test suite passes now and doesn't test the issue you're reporting. If we trust the test suite to be complete, your patch isn't needed and the code all works.

Obviously the test suite is not complete and needs something adding to it for the issue you're reporting.

Cheers,

Richard

author
#6 lore raw
In reply to a message not in the archive

Ping.

Thanks,

Quoted 58 lines · Mingli
Quoted 25 lines · Richard Purdie

[Please note: This e-mail is from an EXTERNAL e-mail address]

Quoted 22 lines · Mingli

From: Mingli Yu <[email protected]>

Make sure the uri added as expected in some scenarioes such as with below setting:

PREMIRRORS_append = ".*://.*/.* git:///net/SharedImage/downloads/git2/MIRRORNAME;protocol=file"

---
  lib/bb/fetch2/__init__.py | 2 ++

  1 file changed, 2 insertions(+)
lib/bb/fetch2/__init__.py +0 -0
index cf0201c4..6701654b 100644
@@ -430,6 +430,8 @@ def uri_replace(ud, uri_find, uri_replace, 

replacements, d, mirrortarball=None):
      uri_replace_decoded = list(decodeurl(uri_replace))
      logger.debug2("For url %s comparing %s to %s" % (uri_decoded, uri_find_decoded, uri_replace_decoded)) result_decoded = ['', '', '', '', '', {}]
+    if uri_find_decoded[0] == '.*' and uri_replace_decoded[0] !=

Quoted 8 lines
Quoted 5 lines

'file':
+        uri_find_decoded[0] = uri_replace_decoded[0] for loc, i in enumerate(uri_find_decoded):
          result_decoded[loc] = uri_decoded[loc] regexp = i

I've not thought too much about the fix itself but for these kinds of changes we do ask that the tests be updated too in lib/bb/tests/ (run with bitbake-selftest).

Hi RP,

I think the current testcase(lib/bb/tests/fetch.py) is enough if this patch doesn't introduce regression issue(run with bitbake-selftest).

BTW, the patch solves the problem which I stated in the comments.

Thanks,

Quoted 9 lines

Cheers,

Richard

author
#8 lore raw
Quoted 5 lines · Richard Purdie

[Please note: This e-mail is from an EXTERNAL e-mail address]

Quoted 1 line · Mingli

Ping.

Quoted 7 lines

I replied yesterday:

https://urldefense.com/v3/__https://lists.openembedded.org/g/bitbake-devel/message/12322__;!!AjveYdw8EvQ!Mn-KtCO9cVXaGpBP5QLknAHnTBlqZKyJx-DrSU4Cw_PaCNJWAGStDcj3SIZA3PkcTdw$

Daily pings are not going to go down too well with me FWIW particularly when you've not looked at the reply I took time to write and basically ignored my previous feedback too.

Sorry for the noise, seems my email client has some problems here.

I'm working on how to add the test case appropriately.

Thanks,

Quoted 5 lines

Cheers,

Richard