Bug 9928

Summary: yocto-bsp: logical if statements should be avoided in json return by list subcommand
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Humberto Ibarra <humberto.ibarra.lopez>
Component: Scripts and ToolsAssignee: Daniela Plascencia <daniela.plascencia>
Status: RESOLVED OBSOLETE QA Contact:
Severity: normal    
Priority: Medium CC: leonardo.sandoval.gonzalez, ross.burton, sgw
Version: 2.2   
Target Milestone: 2.5 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Humberto Ibarra 2016-07-13 17:26:40 UTC
'yocto-bsp list <arch> --properties' returns some kind of json listing the properties of an arch. Since some of these properties vary depending on others, conditional 'ifs' were added to the json making some kind pseudo-markup output.

This output is messy and weird and should be avoided. There should be a better way of showing this, specially considering that the json generated by yocto-bsp list <arch> --properties puts all its json body inside a string, which is odd and is not useful to anybody.

IFs shown on 'yocto-bsp list <arch> --properties':

"if kernel_choice == "linux-yocto_4.1":" :
{
    "smp" :
{
        "prio" :
30
        "filename" :
/home/humberto/poky-dev/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.1.bbappend
        "default" :
y
        "type" :
boolean
        "msg" :
Do you need SMP support? (y/n)
    }
    "new_kbranch" :
{
        "prio" :
20
        "filename" :
/home/humberto/poky-dev/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.1.bbappend
        "type" :
choicelist
        "branches_base" :
standard
        "default" :
standard/base
        "gen" :
bsp.kernel.all_branches
        "msg" :
Please choose a machine branch to base this BSP on:
    }
    "need_new_kbranch" :
{
        "prio" :
20
        "filename" :
/home/humberto/poky-dev/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.1.bbappend
        "default" :
y
        "type" :
boolean
        "msg" :
Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]
    }
    "existing_kbranch" :
{
        "prio" :
20
        "filename" :
/home/humberto/poky-dev/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.1.bbappend
        "type" :
choicelist
        "branches_base" :
standard
        "default" :
standard/base
        "gen" :
bsp.kernel.all_branches
        "msg" :
Please choose a machine branch to base this BSP on:
    }
}


IFs obtained from 'yocto-bsp list <arch> --properties -o <filename>:

 "if kernel_choice == \"linux-yocto_4.4\":": {
  "need_new_kbranch": {
   "prio": "20",
   "filename": "/home/humberto/poky-dev/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.4.bbappend",
   "default": "y",
   "msg": "Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]",
   "type": "boolean"
  },
  "new_kbranch": {
   "default": "standard/base",
   "type": "choicelist",
   "prio": "20",
   "gen": "bsp.kernel.all_branches",
   "filename": "/home/humberto/poky-dev/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.4.bbappend",
   "msg": "Please choose a machine branch to base this BSP on:",
   "branches_base": "standard"
  },
  "existing_kbranch": {
   "default": "standard/base",
   "type": "choicelist",
   "prio": "20",
   "gen": "bsp.kernel.all_branches",
   "filename": "/home/humberto/poky-dev/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.4.bbappend",
   "msg": "Please choose a machine branch to base this BSP on:",
   "branches_base": "standard"
  },
  "smp": {
   "prio": "30",
   "filename": "/home/humberto/poky-dev/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.4.bbappend",
   "default": "y",
   "msg": "Do you need SMP support? (y/n)",
   "type": "boolean"
  }
 }
Comment 1 Daniela Plascencia 2017-09-28 22:14:02 UTC
Moving to 2.5 M1. I will work on these bugs on 2.5.
Comment 2 Daniela Plascencia 2017-11-03 18:54:06 UTC
The yocto-bsp script, along with yocto-layer and yocto-kernel, will be removed from public repositories soon as they are no longer maintained. The request was sent to the mailing list [1], meaning this issue is obsolete.

[1] https://lists.yoctoproject.org/pipermail/poky/2017-October/011135.html