cve-update-db: Skip recipe when cve-check class is not loaded.

Submitted by Pierre Le Magourou on July 8, 2019, 8:14 a.m. | Patch ID: 162877

Details

Message ID 20190708081423.8849-1-lemagoup@gmail.com
State New
Headers show

Commit Message

Pierre Le Magourou July 8, 2019, 8:14 a.m.
From: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>

Signed-off-by: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
---
 meta/recipes-core/meta/cve-update-db.bb | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/meta/recipes-core/meta/cve-update-db.bb b/meta/recipes-core/meta/cve-update-db.bb
index ae8f1a958b..cfeee91c2e 100644
--- a/meta/recipes-core/meta/cve-update-db.bb
+++ b/meta/recipes-core/meta/cve-update-db.bb
@@ -13,6 +13,11 @@  deltask do_compile
 deltask do_install
 deltask do_populate_sysroot
 
+python () {
+    if not d.getVar("CVE_CHECK_DB_FILE"):
+        raise bb.parse.SkipRecipe("Skip recipe when cve-check class is not loaded.")
+}
+
 python do_populate_cve_db() {
     """
     Update NVD database with json data feed

Comments

Robert Yang July 8, 2019, 9 a.m.
Great, the "bitbake universe --runall=fetch" works now.

// Robert

On 7/8/19 4:14 PM, Pierre Le Magourou wrote:
> From: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
> 
> Signed-off-by: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
> ---
>   meta/recipes-core/meta/cve-update-db.bb | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/meta/recipes-core/meta/cve-update-db.bb b/meta/recipes-core/meta/cve-update-db.bb
> index ae8f1a958b..cfeee91c2e 100644
> --- a/meta/recipes-core/meta/cve-update-db.bb
> +++ b/meta/recipes-core/meta/cve-update-db.bb
> @@ -13,6 +13,11 @@ deltask do_compile
>   deltask do_install
>   deltask do_populate_sysroot
>   
> +python () {
> +    if not d.getVar("CVE_CHECK_DB_FILE"):
> +        raise bb.parse.SkipRecipe("Skip recipe when cve-check class is not loaded.")
> +}
> +
>   python do_populate_cve_db() {
>       """
>       Update NVD database with json data feed
>
Pierre Le Magourou July 8, 2019, 9:03 a.m.
>
> Great, the "bitbake universe --runall=fetch" works now.
>

I just forgot to rebase this patch on the previous ones that are in
master-next, I sent a rebased v2.

Pierre