summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2015-05-27 17:27:56 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-18 09:14:05 +0100
commit962f8a499ead073b4371df7243082df7a7ec4c9f (patch)
tree65f63e79f26bb05ef935a49174dfe7ed695a2fc6 /scripts
parent1f4830734ae7c69095238e3a8a5bf8c448f64985 (diff)
downloadpoky-962f8a499ead073b4371df7243082df7a7ec4c9f.tar.gz
devtool: simplify few conditionals a bit
Just refactor the code. (From OE-Core rev: 06f6b20f040d2e4eee577bb2111351523ee97af2) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/devtool/standard.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index aa95e6eeaf..4b9cebb210 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -57,10 +57,9 @@ def add(args, config, basepath, workspace):
57 elif os.listdir(srctree): 57 elif os.listdir(srctree):
58 logger.error("Cannot fetch into source tree path %s as it already exists and is non-empty" % srctree) 58 logger.error("Cannot fetch into source tree path %s as it already exists and is non-empty" % srctree)
59 return 1 59 return 1
60 else: 60 elif not args.fetch:
61 if not args.fetch: 61 logger.error("Specified source tree %s could not be found" % srctree)
62 logger.error("Specified source tree %s could not be found" % srctree) 62 return 1
63 return 1
64 63
65 appendpath = os.path.join(config.workspace_path, 'appends') 64 appendpath = os.path.join(config.workspace_path, 'appends')
66 if not os.path.exists(appendpath): 65 if not os.path.exists(appendpath):
@@ -424,10 +423,9 @@ def modify(args, config, basepath, workspace):
424 logger.error("recipe %s is already in your workspace" % args.recipename) 423 logger.error("recipe %s is already in your workspace" % args.recipename)
425 return -1 424 return -1
426 425
427 if not args.extract: 426 if not args.extract and not os.path.isdir(args.srctree):
428 if not os.path.isdir(args.srctree): 427 logger.error("directory %s does not exist or not a directory (specify -x to extract source from recipe)" % args.srctree)
429 logger.error("directory %s does not exist or not a directory (specify -x to extract source from recipe)" % args.srctree) 428 return -1
430 return -1
431 429
432 tinfoil = setup_tinfoil() 430 tinfoil = setup_tinfoil()
433 431