summaryrefslogtreecommitdiff
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:12:00 +0100
commit06f6b20f040d2e4eee577bb2111351523ee97af2 (patch)
treef2487e4c8777976ef209c5884742961c4eb7aefc
parentaff88bcebe335b0277df660ac22eeed28d65da44 (diff)
downloadopenembedded-core-06f6b20f040d2e4eee577bb2111351523ee97af2.tar.gz
openembedded-core-06f6b20f040d2e4eee577bb2111351523ee97af2.tar.bz2
openembedded-core-06f6b20f040d2e4eee577bb2111351523ee97af2.zip
devtool: simplify few conditionals a bit
Just refactor the code. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-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):
elif os.listdir(srctree):
logger.error("Cannot fetch into source tree path %s as it already exists and is non-empty" % srctree)
return 1
- else:
- if not args.fetch:
- logger.error("Specified source tree %s could not be found" % srctree)
- return 1
+ elif not args.fetch:
+ logger.error("Specified source tree %s could not be found" % srctree)
+ return 1
appendpath = os.path.join(config.workspace_path, 'appends')
if not os.path.exists(appendpath):
@@ -424,10 +423,9 @@ def modify(args, config, basepath, workspace):
logger.error("recipe %s is already in your workspace" % args.recipename)
return -1
- if not args.extract:
- if not os.path.isdir(args.srctree):
- logger.error("directory %s does not exist or not a directory (specify -x to extract source from recipe)" % args.srctree)
- return -1
+ if not args.extract and not os.path.isdir(args.srctree):
+ logger.error("directory %s does not exist or not a directory (specify -x to extract source from recipe)" % args.srctree)
+ return -1
tinfoil = setup_tinfoil()