From 553b5e3b59972931b5f055a5cab8ea67479d954b Mon Sep 17 00:00:00 2001 From: Tommi Vainikainen Date: Mon, 6 Jul 2020 21:24:56 +0300 Subject: [PATCH] Remove chakracore config leftovers where subdir had versions --- functions.sh | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/functions.sh b/functions.sh index 5f37f352..be9c5753 100755 --- a/functions.sh +++ b/functions.sh @@ -46,10 +46,10 @@ function get_arch() { } # Get corresponding variants based on the architecture. -# All supported variants of each supported architecutre are listed in a +# All supported variants of each supported architecture are listed in a # file - 'architectures'. Its format is: -# ,... -# ,... +# ,... +# ,... function get_variants() { local dir dir=${1:-.} @@ -133,33 +133,17 @@ function get_config() { # Get available versions for a given path # -# If full or partial versions are provided then they are processed and -# validated. e.g. "6 chakracore" returns "6 chakracore/8" since it processed the -# chakracore entry and found it to be a fork rather than a complete version. -# # The result is a list of valid versions. function get_versions() { - local prefix - prefix=${1:-.} - shift - local versions=() - local dirs=("$@") + local dirs=() local default_variant default_variant=$(get_config "./" "default_variant") - if [ ${#dirs[@]} -eq 0 ]; then - IFS=' ' read -ra dirs <<< "$(echo "${prefix%/}/"*/)" - fi + IFS=' ' read -ra dirs <<< "$(echo "./"*/)" for dir in "${dirs[@]}"; do - if [ -a "${dir}/config" ]; then - local subdirs - IFS=' ' read -ra subdirs <<< "$(get_versions "${dir#./}")" - for subdir in "${subdirs[@]}"; do - versions+=("${subdir}") - done - elif [ -a "${dir}/Dockerfile" ] || [ -a "${dir}/${default_variant}/Dockerfile" ]; then + if [ -a "${dir}/Dockerfile" ] || [ -a "${dir}/${default_variant}/Dockerfile" ]; then versions+=("${dir#./}") fi done