]> code.ossystems Code Review - openembedded-core.git/commitdiff
combo-layer: minor refactor
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Wed, 7 Jan 2015 16:00:41 +0000 (18:00 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 29 Jan 2015 10:37:53 +0000 (10:37 +0000)
Change get_repos() to assume a list of repository names instead of full
list of command line arguments.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/combo-layer

index 19d64e64e1fb46acfa373c504d0f9405e938581b..37d1f4712dbdd5e20fdf2b6b1611dc3e17259e73 100755 (executable)
@@ -305,18 +305,17 @@ def check_rev_branch(component, repodir, rev, branch):
         return False
     return True
 
-def get_repos(conf, args):
+def get_repos(conf, repo_names):
     repos = []
-    if len(args) > 1:
-        for arg in args[1:]:
-            if arg.startswith('-'):
-                break
-            else:
-                repos.append(arg)
-        for repo in repos:
-            if not repo in conf.repos:
-                logger.error("Specified component '%s' not found in configuration" % repo)
-                sys.exit(0)
+    for name in repo_names:
+        if name.startswith('-'):
+            break
+        else:
+            repos.append(name)
+    for repo in repos:
+        if not repo in conf.repos:
+            logger.error("Specified component '%s' not found in configuration" % repo)
+            sys.exit(0)
 
     if not repos:
         repos = conf.repos
@@ -327,7 +326,7 @@ def action_pull(conf, args):
     """
         update the component repos only
     """
-    repos = get_repos(conf, args)
+    repos = get_repos(conf, args[1:])
 
     # make sure all repos are clean
     for name in repos:
@@ -348,7 +347,7 @@ def action_update(conf, args):
         generate the patch list
         apply the generated patches
     """
-    repos = get_repos(conf, args)
+    repos = get_repos(conf, args[1:])
 
     # make sure combo repo is clean
     check_repo_clean(os.getcwd())