All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wget.py: handle BBFetchException
@ 2018-03-20 20:25 Bhargava Sreekantappa Gayathri
  2018-03-20 20:35 ` ✗ patchtest: failure for " Patchwork
  2018-03-20 23:07 ` [PATCH] " Richard Purdie
  0 siblings, 2 replies; 4+ messages in thread
From: Bhargava Sreekantappa Gayathri @ 2018-03-20 20:25 UTC (permalink / raw)
  To: openembedded-core, manjukum; +Cc: Bhargava Sreekantappa Gayathri

When BB_NO_NETWORK is set to 1 and the first mirror url needs network
access, then bitbake will just fail and report error instead of going
through the list of mirror urls. This is because BBFetchException is not
handled when wget is called.

This patch calls wget with a except blocks which returns to the previous
function instead of failing immediately.

Signed-off-by: Bhargava Sreekantappa Gayathri <bhargava.sreekantappa-gayathri@xilinx.com>
Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
---
 bitbake/lib/bb/fetch2/wget.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index 7c49c2b..95970d1 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/lib/bb/fetch2/wget.py
@@ -118,7 +118,12 @@ class Wget(FetchMethod):
         else:
             fetchcmd += d.expand(" -P ${DL_DIR} '%s'" % uri)

-        self._runwget(ud, d, fetchcmd, False)
+        try:
+
+            self._runwget(ud, d, fetchcmd, False)
+        except bb.fetch2.BBFetchException:
+            return False
+

         # Sanity check since wget can pretend it succeed when it didn't
         # Also, this used to happen if sourceforge sent us to the mirror page
--
2.7.4

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* ✗ patchtest: failure for wget.py: handle BBFetchException
  2018-03-20 20:25 [PATCH] wget.py: handle BBFetchException Bhargava Sreekantappa Gayathri
@ 2018-03-20 20:35 ` Patchwork
  2018-03-20 23:07 ` [PATCH] " Richard Purdie
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-03-20 20:35 UTC (permalink / raw)
  To: Bhargava Sreekantappa Gayathri; +Cc: openembedded-core

== Series Details ==

Series: wget.py: handle BBFetchException
Revision: 1
URL   : https://patchwork.openembedded.org/series/11491/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists [test_target_mailing_list] 
  Suggested fix    Send the series again to the correct mailing list (ML)
  Suggested ML     bitbake-devel@lists.openembedded.org [http://git.openembedded.org/bitbake/]
  Patch's path:    bitbake/lib/bb/fetch2/wget.py

* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at 086308aa2a)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] wget.py: handle BBFetchException
  2018-03-20 20:25 [PATCH] wget.py: handle BBFetchException Bhargava Sreekantappa Gayathri
  2018-03-20 20:35 ` ✗ patchtest: failure for " Patchwork
@ 2018-03-20 23:07 ` Richard Purdie
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2018-03-20 23:07 UTC (permalink / raw)
  To: Bhargava Sreekantappa Gayathri, openembedded-core, manjukum

On Tue, 2018-03-20 at 13:25 -0700, Bhargava Sreekantappa Gayathri
wrote:
> When BB_NO_NETWORK is set to 1 and the first mirror url needs network
> access, then bitbake will just fail and report error instead of going
> through the list of mirror urls. This is because BBFetchException is
> not
> handled when wget is called.
> 
> This patch calls wget with a except blocks which returns to the
> previous
> function instead of failing immediately.

This doesn't look right to me unfortunately. It looks like you special
cased one fetcher module when mirrors using other fetchers could also
fail. I'd have expected a patch to fix this somewhere in the mirrors
code, not in individual fetchers.

Am I missing a bug in the wget fetcher?

Cheers,

Richard


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] wget.py: handle BBFetchException
@ 2018-03-20 20:40 Bhargava Sreekantappa Gayathri
  0 siblings, 0 replies; 4+ messages in thread
From: Bhargava Sreekantappa Gayathri @ 2018-03-20 20:40 UTC (permalink / raw)
  To: bitbake-devel, manjukum; +Cc: Bhargava Sreekantappa Gayathri

When BB_NO_NETWORK is set to 1 and the first mirror url needs network
access, then bitbake will just fail and report error instead of going
through the list of mirror urls. This is because BBFetchException is not
handled when wget is called.

This patch calls wget with a except blocks which returns to the previous
function instead of failing immediately.

Signed-off-by: Bhargava Sreekantappa Gayathri <bhargava.sreekantappa-gayathri@xilinx.com>
---
 bitbake/lib/bb/fetch2/wget.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index 7c49c2b..95970d1 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/lib/bb/fetch2/wget.py
@@ -118,7 +118,12 @@ class Wget(FetchMethod):
         else:
             fetchcmd += d.expand(" -P ${DL_DIR} '%s'" % uri)

-        self._runwget(ud, d, fetchcmd, False)
+        try:
+
+            self._runwget(ud, d, fetchcmd, False)
+        except bb.fetch2.BBFetchException:
+            return False
+

         # Sanity check since wget can pretend it succeed when it didn't
         # Also, this used to happen if sourceforge sent us to the mirror page
--
2.7.4

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-20 23:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-20 20:25 [PATCH] wget.py: handle BBFetchException Bhargava Sreekantappa Gayathri
2018-03-20 20:35 ` ✗ patchtest: failure for " Patchwork
2018-03-20 23:07 ` [PATCH] " Richard Purdie
2018-03-20 20:40 Bhargava Sreekantappa Gayathri

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.