Skip to contentSkip to conversation

base.bbclass: not use bb.fetch.urldata in do_unpack() for traversing SRC_URIs

PATCH In review Denys Dmytriyenko 4 participants 4 messages Sep 27, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 base.bbclass: not use bb.fetch.urldata in do_unpack() for traversing SRC_URIs

bb.fetch.urldata contains cached SRC_URIs, but in case SRC_URI is altered by amend.inc or machine override, the original SRC_URI is not removed from the cache, leading to calling do_unpack() multiple times on original and modified versions of the file. Don't rely on bb.fetch.urldata and traverse SRC_URIs directly.

Some background and details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/36703

---
 classes/base.bbclass |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
classes/base.bbclass +6 -2
index b19eb32..964fe1c 100644
@@ -202,10 +202,14 @@ do_unpack[dirs] = "${WORKDIR}"
 python base_do_unpack() {
     from glob import glob
 
-    srcurldata = bb.fetch.init(d.getVar("SRC_URI", True).split(), d, True)
+    src_uri = d.getVar("SRC_URI", True)
+    if not src_uri:
+        return
+    srcurldata = bb.fetch.init(src_uri.split(), d, True)
     filespath = d.getVar("FILESPATH", True).split(":")
 
-    for url, urldata in srcurldata.iteritems():
+    for url in src_uri.split():
+        urldata = srcurldata[url]
         if urldata.type == "file" and "*" in urldata.path:
             # The fetch code doesn't know how to handle globs, so
             # we need to handle the local bits ourselves
Signature · 1 line
1.6.3.3
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Denys Dmytriyenko

bb.fetch.urldata contains cached SRC_URIs, but in case SRC_URI is altered by
amend.inc or machine override, the original SRC_URI is not removed from the cache, leading to calling do_unpack() multiple times on original and modified
versions of the file. Don't rely on bb.fetch.urldata and traverse SRC_URIs directly.

Quoted 5 lines

Some background and details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/36703

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
Acked-by on v1 1/1
#2 lore raw
In reply to Denys Dmytriyenko
Quoted 10 lines · Denys Dmytriyenko

bb.fetch.urldata contains cached SRC_URIs, but in case SRC_URI is altered by amend.inc or machine override, the original SRC_URI is not removed from the cache, leading to calling do_unpack() multiple times on original and modified versions of the file. Don't rely on bb.fetch.urldata and traverse SRC_URIs directly.

Some background and details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/36703

looks good

Quoted 34 lines

---
 classes/base.bbclass |    8 ++++++--

 1 files changed, 6 insertions(+), 2 deletions(-)
classes/base.bbclass +0 -0
index b19eb32..964fe1c 100644
@@ -202,10 +202,14 @@ do_unpack[dirs] = "${WORKDIR}"
  python base_do_unpack() {

    from glob import glob

-    srcurldata = bb.fetch.init(d.getVar("SRC_URI", True).split(), d, True)
+    src_uri = d.getVar("SRC_URI", True)
+    if not src_uri:
+        return
+    srcurldata = bb.fetch.init(src_uri.split(), d, True) filespath = d.getVar("FILESPATH", True).split(":")

-    for url, urldata in srcurldata.iteritems():
+    for url in src_uri.split():
+        urldata = srcurldata[url]
        if urldata.type == "file" and "*" in urldata.path:
            # The fetch code doesn't know how to handle globs, so

            # we need to handle the local bits ourselves
--
1.6.3.3

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#3 lore raw

2010/9/27 Khem Raj <[email protected]>:

Quoted 7 lines · Denys Dmytriyenko
Quoted 6 lines

bb.fetch.urldata contains cached SRC_URIs, but in case SRC_URI is altered by amend.inc or machine override, the original SRC_URI is not removed from the cache, leading to calling do_unpack() multiple times on original and modified versions of the file. Don't rely on bb.fetch.urldata and traverse SRC_URIs directly.

Quoted 8 lines
Quoted 4 lines

Some background and details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/36703

looks good

Tested, this also resolves my SRC_URI problem.

& thanks for fixing this!

Frans

Quoted 41 lines
Quoted 30 lines

---
 classes/base.bbclass |    8 ++++++--

 1 files changed, 6 insertions(+), 2 deletions(-)
classes/base.bbclass +0 -0
index b19eb32..964fe1c 100644
@@ -202,10 +202,14 @@ do_unpack[dirs] = "${WORKDIR}"
  python base_do_unpack() {

    from glob import glob

-    srcurldata = bb.fetch.init(d.getVar("SRC_URI", True).split(), d, True)
+    src_uri = d.getVar("SRC_URI", True)
+    if not src_uri:
+        return
+    srcurldata = bb.fetch.init(src_uri.split(), d, True) filespath = d.getVar("FILESPATH", True).split(":")

-    for url, urldata in srcurldata.iteritems():
+    for url in src_uri.split():
+        urldata = srcurldata[url]
        if urldata.type == "file" and "*" in urldata.path:
            # The fetch code doesn't know how to handle globs, so

            # we need to handle the local bits ourselves
--
1.6.3.3
Quoted 5 lines

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel