Patchwork [2/3] wic: check passed-in build artifact directories

login
register
mail settings
Submitter tom.zanussi@linux.intel.com
Date Oct. 16, 2013, 5:14 a.m.
Message ID <6fe8e69ccc25d80959fa9ea2a66c45af2fd7fa54.1381898855.git.tom.zanussi@linux.intel.com>
Download mbox | patch
Permalink /patch/59985/
State Accepted
Commit 71454f961e8c21da24147132ba0143f8c88c7fbf
Headers show

Comments

tom.zanussi@linux.intel.com - Oct. 16, 2013, 5:14 a.m.
Make sure they exist - complain if they don't.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 scripts/wic | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Patch

diff --git a/scripts/wic b/scripts/wic
index aa2791a..425b665 100755
--- a/scripts/wic
+++ b/scripts/wic
@@ -119,6 +119,18 @@  def wic_create_subcommand(args, usage_str):
         bootimg_dir = options.bootimg_dir
         kernel_dir = options.kernel_dir
         native_sysroot = options.native_sysroot
+        if not os.path.isdir(rootfs_dir):
+            print "--roofs-dir (-r) not found, exiting\n"
+            sys.exit(1)
+        if not os.path.isdir(bootimg_dir):
+            print "--bootimg-dir (-b) not found, exiting\n"
+            sys.exit(1)
+        if not os.path.isdir(kernel_dir):
+            print "--kernel-dir (-k) not found, exiting\n"
+            sys.exit(1)
+        if not os.path.isdir(native_sysroot):
+            print "--native-sysroot (-n) not found, exiting\n"
+            sys.exit(1)
 
     wic_create(args, wks_file, rootfs_dir, bootimg_dir, kernel_dir,
                native_sysroot, hdddir, staging_data_dir, scripts_path,