def main(): " Go, go, go! " args = parse_args() img_root_dir = os.path.join(uhdimgs.get_images_dir(), 'images') os.chdir(uhdimgs.get_images_dir()) print "== Clearing out the images directory..." clear_img_dir(img_root_dir) print "== Creating ZIP file..." cpack_cmd = ["./make_zip.sh",] if args.release_mode is not None: cpack_cmd.append(args.release_mode) try: cpack_output = subprocess.check_output(cpack_cmd) except subprocess.CalledProcessError as e: print e.output raise SystemExit, 1 zipfilename = get_zipfilename_from_cpack_output(cpack_output) print "Filename: ", zipfilename print "== Calculating MD5 sum of ZIP archive..." md5 = uhdimgs.md5_checksum(zipfilename) print 'MD5: ', md5 base_url = uhdimgs.get_base_url() if uhdimgs.base_url_is_local(base_url) and os.access(base_url, os.W_OK): print "== Moving ZIP file to {0}...".format(base_url) move_zip_to_repo(base_url, zipfilename) print "== Updating CMakeLists.txt..." uhdimgs.update_main_cmake_file(md5, zipfilename) if args.commit is not None: print "== Committing changes..." subprocess.check_call(['git', 'commit', '-m', args.commit, uhdimgs.get_cmake_main_file()]) print "== Done!"
def main(): " Go, go, go! " # Switch to correct dir img_root_dir = os.path.join(uhdimgs.get_images_dir(), "images") os.chdir(uhdimgs.get_images_dir()) # Read out the CMakeLists.txt file, get filename print "== Reading MD5 and ZIP filename for current commit from {0}...".format(uhdimgs.get_cmake_main_file()) (md5, filename) = get_md5_and_zipfilename() print "== Starting download..." try: downloader_cmd = [ "python", "../host/utils/uhd_images_downloader.py.in", "-i", img_root_dir, "-f", filename, "-c", md5, ] subprocess.check_call(downloader_cmd) except (subprocess.CalledProcessError, OSError): print "[ERROR] Failed to run downloader script." exit(1) print "== Done!"
def main(): " Go, go, go! " # Switch to correct dir img_root_dir = os.path.join(uhdimgs.get_images_dir(), 'images') os.chdir(uhdimgs.get_images_dir()) print "== Starting download..." try: downloader_cmd = [ 'python', '../host/utils/uhd_images_downloader.py.in', '-i', img_root_dir, '-m', 'manifest.txt' ] subprocess.check_call(downloader_cmd) except (subprocess.CalledProcessError, OSError): print "[ERROR] Failed to run downloader script." exit(1) print "== Done!"
def download_images(img_root_dir=None): " Go, go, go! " # Switch to correct dir img_root_dir = img_root_dir or os.path.join(uhdimgs.get_images_dir(), 'images') if not os.path.isdir(img_root_dir): print("== Creating images directory...") os.mkdir(img_root_dir) os.chdir(uhdimgs.get_images_dir()) print("== Starting download...") try: downloader_cmd = [ 'python', '../host/utils/uhd_images_downloader.py.in', '-i', img_root_dir, '-m', 'manifest.txt' ] subprocess.check_call(downloader_cmd) except (subprocess.CalledProcessError, OSError): print("[ERROR] Failed to run downloader script.") exit(1) print("== Done!")
def main(): " Go, go, go! " # Switch to correct dir img_root_dir = os.path.join(uhdimgs.get_images_dir(), 'images') os.chdir(uhdimgs.get_images_dir()) # Read out the CMakeLists.txt file, get filename print "== Reading MD5 and ZIP filename for current commit from {0}...".format( uhdimgs.get_cmake_main_file()) (md5, filename) = get_md5_and_zipfilename() print "== Starting download..." try: downloader_cmd = [ 'python', '../host/utils/uhd_images_downloader.py.in', '-i', img_root_dir, '-f', filename, '-c', md5 ] subprocess.check_call(downloader_cmd) except (subprocess.CalledProcessError, OSError): print "[ERROR] Failed to run downloader script." exit(1) print "== Done!"
def main(): " Go, go, go! " args = parse_args() img_root_dir = os.path.join(uhdimgs.get_images_dir(), 'images') os.chdir(uhdimgs.get_images_dir()) print "== Clearing out the images directory..." clear_img_dir(img_root_dir) print "== Creating archives..." cpack_cmd = [ "./make_zip.sh", ] cpack_cmd.append(args.release_mode) if args.patch is not None: cpack_cmd.append("-DUHD_PATCH_OVERRIDE={}".format(args.patch)) try: cpack_output = subprocess.check_output(cpack_cmd) except subprocess.CalledProcessError as e: print e.output raise SystemExit, 1 zipfilename = get_zipfilename_from_cpack_output(cpack_output) print "Filename: ", zipfilename print "== Calculating MD5 sum of ZIP archive..." md5 = uhdimgs.md5_checksum(zipfilename) print 'MD5: ', md5 base_url = uhdimgs.get_base_url() if not args.skip_move and uhdimgs.base_url_is_local( base_url) and os.access(base_url, os.W_OK): print "== Moving ZIP file to {0}...".format(base_url) move_zip_to_repo(base_url, zipfilename) print "== Updating CMakeLists.txt..." uhdimgs.update_main_cmake_file(md5, zipfilename) if args.commit is not None: print "== Committing changes..." subprocess.check_call([ 'git', 'commit', '-m', args.commit, uhdimgs.get_cmake_main_file() ]) print "== Done!"
def main(): """ Go, go, go! """ args = parse_args() img_root_dir = os.path.join(uhdimgs.get_images_dir(), 'images') print("== Clearing out the images directory...") shutil.rmtree(img_root_dir) print("== Downloading images...") download_images(img_root_dir) print("== Determining version...") version = args.version if args.version is not None else get_version() print("Version string: {}".format(version)) print("== Creating archives...") archive_cmd = ["./make_zip.sh", version] try: subprocess.call(archive_cmd) except subprocess.CalledProcessError as ex: print(ex.output) exit(1) print("== Done!")