From ff954c5b73c4010f9984e0c543779f3692767c0c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 27 May 2023 11:44:54 +0100 Subject: unify download/build scripts move resources/scripts/download/ to: resources/scripts/update/module/ This: ./download coreboot Is now: ./update module coreboot However, running "./download coreboot" still works, via backwards compatibility. Signed-off-by: Leah Rowe --- download | 107 +-------------------------------------------------------------- 1 file changed, 1 insertion(+), 106 deletions(-) mode change 100755 => 120000 download (limited to 'download') diff --git a/download b/download deleted file mode 100755 index e2dbfc9b..00000000 --- a/download +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env bash - -# Generic script for downloading programs used by the build system -# -# Copyright (C) 2014,2015,2020,2021,2023 Leah Rowe -# Copyright (C) 2015 Patrick "P. J." McDermott -# Copyright (C) 2015, 2016 Klemens Nanni -# Copyright (C) 2022 Caleb La Grange -# Copyright (C) 2022 Alper Nebi Yasak -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -[ "x${DEBUG+set}" = 'xset' ] && set -v -set -u -e - -download=resources/scripts/download -program="" - -main() -{ - ./.gitcheck - ./resources/scripts/misc/versioncheck - - rm -f "build_error" - - if [ $# -lt 1 ]; then - help - die "Please specify arguments." - fi - - program="${1}" - shift 1 - - if [ "${program}" = help ]; then - help - exit 0 - elif [ "${program}" = "all" ]; then - for downloadProgram in ${download}/*; do - if [ ! -f "${downloadProgram}" ]; then - continue - fi - "${downloadProgram}" - done - exit 0 - elif [ ! -f "${download}/${program}" ]; then - help - die "Invalid argument '${program}'. See: './download help'." - elif [ $# -lt 1 ]; then - "${download}/${program}" - else - "${download}/${program}" $@ - fi - - ./.gitcheck clean -} - -help() { - cat <<- EOF - USAGE: ./download - - possible values for 'program': - $(listprograms) - - Example: ./download flashrom - Example: ./download coreboot - - Some program options allow for additional parameters: - Example: ./download coreboot default - Example: ./download coreboot x60 - - Each program download script should work without extra paramaters, but - they can be used. For example, './download coreboot' will download all - coreboot trees by default, but './download coreboot x60' will only - download the coreboot tree required for the target: x60 - - Each program download script should also accept the --help parameter to - display the usage of the script. - - Refer to the documentation for more information. - EOF -} - -listprograms() { - for program in "${download}"/*; do - printf '%s\n' "${program##*/}" - done -} - -die() { - printf 'Error: %s\n' "${@}" 1>&2 - exit 1 -} - -main $@ diff --git a/download b/download new file mode 120000 index 00000000..012b4ec0 --- /dev/null +++ b/download @@ -0,0 +1 @@ +lbmk \ No newline at end of file -- cgit v1.2.1