Returns True if it is, false otherwise
"""
if not os.environ.get("BUILDDIR"):
- print "BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)"
+ print("BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)")
sys.exit(1)
return True
desc = line[idx + len("short-description:"):].strip()
break
basename = os.path.splitext(fname)[0]
- print " %s\t\t%s" % (basename.ljust(30), desc)
+ print(" %s\t\t%s" % (basename.ljust(30), desc))
def list_canned_image_help(scripts_path, fullpath):
if not found:
idx = line.find("long-description:")
if idx != -1:
- print
- print line[idx + len("long-description:"):].strip()
+ print()
+ print(line[idx + len("long-description:"):].strip())
found = True
continue
if not line.strip():
break
idx = line.find("#")
if idx != -1:
- print line[idx + len("#:"):].rstrip()
+ print(line[idx + len("#:"):].rstrip())
else:
break
plugins = pluginmgr.get_source_plugins()
for plugin in plugins:
- print " %s" % plugin
+ print(" %s" % plugin)
def wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir,
try:
oe_builddir = os.environ["BUILDDIR"]
except KeyError:
- print "BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)"
+ print("BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)")
sys.exit(1)
if debug:
crobj.main(["direct", native_sysroot, kernel_dir, bootimg_dir, rootfs_dir,
wks_file, image_output_dir, oe_builddir, compressor or ""])
- print "\nThe image(s) were created using OE kickstart file:\n %s" % wks_file
+ print("\nThe image(s) were created using OE kickstart file:\n %s" % wks_file)
def wic_list(args, scripts_path):
wks_file = args[0]
fullpath = find_canned_image(scripts_path, wks_file)
if not fullpath:
- print "No image named %s found, exiting. "\
+ print("No image named %s found, exiting. "\
"(Use 'wic list images' to list available images, or "\
"specify a fully-qualified OE kickstart (.wks) "\
- "filename)\n" % wks_file
+ "filename)\n" % wks_file)
sys.exit(1)
list_canned_image_help(scripts_path, fullpath)
return True
# AUTHORS
# Tom Zanussi <tom.zanussi (at] linux.intel.com>
#
+from __future__ import print_function
__version__ = "0.2.0"
if not val:
missed.append(opt)
if missed:
- print "The following build artifacts are not specified:"
- print " " + ", ".join(missed)
+ print("The following build artifacts are not specified:")
+ print(" " + ", ".join(missed))
sys.exit(1)
if options.image_name:
BB_VARS.vars_dir = options.vars_dir
if options.build_check:
- print "Checking basic build environment..."
+ print("Checking basic build environment...")
if not engine.verify_build_env():
- print "Couldn't verify build environment, exiting\n"
+ print("Couldn't verify build environment, exiting\n")
sys.exit(1)
else:
- print "Done.\n"
+ print("Done.\n")
bootimg_dir = ""
if options.debug:
argv.append("--debug")
- print "Building rootfs...\n"
+ print("Building rootfs...\n")
if bitbake_main(BitBakeConfigParameters(argv),
cookerdata.CookerConfiguration()):
sys.exit(1)
options.image_name)
else:
if options.build_rootfs:
- print "Image name is not specified, exiting. (Use -e/--image-name to specify it)\n"
+ print("Image name is not specified, exiting. (Use -e/--image-name to specify it)\n")
sys.exit(1)
wks_file = args[0]
if not wks_file.endswith(".wks"):
wks_file = engine.find_canned_image(scripts_path, wks_file)
if not wks_file:
- print "No image named %s found, exiting. (Use 'wic list images' "\
+ print("No image named %s found, exiting. (Use 'wic list images' "\
"to list available images, or specify a fully-qualified OE "\
- "kickstart (.wks) filename)\n" % args[0]
+ "kickstart (.wks) filename)\n" % args[0])
sys.exit(1)
image_output_dir = ""
kernel_dir = options.kernel_dir
native_sysroot = options.native_sysroot
if rootfs_dir and not os.path.isdir(rootfs_dir):
- print "--roofs-dir (-r) not found, exiting\n"
+ 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"
+ 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"
+ 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"
+ print("--native-sysroot (-n) not found, exiting\n")
sys.exit(1)
else:
not_found = not_found_dir = ""
if not_found:
if not not_found_dir:
not_found_dir = "Completely missing artifact - wrong image (.wks) used?"
- print "Build artifacts not found, exiting."
- print " (Please check that the build artifacts for the machine"
- print " selected in local.conf actually exist and that they"
- print " are the correct artifacts for the image (.wks file)).\n"
- print "The artifact that couldn't be found was %s:\n %s" % \
- (not_found, not_found_dir)
+ print("Build artifacts not found, exiting.")
+ print(" (Please check that the build artifacts for the machine")
+ print(" selected in local.conf actually exist and that they")
+ print(" are the correct artifacts for the image (.wks file)).\n")
+ print("The artifact that couldn't be found was %s:\n %s" % \
+ (not_found, not_found_dir))
sys.exit(1)
krootfs_dir = options.rootfs_dir
rootfs_dir = rootfs_dir_to_args(krootfs_dir)
- print "Creating image(s)...\n"
+ print("Creating image(s)...\n")
engine.wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir,
native_sysroot, scripts_path, image_output_dir,
options.compressor, options.debug)
try:
sys.exit(main(sys.argv[1:]))
except WicError as err:
- print >> sys.stderr, "ERROR:", err
+ print("ERROR:", err, file=sys.stderr)
sys.exit(1)