Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] add checking to standardize how .bbappend files do FILESEXTRAPATHS
@ 2014-07-21  5:34 Hongxu Jia
  2014-07-21  5:34 ` [PATCH 1/1] " Hongxu Jia
  0 siblings, 1 reply; 3+ messages in thread
From: Hongxu Jia @ 2014-07-21  5:34 UTC (permalink / raw)
  To: openembedded-core; +Cc: saul.wold

Test Steps:

1) Edit meta-yocto/recipes-core/busybox/busybox_%.bbappend
   and assigned FILESEXTRAPATHS incorrectly:
...
--- a/meta-yocto/recipes-core/busybox/busybox_%.bbappend
+++ b/meta-yocto/recipes-core/busybox/busybox_%.bbappend
@@ -1,2 +1,2 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
+FILESEXTRAPATHS := "${THISDIR}/${BPN}:"
...

2) bitbake busybox
...
ERROR: Please assign FILESEXTRAPATHS with the format of:
  FILESEXTRAPATHS_append := ${THISDIR}/Your_Files_Path or
  FILESEXTRAPATHS_prepend := ${THISDIR}/Your_Files_Path
in your bbappend file

ERROR: Failed to parse recipe: /home/jiahongxu/yocto/poky/meta/recipes-core/busybox/busybox_1.22.1.bb
...

//Hongxu

The following changes since commit 4d2ac6f6df2b3ef98699dd4f7afadb2d994222bb:

  rootfs: Remove the extraneous install directory (2014-07-19 00:18:21 +0100)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib hongxu/filesextrapaths
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/filesextrapaths

Hongxu Jia (1):
  add checking to standardize how .bbappend files do FILESEXTRAPATHS

 meta/classes/base.bbclass                  |  1 +
 meta/classes/filesextrapaths_check.bbclass | 10 ++++++++++
 meta/classes/utils.bbclass                 |  2 ++
 meta/conf/bitbake.conf                     |  2 ++
 4 files changed, 15 insertions(+)
 create mode 100644 meta/classes/filesextrapaths_check.bbclass

-- 
1.8.1.2



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

* [PATCH 1/1] add checking to standardize how .bbappend files do FILESEXTRAPATHS
  2014-07-21  5:34 [PATCH 0/1] add checking to standardize how .bbappend files do FILESEXTRAPATHS Hongxu Jia
@ 2014-07-21  5:34 ` Hongxu Jia
  2014-07-21  6:03   ` Hongxu Jia
  0 siblings, 1 reply; 3+ messages in thread
From: Hongxu Jia @ 2014-07-21  5:34 UTC (permalink / raw)
  To: openembedded-core; +Cc: saul.wold

When adding patches or config files from bbappend files, it requires
the use of FILESEXTRAPATHS, which has been an issue and failure point
for people starting to work with bitbake and oe-core.

We add checking to standardize how to use FILESEXTRAPATHS. Only the
format of:
  FILESEXTRAPATHS_append := ${THISDIR}/Your_Files_Path or
  FILESEXTRAPATHS_prepend := ${THISDIR}/Your_Files_Path
is acceptable.

[YOCTO #5412]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/classes/base.bbclass                  |  1 +
 meta/classes/filesextrapaths_check.bbclass | 10 ++++++++++
 meta/classes/utils.bbclass                 |  2 ++
 meta/conf/bitbake.conf                     |  2 ++
 4 files changed, 15 insertions(+)
 create mode 100644 meta/classes/filesextrapaths_check.bbclass

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 8114cf6..be8400a 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -9,6 +9,7 @@ inherit utils
 inherit utility-tasks
 inherit metadata_scm
 inherit logging
+inherit filesextrapaths_check
 
 OE_IMPORTS += "os sys time oe.path oe.utils oe.data oe.package oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath"
 OE_IMPORTS[type] = "list"
diff --git a/meta/classes/filesextrapaths_check.bbclass b/meta/classes/filesextrapaths_check.bbclass
new file mode 100644
index 0000000..6863e0c
--- /dev/null
+++ b/meta/classes/filesextrapaths_check.bbclass
@@ -0,0 +1,10 @@
+python __anonymous() {
+    # Checking ${FILESEXTRAPATHS}
+    extrapaths = (d.getVar("FILESEXTRAPATHS", True) or "")
+    if '__default' not in extrapaths.split(":"):
+        msg =  "Please assign FILESEXTRAPATHS with the format of:\n"
+        msg += "  FILESEXTRAPATHS_append := ${THISDIR}/Your_Files_Path or\n"
+        msg += "  FILESEXTRAPATHS_prepend := ${THISDIR}/Your_Files_Path\n"
+        msg += "in your bbappend file\n"
+        bb.fatal(msg)
+}
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index 0ee13e0..0f2a484 100644
--- a/meta/classes/utils.bbclass
+++ b/meta/classes/utils.bbclass
@@ -312,6 +312,8 @@ def explode_deps(s):
 def base_set_filespath(path, d):
     filespath = []
     extrapaths = (d.getVar("FILESEXTRAPATHS", True) or "")
+    # Remove default flag which was used for checking
+    extrapaths = extrapaths.replace("__default:", "")
     # Don't prepend empty strings to the path list
     if extrapaths != "":
         path = extrapaths.split(":") + path
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index f4870d5..6a0cf7a 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -311,6 +311,8 @@ FILES_${PN}-locale = "${datadir}/locale"
 FILE_DIRNAME = "${@os.path.dirname(d.getVar('FILE'))}"
 # FILESPATH is set in base.bbclass
 #FILESPATH = "${FILE_DIRNAME}/${PF}:${FILE_DIRNAME}/${P}:${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/${BP}:${FILE_DIRNAME}/${BPN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}"
+# This default was only used for checking
+FILESEXTRAPATHS ?= "__default:"
 
 ##################################################################
 # General work and output directories for the build system.
-- 
1.8.1.2



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

* Re: [PATCH 1/1] add checking to standardize how .bbappend files do FILESEXTRAPATHS
  2014-07-21  5:34 ` [PATCH 1/1] " Hongxu Jia
@ 2014-07-21  6:03   ` Hongxu Jia
  0 siblings, 0 replies; 3+ messages in thread
From: Hongxu Jia @ 2014-07-21  6:03 UTC (permalink / raw)
  To: openembedded-core; +Cc: saul.wold

I think it is more reasonable to move the checking to insance.bbclass
  rather than create a new bbclass.

Please drop this, V2 incoming.

//Hongxu


On 07/21/2014 01:34 PM, Hongxu Jia wrote:
> When adding patches or config files from bbappend files, it requires
> the use of FILESEXTRAPATHS, which has been an issue and failure point
> for people starting to work with bitbake and oe-core.
>
> We add checking to standardize how to use FILESEXTRAPATHS. Only the
> format of:
>    FILESEXTRAPATHS_append := ${THISDIR}/Your_Files_Path or
>    FILESEXTRAPATHS_prepend := ${THISDIR}/Your_Files_Path
> is acceptable.
>
> [YOCTO #5412]
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>   meta/classes/base.bbclass                  |  1 +
>   meta/classes/filesextrapaths_check.bbclass | 10 ++++++++++
>   meta/classes/utils.bbclass                 |  2 ++
>   meta/conf/bitbake.conf                     |  2 ++
>   4 files changed, 15 insertions(+)
>   create mode 100644 meta/classes/filesextrapaths_check.bbclass
>
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index 8114cf6..be8400a 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -9,6 +9,7 @@ inherit utils
>   inherit utility-tasks
>   inherit metadata_scm
>   inherit logging
> +inherit filesextrapaths_check
>   
>   OE_IMPORTS += "os sys time oe.path oe.utils oe.data oe.package oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath"
>   OE_IMPORTS[type] = "list"
> diff --git a/meta/classes/filesextrapaths_check.bbclass b/meta/classes/filesextrapaths_check.bbclass
> new file mode 100644
> index 0000000..6863e0c
> --- /dev/null
> +++ b/meta/classes/filesextrapaths_check.bbclass
> @@ -0,0 +1,10 @@
> +python __anonymous() {
> +    # Checking ${FILESEXTRAPATHS}
> +    extrapaths = (d.getVar("FILESEXTRAPATHS", True) or "")
> +    if '__default' not in extrapaths.split(":"):
> +        msg =  "Please assign FILESEXTRAPATHS with the format of:\n"
> +        msg += "  FILESEXTRAPATHS_append := ${THISDIR}/Your_Files_Path or\n"
> +        msg += "  FILESEXTRAPATHS_prepend := ${THISDIR}/Your_Files_Path\n"
> +        msg += "in your bbappend file\n"
> +        bb.fatal(msg)
> +}
> diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
> index 0ee13e0..0f2a484 100644
> --- a/meta/classes/utils.bbclass
> +++ b/meta/classes/utils.bbclass
> @@ -312,6 +312,8 @@ def explode_deps(s):
>   def base_set_filespath(path, d):
>       filespath = []
>       extrapaths = (d.getVar("FILESEXTRAPATHS", True) or "")
> +    # Remove default flag which was used for checking
> +    extrapaths = extrapaths.replace("__default:", "")
>       # Don't prepend empty strings to the path list
>       if extrapaths != "":
>           path = extrapaths.split(":") + path
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index f4870d5..6a0cf7a 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -311,6 +311,8 @@ FILES_${PN}-locale = "${datadir}/locale"
>   FILE_DIRNAME = "${@os.path.dirname(d.getVar('FILE'))}"
>   # FILESPATH is set in base.bbclass
>   #FILESPATH = "${FILE_DIRNAME}/${PF}:${FILE_DIRNAME}/${P}:${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/${BP}:${FILE_DIRNAME}/${BPN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}"
> +# This default was only used for checking
> +FILESEXTRAPATHS ?= "__default:"
>   
>   ##################################################################
>   # General work and output directories for the build system.



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

end of thread, other threads:[~2014-07-21  6:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-21  5:34 [PATCH 0/1] add checking to standardize how .bbappend files do FILESEXTRAPATHS Hongxu Jia
2014-07-21  5:34 ` [PATCH 1/1] " Hongxu Jia
2014-07-21  6:03   ` Hongxu Jia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox