[OE-core] [PATCH] base: improve do_unpack[cleandirs] logic
Peter Kjellerstedt
peter.kjellerstedt at axis.com
Fri Apr 27 16:34:27 UTC 2018
> -----Original Message-----
> From: openembedded-core-bounces at lists.openembedded.org
> [mailto:openembedded-core-bounces at lists.openembedded.org] On Behalf Of
> Burton, Ross
> Sent: den 26 april 2018 12:46
> To: OE-core <openembedded-core at lists.openembedded.org>
> Subject: Re: [OE-core] [PATCH] base: improve do_unpack[cleandirs] logic
>
> Retracting this, doesn't work on a clean build dir.
>
> Ross
>
> On 25 April 2018 at 14:58, Ross Burton <ross.burton at intel.com> wrote:
> > If a recipe sets S to ${WORKDIR}/ then the S != WORKDIR test doesn't
> work as
> > expected. Use os.path.samefile() instead of string comparisons to do
> the right
> > thing.
> >
> > Signed-off-by: Ross Burton <ross.burton at intel.com>
> > ---
> > meta/classes/base.bbclass | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> > index bb1f4b75336..7ddf70414a1 100644
> > --- a/meta/classes/base.bbclass
> > +++ b/meta/classes/base.bbclass
> > @@ -152,7 +152,7 @@ python base_do_fetch() {
> > addtask unpack after do_fetch
> > do_unpack[dirs] = "${WORKDIR}"
> >
> > -do_unpack[cleandirs] = "${@d.getVar('S') if d.getVar('S') != d.getVar('WORKDIR') else os.path.join('${S}', 'patches')}"
This should work even if the paths don't exist:
do_unpack[cleandirs] = "${@d.getVar('S') if os.path.realpath(d.getVar('S')) != os.path.realpath(d.getVar('WORKDIR')) else os.path.join('${S}', 'patches')}"
> > +do_unpack[cleandirs] = "${@os.path.join('${S}', 'patches') if os.path.samefile(d.getVar('S'), d.getVar('WORKDIR')) else d.getVar('S')}"
> >
> > python base_do_unpack() {
> > src_uri = (d.getVar('SRC_URI') or "").split()
> > --
> > 2.11.0
//Peter
More information about the Openembedded-core
mailing list