From a942bd6590dd450140fc0af8549ca470a065adf5 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 17 Mar 2023 23:08:12 +0000 Subject: move download/gitmodule script to root directory this fixes the build error: Error: name not set Usage: ./download gitmodule [name] when running: ./download all running "all" runs all scripts under downloads, one of which was the gitmodule script itself, therefore being run without argument --- resources/git/revisions | 2 +- resources/scripts/download/flashrom | 2 +- resources/scripts/download/gitmodule | 90 -------------------------------- resources/scripts/download/grub | 4 +- resources/scripts/download/ich9utils | 2 +- resources/scripts/download/me_cleaner | 2 +- resources/scripts/download/memtest86plus | 2 +- resources/scripts/download/seabios | 2 +- 8 files changed, 8 insertions(+), 98 deletions(-) delete mode 100755 resources/scripts/download/gitmodule (limited to 'resources') diff --git a/resources/git/revisions b/resources/git/revisions index 7eaa5770..34cc322d 100644 --- a/resources/git/revisions +++ b/resources/git/revisions @@ -3,7 +3,7 @@ # Project name is enclosed by curly braces '{}' information about the # project relevant to osbmk is stored between the subsequent curly # braces. This file is used by the gitcheck script as well as the -# gitmodule script. Each entry must include: revision 'rev', location +# gitclone script. Each entry must include: revision 'rev', location # 'loc', and the git url 'url'. Bkup_url is optional. {grub}{ diff --git a/resources/scripts/download/flashrom b/resources/scripts/download/flashrom index e165031d..def33ffb 100755 --- a/resources/scripts/download/flashrom +++ b/resources/scripts/download/flashrom @@ -21,4 +21,4 @@ [ "x${DEBUG+set}" = 'xset' ] && set -v set -u -e -./download gitmodule flashrom +./gitclone flashrom diff --git a/resources/scripts/download/gitmodule b/resources/scripts/download/gitmodule deleted file mode 100755 index 603961e4..00000000 --- a/resources/scripts/download/gitmodule +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env sh - -# SPDX-FileCopyrightText: 2022 Caleb La Grange -# SPDX-FileCopyrightText: 2022 Ferass El Hafidi -# SPDX-License-Identifier: GPL-3.0-only - -Print_help(){ - cat <<- EOF - Usage: ./download gitmodule [name] - - Options: - name: The name of the module as specified in resources/git/revisions file - EOF -} - -Fail(){ - printf "${@}\n" - Print_help - exit 1 -} - -Check_vars(){ - if [ -z "${revision+x}" ]; then - Fail 'Error: revision not set' - fi - if [ -z "${location+x}" ]; then - Fail 'Error: location not set' - fi - if [ -z "${url+x}" ]; then - Fail 'Error: url not set' - fi -} - -Patch(){ - for patchfile in ${PWD}/${patchdir}/*.patch ; do - ( cd ${tmp_dir} - git am ${patchfile} || return 1 - ) - done -} - -Run(){ - git clone ${url} ${tmp_dir} || git clone ${bkup_url} ${tmp_dir} || Fail "ERROR: couldn't download ${name}\n Check Network connection" - ( cd ${tmp_dir} && git reset --hard ${revision} ) - patchdir="resources/${name}/patches" - - if [ -d "${patchdir}" ]; then - Patch || Fail "ERROR: Faild to patch ${name}" - fi - - mv ${tmp_dir} ${location} || Fail "ERROR: couldn't copy temp to destination\n ${tmp_dir} > ${location} check permissions" -} - -if [ -z "${1+x}" ]; then - Fail 'Error: name not set' -else - name=${1} -fi - -while read -r line ; do - set ${line} >/dev/null 2>&1 - case ${line} in - rev:*) - revision=${2} - ;; - loc:*) - location=${2} - ;; - url:*) - url=${2} - ;; - bkup_url:*) - bkup_url=${2} - ;; - esac -done << EOF -$(eval "awk ' /\{.*${name}.*}{/ {flag=1;next} /\}/{flag=0} flag { print }' resources/git/revisions") -EOF -Check_vars -tmp_dir=$(mktemp -dt "${name}_XXXXX") - -# clean out old version just in case -if [ -d "${location}" ]; then - rm -rf ${location} -fi - -Run - -# clean in case of failure -rm -rf ${tmp_dir} >/dev/null 2>&1 diff --git a/resources/scripts/download/grub b/resources/scripts/download/grub index 1d59ad09..5d0c1aad 100755 --- a/resources/scripts/download/grub +++ b/resources/scripts/download/grub @@ -21,5 +21,5 @@ [ "x${DEBUG+set}" = 'xset' ] && set -v set -u -e -./download gitmodule grub -./download gitmodule gnulib +./gitclone grub +./gitclone gnulib diff --git a/resources/scripts/download/ich9utils b/resources/scripts/download/ich9utils index 2e11fac1..3f764e72 100755 --- a/resources/scripts/download/ich9utils +++ b/resources/scripts/download/ich9utils @@ -22,4 +22,4 @@ set -u -e printf "Downloading ich9utils\n" -./download gitmodule ich9utils +./gitclone ich9utils diff --git a/resources/scripts/download/me_cleaner b/resources/scripts/download/me_cleaner index bb26a000..93173257 100755 --- a/resources/scripts/download/me_cleaner +++ b/resources/scripts/download/me_cleaner @@ -22,4 +22,4 @@ [ "x${DEBUG+set}" = 'xset' ] && set -v set -u -e -./download gitmodule me_cleaner +./gitclone me_cleaner diff --git a/resources/scripts/download/memtest86plus b/resources/scripts/download/memtest86plus index 0e01b3a0..e4106f38 100755 --- a/resources/scripts/download/memtest86plus +++ b/resources/scripts/download/memtest86plus @@ -29,4 +29,4 @@ set -u -e # ------------------------------------------------------------------------------ printf "Downloading MemTest86+\n" -./download gitmodule memtest86plus +./gitclone memtest86plus diff --git a/resources/scripts/download/seabios b/resources/scripts/download/seabios index f441986f..666c32ae 100755 --- a/resources/scripts/download/seabios +++ b/resources/scripts/download/seabios @@ -26,4 +26,4 @@ set -u -e printf "Downloading SeaBIOS\n" -./download gitmodule seabios +./gitclone seabios -- cgit v1.2.1