aboutsummaryrefslogtreecommitdiffstats
path: root/images/populate_images.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2021-12-17 14:04:58 +0100
committerAaron Rossetto <aaron.rossetto@ni.com>2021-12-17 11:18:53 -0600
commit30b157e4cf12dfe7e8a174548d8cfddd64d47c42 (patch)
tree77e2153225412f15b6a6cd66382997ed549c4d8a /images/populate_images.py
parentc369b7046e1687bdb7b67a0fae2f1168f0088783 (diff)
downloaduhd-30b157e4cf12dfe7e8a174548d8cfddd64d47c42.tar.gz
uhd-30b157e4cf12dfe7e8a174548d8cfddd64d47c42.tar.bz2
uhd-30b157e4cf12dfe7e8a174548d8cfddd64d47c42.zip
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.
Diffstat (limited to 'images/populate_images.py')
-rwxr-xr-ximages/populate_images.py16
1 files changed, 11 insertions, 5 deletions
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__":