Leonardo Sandoval | 9dfdd1b | 2020-08-06 17:08:11 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 2 | # |
Leonardo Sandoval | 579c737 | 2020-10-23 15:23:32 -0500 | [diff] [blame] | 3 | # Copyright (c) 2019-2020 Arm Limited. All rights reserved. |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
| 7 | |
| 8 | # Given the name of the release (e.g., 18.04), this script downloads all |
| 9 | # Linaro release archives to the current directory, verifies, extracts, and |
| 10 | # finally removes the archive files. |
| 11 | |
| 12 | set -e |
| 13 | |
| 14 | # Download all ZIP files from the chosen Linaro release |
Zelalem | 1af7a7b | 2020-08-04 17:34:32 -0500 | [diff] [blame] | 15 | base="http://releases.linaro.org/members/arm/platforms/${1:?}" |
| 16 | |
| 17 | wget -q "$base/MD5SUMS" |
| 18 | |
| 19 | for file in $(awk '{print $2}' < MD5SUMS); do |
| 20 | wget "$base/$file" |
| 21 | done |
| 22 | |
| 23 | # Check files didn't get corrupted in the transfer |
| 24 | md5sum -c MD5SUMS |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 25 | |
| 26 | # Uncompress each ZIP file in its own directory (named after the ZIP file) |
| 27 | for zipfile in $(echo *.zip); do |
| 28 | echo |
| 29 | echo "Uncompressing file $zipfile" |
| 30 | |
Zelalem | 1af7a7b | 2020-08-04 17:34:32 -0500 | [diff] [blame] | 31 | directory_name="${zipfile%.zip}" |
| 32 | mkdir "$directory_name" |
| 33 | |
| 34 | cd "$directory_name" |
| 35 | unzip "../$zipfile" |
| 36 | cd - |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 37 | done |
| 38 | |
Zelalem | 1af7a7b | 2020-08-04 17:34:32 -0500 | [diff] [blame] | 39 | rm -rf *.zip *.xz *.gz |