From 30b157e4cf12dfe7e8a174548d8cfddd64d47c42 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 17 Dec 2021 14:04:58 +0100 Subject: images: Clear out code from days of yore The images/ subdir is used to create images packages for release tags. However, it contained a lot of code from many releases ago, prior to the usage of the cache/ directory. This simply removes all the old code that is no longer required for creating release packages. --- images/populate_images.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'images/populate_images.py') diff --git a/images/populate_images.py b/images/populate_images.py index cd95c2086..f54ca8b9d 100755 --- a/images/populate_images.py +++ b/images/populate_images.py @@ -10,19 +10,25 @@ Populates the current directory with a valid set of binaries for the current commit. """ -from __future__ import print_function import os +import sys import subprocess -import uhdimgs + +def get_images_dir(): + """ + Returns the absolute position of the images/ subdir + in the UHD source tree. + """ + return os.path.dirname(__file__) 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') + img_root_dir = img_root_dir or os.path.join(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()) + os.chdir(get_images_dir()) print("== Starting download...") try: downloader_cmd = [ @@ -34,7 +40,7 @@ def download_images(img_root_dir=None): subprocess.check_call(downloader_cmd) except (subprocess.CalledProcessError, OSError): print("[ERROR] Failed to run downloader script.") - exit(1) + sys.exit(1) print("== Done!") if __name__ == "__main__": -- cgit v1.2.3