]> code.ossystems Code Review - openembedded-core.git/commitdiff
devtool: deploy-target: detect and error if D is empty
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Sun, 8 Mar 2015 12:51:36 +0000 (12:51 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 20 Mar 2015 11:03:12 +0000 (11:03 +0000)
If you haven't built the recipe yet or if the output directory (${D}) is
empty, then we should tell the user rather than have scp error out.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/devtool/deploy.py

index d232d3179ff6cb1228f94c0a23c290aa2c8caa92..68edb981135689891392997c5dfa5788c2b36946 100644 (file)
@@ -43,13 +43,17 @@ def deploy(args, config, basepath, workspace):
     deploy_dir = os.path.join(basepath, 'target_deploy', args.target)
     deploy_file = os.path.join(deploy_dir, args.recipename + '.list')
 
+    stdout, stderr = exec_build_env_command(config.init_path, basepath, 'bitbake -e %s' % args.recipename, shell=True)
+    recipe_outdir = re.search(r'^D="(.*)"', stdout, re.MULTILINE).group(1)
+    if not os.path.exists(recipe_outdir) or not os.listdir(recipe_outdir):
+        logger.error('No files to deploy - have you built the %s recipe? If so, the install step has not installed any files.' % args.recipename)
+        return -1
+
     if os.path.exists(deploy_file):
         if undeploy(args, config, basepath, workspace):
             # Error already shown
             return -1
 
-    stdout, stderr = exec_build_env_command(config.init_path, basepath, 'bitbake -e %s' % args.recipename, shell=True)
-    recipe_outdir = re.search(r'^D="(.*)"', stdout, re.MULTILINE).group(1)
     extraoptions = ''
     if args.no_host_check:
         extraoptions += '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'