Skip to contentSkip to conversation

oe-layertool-setup.sh, *master-config.txt: add support for cloning repos w/o layers

PATCH New Denys Dmytriyenko 1 participant 1 message Nov 6, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oe-layertool-setup.sh, *master-config.txt: add support for cloning repos w/o layers

From: Denys Dmytriyenko <[email protected]>

Historically, specifying empty layers= or not specifying it at all would result in automatically locating all layers inside the repo and populating them into bblayers.conf. Originally bitbake repo had no layers, but the script would still add it to the bblayers.conf. Lately, some testing code has been added to bitbake repo with few test layers inside, which would result in erroneously locating and adding them to the final bblayers.conf. Add support for skipping adding any layers completely by dropping layers= specifier. But leaving empty layers= would result in the old behavior of locating all layers.

---
 configs/distroless-master-config.txt |  2 +-
 configs/poky-master-config.txt       |  2 +-
 oe-layertool-setup.sh                | 22 ++++++++++++++++++----
 3 files changed, 20 insertions(+), 6 deletions(-)
configs/distroless-master-config.txt +1 -1
index 27b3e11..19b5e63 100644
@@ -1,6 +1,6 @@
 # This file takes repo entries in the format
 # repo name,repo uri,repo branch,repo commit[,layers=layer1:layer2...:layern]
-bitbake,git://git.openembedded.org/bitbake,master,HEAD,layers=
+bitbake,git://git.openembedded.org/bitbake,master,HEAD
 meta-ti,git://git.yoctoproject.org/meta-ti,master,HEAD,layers=
 oe-core,git://git.openembedded.org/openembedded-core,master,HEAD,layers=meta
 OECORELAYERCONF=./sample-files/bblayers.conf.sample
configs/poky-master-config.txt +1 -1
index f991e34..5a77ace 100644
@@ -1,6 +1,6 @@
 # This file takes repo entries in the format
 # repo name,repo uri,repo branch,repo commit[,layers=layer1:layer2...:layern]
-bitbake,git://git.openembedded.org/bitbake,master,HEAD,layers=
+bitbake,git://git.openembedded.org/bitbake,master,HEAD
 poky,git://git.yoctoproject.org/poky,master,HEAD,layers=meta:meta-poky:meta-yocto-bsp
 meta-ti,git://git.yoctoproject.org/meta-ti,master,HEAD,layers=
 OECORELAYERCONF=./sample-files/bblayers.conf.sample
oe-layertool-setup.sh +18 -4
index e1560f3..b309b55 100755
@@ -177,12 +177,13 @@ parse_repo_line() {
     eval $prefix"commit"=`echo $1 | cut -d, -f4`
     parsed_layers=`echo $1 | cut -d, -f5-`
 
-    # Blank the temp variable
-    temp_layers=""
+    # If no layers= was used, then don't add any layers
+    temp_layers="none"
 
-    # If layers= was used then set the layers variable
+    # If layers= was used then set the layers variable, empty list would add all found layers
     if [ "x$parsed_layers" != "x" ]
     then
+        temp_layers=""
         temp=`echo $parsed_layers | cut -d= -f2`
         # temporarily reset the IFS value to : to split the layers
         for x in `IFS=":";echo $temp`
@@ -199,7 +200,10 @@ parse_repo_line() {
     if [ "x$temp_layers" = "x" ]
     then
         eval $prefix"repo_layers"="all"
-    else 
+    elif [ "x$temp_layers" = "xnone" ]
+    then
+        eval $prefix"repo_layers"="none"
+    else
         eval $prefix"repo_layers"='$temp_layers'
     fi
 }
@@ -315,6 +319,10 @@ configure_repo() {
     elif [ "x$repo_layers" = "x" ]
     then
         select_layers
+    elif [ "x$repo_layers" = "xnone" ]
+    then
+        # Call select layers with the none option to not select any layers
+        select_layers "none"
     fi
 
     verify_layers
@@ -482,6 +490,12 @@ select_layers() {
     #If so prompt for which layers to configure
     #If there is only one then just configure that layer and don't prompt
 
+    if [ "x$arg1" = "xnone" ]
+    then
+        repo_layers=""
+        return
+    fi
+
     cd $sourcedir
     # Get a count of how many layers there are
     count=`find $name -name "layer.conf" | grep -c layer.conf`
Signature · 1 line
2.7.4