Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] base: Remove pointless createCopy/update_data calls
@ 2014-02-25 17:41 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2014-02-25 17:41 UTC (permalink / raw)
  To: openembedded-core

I was asked why we had these copy and update_data calls. I can
offer no good explanation other than them perhaps once being needed
for reasons long since forgotten and superceeded.

With modern bitbake these should not be needed and shouldn't have been
for a long time. Lets therefore remove them and simplify the code.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 7837c89..3e9051c 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -106,11 +106,8 @@ python base_do_fetch() {
     if len(src_uri) == 0:
         return
 
-    localdata = bb.data.createCopy(d)
-    bb.data.update_data(localdata)
-
     try:
-        fetcher = bb.fetch2.Fetch(src_uri, localdata)
+        fetcher = bb.fetch2.Fetch(src_uri, d)
         fetcher.download()
     except bb.fetch2.BBFetchException as e:
         raise bb.build.FuncFailed(e)
@@ -124,13 +121,10 @@ python base_do_unpack() {
     if len(src_uri) == 0:
         return
 
-    localdata = bb.data.createCopy(d)
-    bb.data.update_data(localdata)
-
-    rootdir = localdata.getVar('WORKDIR', True)
+    rootdir = d.getVar('WORKDIR', True)
 
     try:
-        fetcher = bb.fetch2.Fetch(src_uri, localdata)
+        fetcher = bb.fetch2.Fetch(src_uri, d)
         fetcher.unpack(rootdir)
     except bb.fetch2.BBFetchException as e:
         raise bb.build.FuncFailed(e)
@@ -653,11 +647,8 @@ python do_cleanall() {
     if len(src_uri) == 0:
         return
 
-    localdata = bb.data.createCopy(d)
-    bb.data.update_data(localdata)
-
     try:
-        fetcher = bb.fetch2.Fetch(src_uri, localdata)
+        fetcher = bb.fetch2.Fetch(src_uri, d)
         fetcher.clean()
     except bb.fetch2.BBFetchException, e:
         raise bb.build.FuncFailed(e)




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-02-25 17:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-25 17:41 [PATCH] base: Remove pointless createCopy/update_data calls Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox