* [v2 PATCH 0/1] classes/patch: return non-patch source items
@ 2012-02-01 18:55 Bruce Ashfield
2012-02-01 18:55 ` [PATCH] classes/patch: optionally return non-patch sources Bruce Ashfield
0 siblings, 1 reply; 3+ messages in thread
From: Bruce Ashfield @ 2012-02-01 18:55 UTC (permalink / raw)
To: richard.purdie; +Cc: chris_larson, openembedded-core
Richard,
Here's v2 of this request.
Changes since v1:
- Changed the parameter to src_patches from 'type' to
'all, and make it a boolean versus a magic string
- Changed the name of 'others' to 'sources in the collecting
list.
With the name 'all' as the parameter, you may think that it would
return patches + non-patches instead of just non-patches. But that's
largely a property of the new variable name. I'd rather keep them
separate and really not return a mix of patches and non-patches. If
we think this will cause confusion, I can always change the name of
the variable again.
Below is the original request:
When working with Tom on some BSP usability cases, he noted that it was nice
that we can specify more complex features in the SRC_URI now that patch
ordering and location is maintained by using the src_patches abstraction that
Chris added to patch.bbclass. But .. there's always a but, you had to
specify some sort of patch to trigger the processing.
Rather than hack something in that is specific to linux-yocto, it seemed
like a good idea to add the ability to get 'anything that isn't a patch'
from the same routines that Chris added to patch.bbclass.
I'm now using this support to pickup all sorts of things from the SRC_URI,
without knowing anything about the format of the SRC_URI itself. Extra
filtering on 'other' is the responsibility of the caller.
I'm not the worlds top python coder yet, so I'm sure there are better ways
to do this, hence why I'm calling this an RFC patch. I can re-work it
as appropriate to get it into the tree, and I'll follow up with my user
of the new functionality.
Cheers,
Bruce
cc: Chris Larson <chris_larson@mentor.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH] classes/patch: optionally return non-patch sources
2012-02-01 18:55 [v2 PATCH 0/1] classes/patch: return non-patch source items Bruce Ashfield
@ 2012-02-01 18:55 ` Bruce Ashfield
2012-02-03 16:51 ` Richard Purdie
0 siblings, 1 reply; 3+ messages in thread
From: Bruce Ashfield @ 2012-02-01 18:55 UTC (permalink / raw)
To: richard.purdie; +Cc: chris_larson, openembedded-core
commit:
patch.bbclass: abstract out logic that determines patches to apply
gives the ability for other clases to emit series files for use outside
of a build system, or even within the build system. There are sometimes
elements on the SRC_URI that while not directly applicable to patching,
can be related to patching the package. For example, the yocto kernel
class would like to know about these other source items on the SRC_URI
to locate out of tree kernel features.
This change keeps the default behaviour of returning patches, but adds the
ability to request that non-patch results be returned. Additional filtering
within the non-patch category, is left up to the caller of the routine.
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
---
meta/classes/patch.bbclass | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass
index 1ea4bc5..31db9e3 100644
--- a/meta/classes/patch.bbclass
+++ b/meta/classes/patch.bbclass
@@ -7,13 +7,17 @@ PATCHDEPENDENCY = "${PATCHTOOL}-native:do_populate_sysroot"
inherit terminal
-def src_patches(d):
+def src_patches(d, all = False ):
workdir = d.getVar('WORKDIR', True)
fetch = bb.fetch2.Fetch([], d)
patches = []
+ sources = []
for url in fetch.urls:
local = patch_path(url, fetch, workdir)
if not local:
+ if all:
+ local = fetch.localpath(url)
+ sources.append(local)
continue
urldata = fetch.ud[url]
@@ -43,6 +47,9 @@ def src_patches(d):
localurl = bb.encodeurl(('file', '', local, '', '', patchparm))
patches.append(localurl)
+ if all:
+ return sources
+
return patches
def patch_path(url, fetch, workdir):
--
1.7.4.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] classes/patch: optionally return non-patch sources
2012-02-01 18:55 ` [PATCH] classes/patch: optionally return non-patch sources Bruce Ashfield
@ 2012-02-03 16:51 ` Richard Purdie
0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2012-02-03 16:51 UTC (permalink / raw)
To: Bruce Ashfield; +Cc: chris_larson, openembedded-core
On Wed, 2012-02-01 at 13:55 -0500, Bruce Ashfield wrote:
> commit:
>
> patch.bbclass: abstract out logic that determines patches to apply
>
> gives the ability for other clases to emit series files for use outside
> of a build system, or even within the build system. There are sometimes
> elements on the SRC_URI that while not directly applicable to patching,
> can be related to patching the package. For example, the yocto kernel
> class would like to know about these other source items on the SRC_URI
> to locate out of tree kernel features.
>
> This change keeps the default behaviour of returning patches, but adds the
> ability to request that non-patch results be returned. Additional filtering
> within the non-patch category, is left up to the caller of the routine.
>
> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
> ---
> meta/classes/patch.bbclass | 9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
Merged to master, thanks.
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-02-03 18:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-01 18:55 [v2 PATCH 0/1] classes/patch: return non-patch source items Bruce Ashfield
2012-02-01 18:55 ` [PATCH] classes/patch: optionally return non-patch sources Bruce Ashfield
2012-02-03 16:51 ` Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox