All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC] netbase: inherit allarch
@ 2013-03-20 19:26 Andreas Oberritter
  2013-03-20 20:18 ` Martin Jansa
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Oberritter @ 2013-03-20 19:26 UTC (permalink / raw)
  To: openembedded-core

It doesn't ship any binaries, so it should use allarch,
now that ifupdown has been moved to another recipe.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
This causes the following error on my system. Notice the "r0" in the failed
path. Running "bitbake -ccleansstate netbase" doesn't help.

ERROR: Error executing a python function in /build/openembedded-core/meta/recipes-core/netbase/netbase_5.0.bb:
OSError: [Errno 2] No such file or directory: '/build/tmp/work/all-oe-linux/netbase/netbase-1_5.0-r0/packages-split/netbase-dbg'

ERROR: The stack trace of python calls that resulted in this exception/failure was:
ERROR:   File "do_package_ipk", line 194, in <module>
ERROR: 
ERROR:   File "do_package_ipk", line 45, in do_package_ipk
ERROR: 
ERROR: The code that was being executed was:
ERROR:      0190:        bb.utils.unlockfile(lf)
ERROR:      0191:
ERROR:      0192:
ERROR:      0193:
ERROR:  *** 0194:do_package_ipk(d)
ERROR:      0195:
ERROR: [From file: 'do_package_ipk', lineno: 194, function: <module>]
ERROR:      0041:        basedir = os.path.join(os.path.dirname(root))
ERROR:      0042:        arch = localdata.getVar('PACKAGE_ARCH', True)
ERROR:      0043:        pkgoutdir = "%s/%s" % (outdir, arch)
ERROR:      0044:        bb.mkdirhier(pkgoutdir)
ERROR:  *** 0045:        os.chdir(root)
ERROR:      0046:        from glob import glob
ERROR:      0047:        g = glob('*')
ERROR:      0048:        try:
ERROR:      0049:            del g[g.index('CONTROL')]
ERROR: [From file: 'do_package_ipk', lineno: 45, function: do_package_ipk]
ERROR: Function failed: do_package_ipk
ERROR: Execution of event handler 'run_buildstats' failed
Traceback (most recent call last):
  File "run_buildstats(e)", line 104, in run_buildstats(e=<bb.build.TaskFailed object at 0x73d7810>)
  File "buildstats.bbclass", line 5, in write_task_data(status='failed', logfile='/build/tmp/buildstats/netbase-qemumipsel/201303202017/netbase-1_5.0-r0/do_package_write_ipk', dev='dm-1', e=<bb.build.TaskFailed object at 0x73d7810>)
IOError: [Errno 2] No such file or directory: '/build/tmp/buildstats/netbase-qemumipsel/201303202017/netbase-1_5.0-r0/do_package_write_ipk'

ERROR: Logfile of failure stored in: /build/tmp/work/all-oe-linux/netbase/netbase-1_5.0-r1/temp/log.do_package_write_ipk.27140
ERROR: Task 13 (/build/openembedded-core/meta/recipes-core/netbase/netbase_5.0.bb, do_package_write_ipk) failed with exit code '1'

 meta/recipes-core/netbase/netbase_5.0.bb |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/netbase/netbase_5.0.bb b/meta/recipes-core/netbase/netbase_5.0.bb
index 03fdc38..673a139 100644
--- a/meta/recipes-core/netbase/netbase_5.0.bb
+++ b/meta/recipes-core/netbase/netbase_5.0.bb
@@ -4,7 +4,7 @@ HOMEPAGE = "http://packages.debian.org/netbase"
 SECTION = "base"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://debian/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
-PR = "r0"
+PR = "r1"
 PE = "1"
 
 SRC_URI = "${DEBIAN_MIRROR}/main/n/netbase/netbase_${PV}.tar.gz \
@@ -13,6 +13,8 @@ SRC_URI = "${DEBIAN_MIRROR}/main/n/netbase/netbase_${PV}.tar.gz \
 SRC_URI[md5sum] = "a379d9199d44d817543eddc211a29b70"
 SRC_URI[sha256sum] = "ac9424d3cb2bd3c07b6c5bc5875c434d3bc687a73cd7c54b7dc7122308afa9dc"
 
+inherit allarch
+
 do_install () {
 	install -d ${D}/${mandir}/man8 ${D}${sysconfdir}
 	install -m 0644 ${WORKDIR}/hosts ${D}${sysconfdir}/hosts
-- 
1.7.10.4




^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH/RFC] netbase: inherit allarch
  2013-03-20 19:26 [PATCH/RFC] netbase: inherit allarch Andreas Oberritter
@ 2013-03-20 20:18 ` Martin Jansa
  2013-03-20 20:22   ` Martin Jansa
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Jansa @ 2013-03-20 20:18 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 4308 bytes --]

On Wed, Mar 20, 2013 at 08:26:07PM +0100, Andreas Oberritter wrote:
> It doesn't ship any binaries, so it should use allarch,
> now that ifupdown has been moved to another recipe.
> 
> Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
> ---
> This causes the following error on my system. Notice the "r0" in the failed
> path. Running "bitbake -ccleansstate netbase" doesn't help.

You need to remove tmpdir-eglibc/pkgdata for netbase too and don't
forget to remove all .ipk files from deploy/ipk too, because opkg will
prefer "higher" architecture instead of higher version, so you'll get
different (older) netbase installed in do_rootfs and then upgraded on
target on first opkg upgrade, sigh.

> ERROR: Error executing a python function in /build/openembedded-core/meta/recipes-core/netbase/netbase_5.0.bb:
> OSError: [Errno 2] No such file or directory: '/build/tmp/work/all-oe-linux/netbase/netbase-1_5.0-r0/packages-split/netbase-dbg'
> 
> ERROR: The stack trace of python calls that resulted in this exception/failure was:
> ERROR:   File "do_package_ipk", line 194, in <module>
> ERROR: 
> ERROR:   File "do_package_ipk", line 45, in do_package_ipk
> ERROR: 
> ERROR: The code that was being executed was:
> ERROR:      0190:        bb.utils.unlockfile(lf)
> ERROR:      0191:
> ERROR:      0192:
> ERROR:      0193:
> ERROR:  *** 0194:do_package_ipk(d)
> ERROR:      0195:
> ERROR: [From file: 'do_package_ipk', lineno: 194, function: <module>]
> ERROR:      0041:        basedir = os.path.join(os.path.dirname(root))
> ERROR:      0042:        arch = localdata.getVar('PACKAGE_ARCH', True)
> ERROR:      0043:        pkgoutdir = "%s/%s" % (outdir, arch)
> ERROR:      0044:        bb.mkdirhier(pkgoutdir)
> ERROR:  *** 0045:        os.chdir(root)
> ERROR:      0046:        from glob import glob
> ERROR:      0047:        g = glob('*')
> ERROR:      0048:        try:
> ERROR:      0049:            del g[g.index('CONTROL')]
> ERROR: [From file: 'do_package_ipk', lineno: 45, function: do_package_ipk]
> ERROR: Function failed: do_package_ipk
> ERROR: Execution of event handler 'run_buildstats' failed
> Traceback (most recent call last):
>   File "run_buildstats(e)", line 104, in run_buildstats(e=<bb.build.TaskFailed object at 0x73d7810>)
>   File "buildstats.bbclass", line 5, in write_task_data(status='failed', logfile='/build/tmp/buildstats/netbase-qemumipsel/201303202017/netbase-1_5.0-r0/do_package_write_ipk', dev='dm-1', e=<bb.build.TaskFailed object at 0x73d7810>)
> IOError: [Errno 2] No such file or directory: '/build/tmp/buildstats/netbase-qemumipsel/201303202017/netbase-1_5.0-r0/do_package_write_ipk'
> 
> ERROR: Logfile of failure stored in: /build/tmp/work/all-oe-linux/netbase/netbase-1_5.0-r1/temp/log.do_package_write_ipk.27140
> ERROR: Task 13 (/build/openembedded-core/meta/recipes-core/netbase/netbase_5.0.bb, do_package_write_ipk) failed with exit code '1'
> 
>  meta/recipes-core/netbase/netbase_5.0.bb |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-core/netbase/netbase_5.0.bb b/meta/recipes-core/netbase/netbase_5.0.bb
> index 03fdc38..673a139 100644
> --- a/meta/recipes-core/netbase/netbase_5.0.bb
> +++ b/meta/recipes-core/netbase/netbase_5.0.bb
> @@ -4,7 +4,7 @@ HOMEPAGE = "http://packages.debian.org/netbase"
>  SECTION = "base"
>  LICENSE = "GPLv2"
>  LIC_FILES_CHKSUM = "file://debian/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
> -PR = "r0"
> +PR = "r1"
>  PE = "1"
>  
>  SRC_URI = "${DEBIAN_MIRROR}/main/n/netbase/netbase_${PV}.tar.gz \
> @@ -13,6 +13,8 @@ SRC_URI = "${DEBIAN_MIRROR}/main/n/netbase/netbase_${PV}.tar.gz \
>  SRC_URI[md5sum] = "a379d9199d44d817543eddc211a29b70"
>  SRC_URI[sha256sum] = "ac9424d3cb2bd3c07b6c5bc5875c434d3bc687a73cd7c54b7dc7122308afa9dc"
>  
> +inherit allarch
> +
>  do_install () {
>  	install -d ${D}/${mandir}/man8 ${D}${sysconfdir}
>  	install -m 0644 ${WORKDIR}/hosts ${D}${sysconfdir}/hosts
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH/RFC] netbase: inherit allarch
  2013-03-20 20:18 ` Martin Jansa
@ 2013-03-20 20:22   ` Martin Jansa
  2013-04-03 10:14     ` [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories Martin Jansa
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Jansa @ 2013-03-20 20:22 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 4812 bytes --]

On Wed, Mar 20, 2013 at 09:18:43PM +0100, Martin Jansa wrote:
> On Wed, Mar 20, 2013 at 08:26:07PM +0100, Andreas Oberritter wrote:
> > It doesn't ship any binaries, so it should use allarch,
> > now that ifupdown has been moved to another recipe.
> > 
> > Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
> > ---
> > This causes the following error on my system. Notice the "r0" in the failed
> > path. Running "bitbake -ccleansstate netbase" doesn't help.
> 
> You need to remove tmpdir-eglibc/pkgdata for netbase too and don't
> forget to remove all .ipk files from deploy/ipk too, because opkg will
> prefer "higher" architecture instead of higher version, so you'll get
> different (older) netbase installed in do_rootfs and then upgraded on
> target on first opkg upgrade, sigh.

Ah and also netbase stamps.

I've reported the same when netbase was changed from MACHINE_ARCH to
TUNE_PKGARCH:
http://www.mail-archive.com/openembedded-core@lists.openembedded.org/msg34318.html

> > ERROR: Error executing a python function in /build/openembedded-core/meta/recipes-core/netbase/netbase_5.0.bb:
> > OSError: [Errno 2] No such file or directory: '/build/tmp/work/all-oe-linux/netbase/netbase-1_5.0-r0/packages-split/netbase-dbg'
> > 
> > ERROR: The stack trace of python calls that resulted in this exception/failure was:
> > ERROR:   File "do_package_ipk", line 194, in <module>
> > ERROR: 
> > ERROR:   File "do_package_ipk", line 45, in do_package_ipk
> > ERROR: 
> > ERROR: The code that was being executed was:
> > ERROR:      0190:        bb.utils.unlockfile(lf)
> > ERROR:      0191:
> > ERROR:      0192:
> > ERROR:      0193:
> > ERROR:  *** 0194:do_package_ipk(d)
> > ERROR:      0195:
> > ERROR: [From file: 'do_package_ipk', lineno: 194, function: <module>]
> > ERROR:      0041:        basedir = os.path.join(os.path.dirname(root))
> > ERROR:      0042:        arch = localdata.getVar('PACKAGE_ARCH', True)
> > ERROR:      0043:        pkgoutdir = "%s/%s" % (outdir, arch)
> > ERROR:      0044:        bb.mkdirhier(pkgoutdir)
> > ERROR:  *** 0045:        os.chdir(root)
> > ERROR:      0046:        from glob import glob
> > ERROR:      0047:        g = glob('*')
> > ERROR:      0048:        try:
> > ERROR:      0049:            del g[g.index('CONTROL')]
> > ERROR: [From file: 'do_package_ipk', lineno: 45, function: do_package_ipk]
> > ERROR: Function failed: do_package_ipk
> > ERROR: Execution of event handler 'run_buildstats' failed
> > Traceback (most recent call last):
> >   File "run_buildstats(e)", line 104, in run_buildstats(e=<bb.build.TaskFailed object at 0x73d7810>)
> >   File "buildstats.bbclass", line 5, in write_task_data(status='failed', logfile='/build/tmp/buildstats/netbase-qemumipsel/201303202017/netbase-1_5.0-r0/do_package_write_ipk', dev='dm-1', e=<bb.build.TaskFailed object at 0x73d7810>)
> > IOError: [Errno 2] No such file or directory: '/build/tmp/buildstats/netbase-qemumipsel/201303202017/netbase-1_5.0-r0/do_package_write_ipk'
> > 
> > ERROR: Logfile of failure stored in: /build/tmp/work/all-oe-linux/netbase/netbase-1_5.0-r1/temp/log.do_package_write_ipk.27140
> > ERROR: Task 13 (/build/openembedded-core/meta/recipes-core/netbase/netbase_5.0.bb, do_package_write_ipk) failed with exit code '1'
> > 
> >  meta/recipes-core/netbase/netbase_5.0.bb |    4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/meta/recipes-core/netbase/netbase_5.0.bb b/meta/recipes-core/netbase/netbase_5.0.bb
> > index 03fdc38..673a139 100644
> > --- a/meta/recipes-core/netbase/netbase_5.0.bb
> > +++ b/meta/recipes-core/netbase/netbase_5.0.bb
> > @@ -4,7 +4,7 @@ HOMEPAGE = "http://packages.debian.org/netbase"
> >  SECTION = "base"
> >  LICENSE = "GPLv2"
> >  LIC_FILES_CHKSUM = "file://debian/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
> > -PR = "r0"
> > +PR = "r1"
> >  PE = "1"
> >  
> >  SRC_URI = "${DEBIAN_MIRROR}/main/n/netbase/netbase_${PV}.tar.gz \
> > @@ -13,6 +13,8 @@ SRC_URI = "${DEBIAN_MIRROR}/main/n/netbase/netbase_${PV}.tar.gz \
> >  SRC_URI[md5sum] = "a379d9199d44d817543eddc211a29b70"
> >  SRC_URI[sha256sum] = "ac9424d3cb2bd3c07b6c5bc5875c434d3bc687a73cd7c54b7dc7122308afa9dc"
> >  
> > +inherit allarch
> > +
> >  do_install () {
> >  	install -d ${D}/${mandir}/man8 ${D}${sysconfdir}
> >  	install -m 0644 ${WORKDIR}/hosts ${D}${sysconfdir}/hosts
> > -- 
> > 1.7.10.4
> > 
> > 
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
> 
> -- 
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com



-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories
  2013-03-20 20:22   ` Martin Jansa
@ 2013-04-03 10:14     ` Martin Jansa
  2013-04-03 10:14       ` [RFC][PATCH 2/2] packagedata: Show error when trying to change PE/PV/PR from runtime/pkgdata Martin Jansa
  2013-04-04 15:39       ` [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories Martin Jansa
  0 siblings, 2 replies; 8+ messages in thread
From: Martin Jansa @ 2013-04-03 10:14 UTC (permalink / raw)
  To: openembedded-core

* when PACKAGE_ARCH is changed e.g. from MACHINE_ARCH to TUNE_PKGARCH
  get_subpkgedata_fn is still reading old MACHINE_ARCH directory instead of newer with TUNE_PKGARCH
---
 meta/lib/oe/packagedata.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/packagedata.py b/meta/lib/oe/packagedata.py
index 62fd718..2533700 100644
--- a/meta/lib/oe/packagedata.py
+++ b/meta/lib/oe/packagedata.py
@@ -34,11 +34,18 @@ def get_subpkgedata_fn(pkg, d):
     dirs = all_pkgdatadirs(d)
 
     pkgdata = d.expand('${TMPDIR}/pkgdata/')
+    found = None
     for dir in dirs:
         fn = pkgdata + dir + pkg
         if os.path.exists(fn):
-            return fn
-    return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg)
+	    if found:
+                bb.error("More then one pkgdata dir found for pkg '%s' ('%s', '%s'), returning first" % (pkg, found, fn))
+                continue
+            found = fn
+    if found:
+        return found
+    else:
+        return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg)
 
 def has_subpkgdata(pkg, d):
     return os.access(get_subpkgedata_fn(pkg, d), os.R_OK)
@@ -68,6 +75,7 @@ def read_subpkgdata_dict(pkg, d):
     return ret
 
 def _pkgmap(d):
+    import bb
     """Return a dictionary mapping package to recipe name."""
 
     target_os = d.getVar("TARGET_OS", True)
@@ -85,6 +93,7 @@ def _pkgmap(d):
             continue
 
         for pn in filter(lambda f: not os.path.isdir(os.path.join(pkgdatadir, f)), files):
+            bb.warn("Trying path '%s'" % os.path.join(pkgdatadir, pn))
             try:
                 pkgdata = read_pkgdatafile(os.path.join(pkgdatadir, pn))
             except OSError:
-- 
1.8.1.5




^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RFC][PATCH 2/2] packagedata: Show error when trying to change PE/PV/PR from runtime/pkgdata
  2013-04-03 10:14     ` [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories Martin Jansa
@ 2013-04-03 10:14       ` Martin Jansa
  2013-04-04 15:39       ` [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories Martin Jansa
  1 sibling, 0 replies; 8+ messages in thread
From: Martin Jansa @ 2013-04-03 10:14 UTC (permalink / raw)
  To: openembedded-core

* causes build failure before do_package_write_ipk fails when trying to use wrong WORKDIR
---
 meta/classes/packagedata.bbclass | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/meta/classes/packagedata.bbclass b/meta/classes/packagedata.bbclass
index 120cd64..b22458e 100644
--- a/meta/classes/packagedata.bbclass
+++ b/meta/classes/packagedata.bbclass
@@ -1,7 +1,10 @@
 python read_subpackage_metadata () {
     import oe.packagedata
 
+    pe = d.getVar('PE', True)
     pn = d.getVar('PN', True)
+    pr = d.getVar('PR', True)
+    pv = d.getVar('PV', True)
     data = oe.packagedata.read_pkgdata(pn, d)
 
     for key in data.keys():
@@ -14,5 +17,17 @@ python read_subpackage_metadata () {
                 if sdata[key] != pn:
                     bb.fatal("Recipe %s is trying to create package %s which was already written by recipe %s. This will cause corruption, please resolve this and only provide the package from one recipe or the other or only build one of the recipes." % (pn, pkg, sdata[key]))
                 continue
+            if key == "PE":
+                if sdata[key] != pe:
+                    bb.fatal("Recipe %s is trying to change PE from '%s' to '%s'. This will cause do_package_write_ipk failing to find right workdir." % (pn, pe, sdata[key]))
+                continue
+            if key == "PV":
+                if sdata[key] != pv:
+                    bb.fatal("Recipe %s is trying to change PV from '%s' to '%s'. This will cause do_package_write_ipk failing to find right workdir." % (pn, pv, sdata[key]))
+                continue
+            if key == "PR":
+                if sdata[key] != pr:
+                    bb.fatal("Recipe %s is trying to change PR from '%s' to '%s'. This will cause do_package_write_ipk failing to find right workdir." % (pn, pr, sdata[key]))
+                continue
             d.setVar(key, sdata[key])
 }
-- 
1.8.1.5




^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories
  2013-04-03 10:14     ` [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories Martin Jansa
  2013-04-03 10:14       ` [RFC][PATCH 2/2] packagedata: Show error when trying to change PE/PV/PR from runtime/pkgdata Martin Jansa
@ 2013-04-04 15:39       ` Martin Jansa
  2013-04-04 15:48         ` Paul Eggleton
  2013-04-04 15:58         ` Richard Purdie
  1 sibling, 2 replies; 8+ messages in thread
From: Martin Jansa @ 2013-04-04 15:39 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 2371 bytes --]

On Wed, Apr 03, 2013 at 12:14:33PM +0200, Martin Jansa wrote:
> * when PACKAGE_ARCH is changed e.g. from MACHINE_ARCH to TUNE_PKGARCH
>   get_subpkgedata_fn is still reading old MACHINE_ARCH directory instead of newer with TUNE_PKGARCH

This is too strict in some cases, e.g.:

ERROR: More then one pkgdata dir found for pkg 'opkg-collateral'
(
'/OE/shr-core/tmp-eglibc/pkgdata/cortexa8-vfp-neon-oe-linux-gnueabi/runtime/opkg-collateral',
'/OE/shr-core/tmp-eglibc/pkgdata/armv5te-oe-linux-gnueabi/runtime/opkg-collateral'),
returning first

Why do we need to look in all pkgdatadirs? Why not just PACKAGE_ARCH?

> ---
>  meta/lib/oe/packagedata.py | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/lib/oe/packagedata.py b/meta/lib/oe/packagedata.py
> index 62fd718..2533700 100644
> --- a/meta/lib/oe/packagedata.py
> +++ b/meta/lib/oe/packagedata.py
> @@ -34,11 +34,18 @@ def get_subpkgedata_fn(pkg, d):
>      dirs = all_pkgdatadirs(d)
>  
>      pkgdata = d.expand('${TMPDIR}/pkgdata/')
> +    found = None
>      for dir in dirs:
>          fn = pkgdata + dir + pkg
>          if os.path.exists(fn):
> -            return fn
> -    return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg)
> +	    if found:
> +                bb.error("More then one pkgdata dir found for pkg '%s' ('%s', '%s'), returning first" % (pkg, found, fn))
> +                continue
> +            found = fn
> +    if found:
> +        return found
> +    else:
> +        return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg)
>  
>  def has_subpkgdata(pkg, d):
>      return os.access(get_subpkgedata_fn(pkg, d), os.R_OK)
> @@ -68,6 +75,7 @@ def read_subpkgdata_dict(pkg, d):
>      return ret
>  
>  def _pkgmap(d):
> +    import bb
>      """Return a dictionary mapping package to recipe name."""
>  
>      target_os = d.getVar("TARGET_OS", True)
> @@ -85,6 +93,7 @@ def _pkgmap(d):
>              continue
>  
>          for pn in filter(lambda f: not os.path.isdir(os.path.join(pkgdatadir, f)), files):
> +            bb.warn("Trying path '%s'" % os.path.join(pkgdatadir, pn))
>              try:
>                  pkgdata = read_pkgdatafile(os.path.join(pkgdatadir, pn))
>              except OSError:
> -- 
> 1.8.1.5
> 

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories
  2013-04-04 15:39       ` [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories Martin Jansa
@ 2013-04-04 15:48         ` Paul Eggleton
  2013-04-04 15:58         ` Richard Purdie
  1 sibling, 0 replies; 8+ messages in thread
From: Paul Eggleton @ 2013-04-04 15:48 UTC (permalink / raw)
  To: Martin Jansa; +Cc: openembedded-core

On Thursday 04 April 2013 17:39:30 Martin Jansa wrote:
> On Wed, Apr 03, 2013 at 12:14:33PM +0200, Martin Jansa wrote:
> > * when PACKAGE_ARCH is changed e.g. from MACHINE_ARCH to TUNE_PKGARCH
> > 
> >   get_subpkgedata_fn is still reading old MACHINE_ARCH directory instead
> >   of newer with TUNE_PKGARCH
> This is too strict in some cases, e.g.:
> 
> ERROR: More then one pkgdata dir found for pkg 'opkg-collateral'
> (
> '/OE/shr-core/tmp-eglibc/pkgdata/cortexa8-vfp-neon-oe-linux-gnueabi/runtime/
> opkg-collateral',
> '/OE/shr-core/tmp-eglibc/pkgdata/armv5te-oe-linux-gnueabi/runtime/opkg-coll
> ateral'), returning first
> 
> Why do we need to look in all pkgdatadirs? Why not just PACKAGE_ARCH?

So this code may well not be doing the right thing, but PACKAGE_ARCH won't 
work either because this is called to get a list of all packages not just one, 
and we therefore have no context to know PACKAGE_ARCH.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories
  2013-04-04 15:39       ` [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories Martin Jansa
  2013-04-04 15:48         ` Paul Eggleton
@ 2013-04-04 15:58         ` Richard Purdie
  1 sibling, 0 replies; 8+ messages in thread
From: Richard Purdie @ 2013-04-04 15:58 UTC (permalink / raw)
  To: Martin Jansa; +Cc: openembedded-core

On Thu, 2013-04-04 at 17:39 +0200, Martin Jansa wrote:
> On Wed, Apr 03, 2013 at 12:14:33PM +0200, Martin Jansa wrote:
> > * when PACKAGE_ARCH is changed e.g. from MACHINE_ARCH to TUNE_PKGARCH
> >   get_subpkgedata_fn is still reading old MACHINE_ARCH directory instead of newer with TUNE_PKGARCH
> 
> This is too strict in some cases, e.g.:
> 
> ERROR: More then one pkgdata dir found for pkg 'opkg-collateral'
> (
> '/OE/shr-core/tmp-eglibc/pkgdata/cortexa8-vfp-neon-oe-linux-gnueabi/runtime/opkg-collateral',
> '/OE/shr-core/tmp-eglibc/pkgdata/armv5te-oe-linux-gnueabi/runtime/opkg-collateral'),
> returning first
> 
> Why do we need to look in all pkgdatadirs? Why not just PACKAGE_ARCH?

It needs to do resolution, so for example you might have a machine
specific library you'd expect the code to find it first, then
architecture specific and finally all arch only if the others don't work
out.

Having said that, I've had thoughts about making this just look at
machine, package_arch and allarch, not everything. It also gets more
complicated with multilibs.

It may be the different callers might need to specify more about what
exactly they're after as they may want different things.

Cheers,

Richard




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-04-04 16:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-20 19:26 [PATCH/RFC] netbase: inherit allarch Andreas Oberritter
2013-03-20 20:18 ` Martin Jansa
2013-03-20 20:22   ` Martin Jansa
2013-04-03 10:14     ` [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories Martin Jansa
2013-04-03 10:14       ` [RFC][PATCH 2/2] packagedata: Show error when trying to change PE/PV/PR from runtime/pkgdata Martin Jansa
2013-04-04 15:39       ` [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories Martin Jansa
2013-04-04 15:48         ` Paul Eggleton
2013-04-04 15:58         ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.