blob: bed65964800adbb37e25822dda19fc81aa970852 [file] [log] [blame]
Leonardo Sandoval9dfdd1b2020-08-06 17:08:11 -05001#!/usr/bin/env bash
Fathi Boudra422bf772019-12-02 11:10:16 +02002#
3# Copyright (c) 2019, Arm Limited. All rights reserved.
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
12set -e
13
14# Download all ZIP files from the chosen Linaro release
Zelalem1af7a7b2020-08-04 17:34:32 -050015base="http://releases.linaro.org/members/arm/platforms/${1:?}"
16
17wget -q "$base/MD5SUMS"
18
19for file in $(awk '{print $2}' < MD5SUMS); do
20 wget "$base/$file"
21done
22
23# Check files didn't get corrupted in the transfer
24md5sum -c MD5SUMS
Fathi Boudra422bf772019-12-02 11:10:16 +020025
26# Uncompress each ZIP file in its own directory (named after the ZIP file)
27for zipfile in $(echo *.zip); do
28 echo
29 echo "Uncompressing file $zipfile"
30
Zelalem1af7a7b2020-08-04 17:34:32 -050031 directory_name="${zipfile%.zip}"
32 mkdir "$directory_name"
33
34 cd "$directory_name"
35 unzip "../$zipfile"
36 cd -
Fathi Boudra422bf772019-12-02 11:10:16 +020037done
38
Zelalem1af7a7b2020-08-04 17:34:32 -050039rm -rf *.zip *.xz *.gz