1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 00:59:48 +00:00

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>
This commit is contained in:
Markus Lehtonen
2015-05-27 17:27:56 +03:00
committed by Richard Purdie
parent 1f4830734a
commit 962f8a499e
+6 -8
View File
@@ -57,10 +57,9 @@ def add(args, config, basepath, workspace):
elif os.listdir(srctree): elif os.listdir(srctree):
logger.error("Cannot fetch into source tree path %s as it already exists and is non-empty" % srctree) logger.error("Cannot fetch into source tree path %s as it already exists and is non-empty" % srctree)
return 1 return 1
else: elif not args.fetch:
if not args.fetch: logger.error("Specified source tree %s could not be found" % srctree)
logger.error("Specified source tree %s could not be found" % srctree) return 1
return 1
appendpath = os.path.join(config.workspace_path, 'appends') appendpath = os.path.join(config.workspace_path, 'appends')
if not os.path.exists(appendpath): 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) logger.error("recipe %s is already in your workspace" % args.recipename)
return -1 return -1
if not args.extract: if not args.extract and not os.path.isdir(args.srctree):
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)
logger.error("directory %s does not exist or not a directory (specify -x to extract source from recipe)" % args.srctree) return -1
return -1
tinfoil = setup_tinfoil() tinfoil = setup_tinfoil()