Message ID | 20221014065247.1825762-1-adrian.freihofer@siemens.com |
---|---|
State | Accepted, archived |
Commit | e0d45bcd34311ae248bac9378f46962198d148ef |
Headers | show |
Series | buildconf: compare abspath | expand |
Hi Adrian, Adrian Freihofer <adrian.freihofer@gmail.com> escreveu no dia sexta, 14/10/2022 à(s) 07:53: > We have something like ${TOPDIR}/../../poky/meta in the bblayers.conf > file. This does not work without normalizing the path for comparison. > > Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> > --- > meta/lib/bblayers/buildconf.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/meta/lib/bblayers/buildconf.py > b/meta/lib/bblayers/buildconf.py > index e07fc534e1..ccab332adf 100644 > --- a/meta/lib/bblayers/buildconf.py > +++ b/meta/lib/bblayers/buildconf.py > @@ -64,7 +64,7 @@ TEMPLATECONF={} . {}/oe-init-build-env build-try-{}""" > oecore = None > > for l in layers: > - if l[0] == os.path.abspath(args.layerpath): > + if os.path.abspath(l[0]) == os.path.abspath(args.layerpath): > targetlayer = l[0] > Maybe can be better to have the abspath of layerpath in targetlayer layerpath = os.path.abspath(args.layerpath) if os.path.abspath(l[0]) == layerpath: targetlayer = layerpath Jose if l[1] == 'meta': > oecore = os.path.dirname(l[0]) > -- > 2.37.3 > > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#171725): > https://lists.openembedded.org/g/openembedded-core/message/171725 > Mute This Topic: https://lists.openembedded.org/mt/94321973/5052612 > Group Owner: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ > quaresma.jose@gmail.com] > -=-=-=-=-=-=-=-=-=-=-=- > >
On Fri, 14 Oct 2022 at 09:59, Jose Quaresma <quaresma.jose@gmail.com> wrote: >> for l in layers: >> - if l[0] == os.path.abspath(args.layerpath): >> + if os.path.abspath(l[0]) == os.path.abspath(args.layerpath): >> targetlayer = l[0] > > > Maybe can be better to have the abspath of layerpath in targetlayer > > layerpath = os.path.abspath(args.layerpath) > if os.path.abspath(l[0]) == layerpath: > targetlayer = layerpath I prefer Adrian's version. 'layerpath' is not a good name, and targetlayer does not need to be absolute. If you'd like to refactor this, doing this with a boolean variable 'has_targetlayer' would be better. Alex
diff --git a/meta/lib/bblayers/buildconf.py b/meta/lib/bblayers/buildconf.py index e07fc534e1..ccab332adf 100644 --- a/meta/lib/bblayers/buildconf.py +++ b/meta/lib/bblayers/buildconf.py @@ -64,7 +64,7 @@ TEMPLATECONF={} . {}/oe-init-build-env build-try-{}""" oecore = None for l in layers: - if l[0] == os.path.abspath(args.layerpath): + if os.path.abspath(l[0]) == os.path.abspath(args.layerpath): targetlayer = l[0] if l[1] == 'meta': oecore = os.path.dirname(l[0])
We have something like ${TOPDIR}/../../poky/meta in the bblayers.conf file. This does not work without normalizing the path for comparison. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> --- meta/lib/bblayers/buildconf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)