[yocto] [PATCH V3 04/11] update.py: fix -l option

Robert Yang liezhi.yang at windriver.com
Thu Jun 1 23:28:41 PDT 2017


Fixed:
$ ./update.py -l meta-oe,not_existed

It should report error that "not_existed" doesn't exist, but it didn't, this was
because __in matches any of them.

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
---
 layerindex/update.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/layerindex/update.py b/layerindex/update.py
index d5c56cd..54b9f87 100755
--- a/layerindex/update.py
+++ b/layerindex/update.py
@@ -152,10 +152,13 @@ def main():
         sys.exit(1)
 
     if options.layers:
-        layerquery = LayerItem.objects.filter(classic=False).filter(name__in=options.layers.split(','))
-        if layerquery.count() == 0:
-            logger.error('No layers matching specified query "%s"' % options.layers)
-            sys.exit(1)
+        layers = options.layers.split(',')
+        for layer in layers:
+            layerquery = LayerItem.objects.filter(classic=False).filter(name=layer)
+            if layerquery.count() == 0:
+                logger.error('No layers matching specified query "%s"' % layer)
+                sys.exit(1)
+        layerquery = LayerItem.objects.filter(classic=False).filter(name__in=layers)
     else:
         # We deliberately exclude status == 'X' ("no update") here
         layerquery = LayerItem.objects.filter(classic=False).filter(status='P')
-- 
2.10.2




More information about the yocto mailing list