[OE-core] [PATCH] devtool: extract: remove patches when S=WORKDIR

Paul Eggleton paul.eggleton at linux.intel.com
Tue Apr 21 15:04:57 UTC 2015


Hi Markus,

On Tuesday 21 April 2015 17:49:54 Markus Lehtonen wrote:
> All local files from the layer, including patches, are added to to
> srctree repository when S==WORKDIR. The patch files are useless as they
> are automatically applied on top of the srctree by devtool.
> 
> This change causes devtool extract to remove these unnecessary (and
> possibly confusing) patch file(s). The patches will be removed in one
> single commit.
> 
> [YOCTO #7602]
> 
> Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>
> ---
>  scripts/lib/devtool/standard.py | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/scripts/lib/devtool/standard.py
> b/scripts/lib/devtool/standard.py index a50a771..41bcf86 100644
> --- a/scripts/lib/devtool/standard.py
> +++ b/scripts/lib/devtool/standard.py
> @@ -248,6 +248,26 @@ def _extract_source(srctree, keep_temp, devbranch, d):
>              else:
>                  os.rmdir(patchdir)
> 
> +        # Find local patches that were "unpacked" to srctree directory
> +        patches = []
> +        for uri in (crd.getVar('SRC_URI', True) or "").split():
> +            if uri.startswith('file://'):
> +                fname = os.path.basename(uri).split(';')[0]
> +                # Take patch "basename" without the possible compression
> +                # extension (.gz etc)
> +                match = re.match(r'^(.+\.patch)(\..+)?$', fname)
> +                if match:
> +                    patches.append(match.group(1))

Could you please use get_recipe_patches() from recipeutils.py for this? 
There's some logic in there that I'd rather we didn't re-implement.

Thanks,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the Openembedded-core mailing list