aboutsummaryrefslogtreecommitdiff
path: root/linaro-media-create
diff options
context:
space:
mode:
authorJames Tunnicliffe <james.tunnicliffe@linaro.org>2011-07-21 13:52:11 +0100
committerJames Tunnicliffe <james.tunnicliffe@linaro.org>2011-07-21 13:52:11 +0100
commit6da1def49ed46b9ce815a168352b8d9a46aaf2a1 (patch)
tree1df106b0eaaeebb945df584d94e6df9be3f83a9c /linaro-media-create
parentd95d1eea51a5aa2c488dcda1a49ce8b73dd81aad (diff)
downloadlinaro-image-tools-6da1def49ed46b9ce815a168352b8d9a46aaf2a1.tar.gz
Added communicate function to cmd_runner that will both throw an exception if the function it is communicating with exits with a non-zero exit code and also returns stdout and stderr in the exception object.
Diffstat (limited to 'linaro-media-create')
-rwxr-xr-xlinaro-media-create34
1 files changed, 18 insertions, 16 deletions
diff --git a/linaro-media-create b/linaro-media-create
index 18a26e3..dc2c6dd 100755
--- a/linaro-media-create
+++ b/linaro-media-create
@@ -114,22 +114,24 @@ if __name__ == '__main__':
# Check the outputs from verify_file_integrity
# Abort if anything fails.
- if not gpg_sig_pass:
- print >> sys.stderr, "GPG signature verification failed. Aborting."
- sys.exit(1)
-
- if not os.path.basename(args.binary) in verified_files:
- print >> sys.stderr, "OS Binary verification failed"
- sys.exit(1)
+ if len(sig_file_list):
+ if not gpg_sig_pass:
+ print >> sys.stderr, "GPG signature verification failed. Aborting."
+ sys.exit(1)
- for hwpack in args.hwpacks:
- if not os.path.basename(hwpack) in verified_files:
- print >> sys.stderr, "Hwpack {0} verification failed".format(hwpack)
+ if not os.path.basename(args.binary) in verified_files:
+ print >> sys.stderr, "OS Binary verification failed"
sys.exit(1)
-
- for verified_file in verified_files:
- print 'Hash verification of file %s OK.' % verified_file
-
+
+ for hwpack in args.hwpacks:
+ if not os.path.basename(hwpack) in verified_files:
+ print >> sys.stderr, "Hwpack {0} verification failed".format(
+ hwpack)
+ sys.exit(1)
+
+ for verified_file in verified_files:
+ print 'Hash verification of file %s OK.' % verified_file
+
atexit.register(cleanup_tempdir)
media = Media(args.device)
if media.is_block_device:
@@ -154,8 +156,8 @@ if __name__ == '__main__':
lmc_dir = os.path.dirname(__file__)
if lmc_dir == '':
lmc_dir = None
- install_hwpacks(
- ROOTFS_DIR, TMP_DIR, lmc_dir, args.hwpack_force_yes, verified_files, *hwpacks)
+ install_hwpacks(ROOTFS_DIR, TMP_DIR, lmc_dir, args.hwpack_force_yes,
+ verified_files, *hwpacks)
if args.rootfs == 'btrfs':
install_packages(ROOTFS_DIR, TMP_DIR, "btrfs-tools")