Leonardo Sandoval | 98d2590 | 2020-05-24 19:50:27 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright (c) 2021, Arm Limited. All rights reserved. |
| 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
| 7 | |
| 8 | # Creates a 'tag' based on a fvp model (model). |
| 9 | # |
| 10 | # The script takes a single argument: the model tarball's filename (first argument) |
| 11 | # |
| 12 | |
| 13 | function usage() { |
| 14 | echo "Usage: $0 model-tarball" 1>&2 |
| 15 | exit 1 |
| 16 | } |
| 17 | |
| 18 | # Create a tag based a on fvp model |
| 19 | function create-tag() { |
| 20 | local model=$1 |
| 21 | local tag |
| 22 | |
| 23 | # get model basename |
| 24 | tag=$(basename $model) |
| 25 | |
| 26 | # remove any extension (tgz expected) |
| 27 | tag=${tag%.*} |
| 28 | |
| 29 | # finally lowercase |
| 30 | tag=${tag,,} |
| 31 | |
| 32 | echo $tag |
| 33 | } |
| 34 | |
| 35 | [ $# -ne 1 ] && usage |
| 36 | |
| 37 | tarball=$1; create-tag ${tarball} |