aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils/uhd_images_downloader.py.in
Commit message (Collapse)AuthorAgeFilesLines
* uhd_images_downloader: Add environment variable for http authLane Kolbly2020-10-151-2/+31
| | | | | | | | | This allows the image downloader to download files from restricted sources using HTTP basic auth, specifying the credentials in the UHD_IMAGES_USER and UHD_IMAGES_PASSWORD environment variables: ``` UHD_IMAGES_USER=lane UHD_IMAGES_PASSWORD=MyS3cretPassword uhd_images_downloader.py ```
* uhd_images_downloader: Remove unused default_no parameterLane Kolbly2020-10-151-3/+2
| | | | | This parameter isn't used by any callers of the function. Additionally, it doesn't actually change the default answer.
* utils: Make uhd_images_downloader raise warning for invalid pathsSteve Czabaniuk2020-06-221-11/+21
| | | | | This makes the utility warn the user when they pass a path argument that is invalid; the utility falls back to defaults if this occurs.
* utils: Let uhd_images_downloader also use HTTPS proxiesMartin Braun2020-05-271-3/+4
| | | | | | This complements b721621. In that commit, we directly go to HTTPS, but in either case (direct or indirect) the --http-proxy command line argument did not use the proxy for https.
* Remove remaining Python 2 referencesMartin Braun2020-05-071-1/+0
| | | | | | | This changes two things in all applicable files: - Remove imports from __future__ - Change default shebangs from /usr/bin/env python to /usr/bin/env python3
* utils: uhd_images_downloader: use HTTPS instead of HTTP to avoid redirectMarcus Müller2020-03-201-1/+1
| | | | | | | | Since the webserver responding to requests at http://files.ettus.com replies with a redirect to the same URL, but using the https:// transport, this isn't only the safer thing we should be doing, anyways, but also the quicker, since it saves the user from one unnecessary redirect.
* utils: images downloader: Add support for UHD_IMAGES_URL, clean upMartin Braun2020-02-191-35/+29
| | | | | | - Remove Python2 compat hacks - Read the UHD_IMAGES_URL environment variable. If set, it overrides the default value for --base-url
* utils: images downloader: Handle missing content-length responseMartin Braun2020-02-191-7/+18
| | | | | | If the content-length header is not available, uhd_images_downloader will now ask the user if she wants to continue. Previously, the tool would throw an exception.
* utils: image_downloader: check write conditionssteviez2020-02-181-0/+13
| | | | | | | | | | Prior to downloading any images, check that the images destination: - Is a valid directory - Has valid permissions for images to be written Images are downloaded to a temporary location before being written to image destination, so these checks help avoid situation where images are downloaded but unable to be written
* utils: images_downloader: adding usage docsBrent Stapleton2020-01-221-2/+29
| | | | | Adding more details on uhd_images_downloader usage, as well as some technical details.
* utils: specify the downloader's Python executableBrent Stapleton2018-11-261-1/+1
| | | | | | | | | | Change the uhd_images_downloader's first line to execute with a runtime Python interpreter, as determined at UHD build time. Users can still use an arbitrary Python executable by calling `python uhd_images_downloader` This will fix our embedded products by ensuring that we call Python3 when running uhd_images_downloader in embedded mode.
* utils: uhd_images_downloader: Add --http-proxy optionMartin Braun2018-11-161-2/+11
| | | | | | | | | | | | This lets the user specify a HTTP proxy. The environment variable HTTP_PROXY is still usable, but --http-proxy will override it. Example: $ uhd_images_downloader \ --http-proxy http://user:pass@10.20.30.40:3128 \ -t x310 Here, the tool will download all the images matching 'x310' using a proxy at 10.20.30.40.
* utils: Fix downloader return value for main()Martin Braun2018-11-131-7/+11
| | | | | | This is effectively a refactoring: The main() function now returns True on success. This fixes a bug where one branch would simply return (None) instead of returning a value.
* utils: Downloader stall on error for Windows usersMartin Braun2018-11-131-2/+30
| | | | | | | | | If platform.system() is 'Windows', the Python script will stall on error before terminating, e.g., when an import is missing or when an unexpected Exception occurred during the execution. The rationale is that many Windows users run this script directly, without a shell, and wouldn't have a way to see error messages from the script in that case.
* utils: uhd_images_downloader: Remove archive typeMartin Braun2018-11-131-28/+22
| | | | | | | Since the uhd_images_downloader is so tightly integrated into our infrastructure, we've dropped support for .tar.gz and .tar.xz file for this particular purpose. Note that UHD releases still receive images in all three formats.
* utils: uhd_images_downloader: Refactor the toolMartin Braun2018-11-131-115/+153
| | | | | No functional changes. The main effort was to reduce the length of main() and reduce the number of Pylint warnings.
* utils: Allow downloader to ship non-zip filesMartin Braun2018-11-131-5/+13
| | | | | | Note: All archives shipped using this tool are zip files. However, this allows us to ship other types of files, which will be downloaded and sorted into the images directory as-is.
* utils: uhd_images_downloader: Add download limitMartin Braun2018-11-131-1/+25
| | | | | | | | | | | | | | This download limit prevents users from accidentally downloading really large files. The default limit is 100 MiB. When a file is selected for download that exceeds this size, the user is prompted if she really wants to download that file. By specifying --yes (or -y), this can can be bypassed. Example: $ uhd_images_downloader --yes -t sdimg Will match all files that match 'sdimg', which are typically larger than 100 MiB, without interaction.
* utils: uhd_images_downloader: Add --yes optionMartin Braun2018-11-131-0/+25
| | | | | | | | | This will answer 'yes' to all questions that are asked and allows to script the downloader. Example: $ uhd_images_downloader -t sdimg -y Any interaction that the script will have with the user will be skipped.
* utils: add downloader printing fetchable URLsMartin Braun2018-11-131-12/+24
| | | | | | | | | | | | | | Running $ uhd_images_downloader -l will now print the full URL of the target. By specifying $ uhd_images_downloader -l --url-only It will *only* print the URLs, nothing else, making this suitable for scripting. The list will always go to stdout, whereas the logging is going to stderr and thus can easily be siphoned off.
* utils: Make uhd_images_downloader log to stderrMartin Braun2018-11-131-2/+2
|
* uhd: utils: Add Zip test to downloaderBrent Stapleton2018-08-281-2/+15
| | | | | Users can supply the --test/-T option to test the downloaded archive before extracting it, using the Python zipfile.testzip() function.
* uhd: utils: Downloader logs no targets selectedBrent Stapleton2018-08-281-0/+5
| | | | | uhd_images_downloader: Adding INFO message when there is no target selected to download, as when the user misspells a target name.
* utils: fixup for downloader inventory managementBrent Stapleton2018-08-211-12/+19
| | | | | | | | uhd_images_downloader was mismanaging the image inventory- image packages entries were not being deleted when the images were overwritten. Now, each target is saved as a single entry in the inventory, which is overwritten when a new image package is downloaded.
* utils: downloader supports multiple RegExsBrent Stapleton2018-03-161-6/+9
| | | | | | | | | | | | uhd_images_downloader now accepts multiple '--types' options, each of which is a RegEx. Targets which match to all of the provided `types` are downloaded. Example usage: `uhd_images_downloader -t n3xx -t fpga` will match the following targets: - n3xx_n310_fpga_default - n3xx_n310_fpga_aurora - n3xx_n300_fpga_default
* utils: Adding option to skip SHA in downloaderBrent Stapleton2018-03-161-7/+12
| | | | | | Targets in the manifest with SHA256 values of '0' will not be verified. This will allow us to skip the verification for certain image packages (ie. the filesystem).
* utils: fixup for downloader SHA256 checkBrent Stapleton2018-03-161-2/+7
| | | | The image package is not unzipped or kept if the SHA256 checksum fails
* utils: Skip progress bars for non-tty outputsMartin Braun2018-03-011-1/+5
|
* utils: Reenable UHD_IMAGES_DIR env var for uhd_images_downloaderMartin Braun2018-03-011-3/+11
| | | | | | This was forgotten in the transition to the new downloader. The command line options --install-location will still override the env variable if it exists.
* utils: Increase verbosity on uhd_images_downloaderMartin Braun2018-03-011-6/+4
|
* uhd: Update license headersMartin Braun2018-02-191-1/+1
| | | | | | | All copyright is now attributed to "Ettus Research, a National Instruments company". SPDX headers were also updated to latest version 3.0.
* utils: images downloader: adding SHA256 supportBrent Stapleton2018-02-151-6/+15
| | | | | Adding SHA256 checking for downloaded image archives. The expected SHA is read from the manifest, and checked after the download completes.
* utils: images downloader: adding --keep supportBrent Stapleton2018-02-151-4/+6
| | | | | When users supply the --keep argument, image archives are saved in the images directory alongside the image files.
* utils: images downloader: default download printBrent Stapleton2018-02-071-3/+5
| | | | | | | | Adding a message at the INFO log level (the default) to tell users that downloads have begun. Also added the filename being downloaded to the progress bars. Reviewed-by: Martin Braun <martin.braun@ettus.com>
* utils: images downloader: adding dry run optionBrent Stapleton2018-02-031-17/+23
| | | | | | Command line argument --dry-run is now available. This runs through the downloader without actually downloading any files or editing the inventory file.
* utils: refactor uhd_images_downloaderBrent Stapleton2018-01-231-333/+324
| | | | | | | | | | | | | | | | | Changing structure of the files.ettus.com images directory, and updating uhd_images_downloader correspondingly. The images downloader now downloads a number of smaller archives of images, instead of one large archive containing all of our images. Furthermore, the images downloader maintains an inventory of currently installed images, so that images are not redownloaded unnecessarily. When called with no arguments, behavior should not change. CMake variables are used to populate a number of fields in the images downloader, including the contents of the manifest file. Reviewed-by: Martin Braun <martin.braun@ettus.com> Reviewed-by: Ashish Chaudhari <ashish.chaudhari@ettus.com>
* Move all license headers to SPDX format.Martin Braun2017-12-221-12/+1
|
* utils: Added warnings and checks to images downloaderDerek Kozel2017-07-171-0/+14
|
* utils: use vt100 terminal codes in uhd_images_downloaderAndrej Rode2017-01-031-1/+5
|
* utils: Added pre-API change python request compatibilityMarcus Müller2015-10-191-1/+5
| | | | | | Affects the uhd_images_downloader utility. Older versions of requests didn't know the "stream" kwarg. Added a compatibility fallback.
* utils: Made uhd_images_downloader Python3-compatibleMartin Braun2015-07-151-84/+77
|
* imgs_downloader: Copy pkg to temp dir even if it is localAshish Chaudhari2015-03-181-3/+4
|
* utils: Minor fixes in images downloader and packaging scriptsAshish Chaudhari2014-10-271-0/+3
|
* Adding explicit positional arguments to .format strings for compatibility ↵Patrick Sisterhen2014-10-161-6/+6
| | | | with older Pythons
* utils: Small fix to uhd_images_downloader, less warningsMartin Braun2014-10-131-2/+1
|
* uhd: uhd_images_downloader now respects $UHD_IMAGES_BASE_URLMartin Braun2014-10-061-115/+126
|
* uhd: re-wrote uhd_images_downloader (OO, new options, hopefully much more ↵Balint Seeber2013-11-221-119/+316
| | | | robust and user-friendly)
* uhd_images_downloader: more descriptive error when MD5 check failsNicholas Corgan2013-11-191-0/+2
|
* uhd_images_downloader: redundancy fixes, better error handlingNicholas Corgan2013-11-131-12/+14
|
* uhd_images_downloader: more improvements/fixesNicholas Corgan2013-11-081-14/+24
| | | | | * Better error handling * Improved default download location logic