Verified Commit 9a5acdde authored by Alberto Miranda's avatar Alberto Miranda ♨️
Browse files

dep_scripts: Fix bug passing multiple args to git clone

parent 1b2b225b
Loading
Loading
Loading
Loading
+17 −11
Original line number Diff line number Diff line
@@ -247,11 +247,12 @@ clonedeps() {
    fi
    trap exit_child EXIT

    local FOLDER=$1
    local REPO=$2
    local COMMIT=$3
    local GIT_FLAGS=$4
    local PATCH=$5
    local FOLDER="$1"
    local REPO="$2"
    local COMMIT="$3"
    local PATCH="$4"
    shift 4
    local GIT_FLAGS=("$@")

    local ACTION

@@ -259,12 +260,12 @@ clonedeps() {
        [[ "$DRY_RUN" == true ]] || (cd "${SOURCE_DIR}/${FOLDER}" && git fetch -q)
        ACTION="Pulled"
    else
        [[ "$DRY_RUN" == true ]] || (git clone ${COMMON_GIT_FLAGS} ${GIT_FLAGS} -- "${REPO}" "${SOURCE_DIR}/${FOLDER}")
        [[ "$DRY_RUN" == true ]] || (git clone ${COMMON_GIT_FLAGS} "${GIT_FLAGS[@]}" -- "${REPO}" "${SOURCE_DIR}/${FOLDER}")
        ACTION="Cloned"
    fi
    # fix the version
    [[ "$DRY_RUN" == true ]] || (cd "${SOURCE_DIR}/${FOLDER}" && git checkout -qf "${COMMIT}")
    echo "${ACTION} '${REPO}' to '${FOLDER}' with commit '[${COMMIT}]' and flags '${GIT_FLAGS}'"
    echo "${ACTION} '${REPO}' to '${FOLDER}' with commit '[${COMMIT}]' and flags '${GIT_FLAGS[@]}'"

    # apply patch if provided
    if [[ -n "${PATCH}" ]]; then
@@ -519,7 +520,7 @@ for dep_name in "${PROFILE_DEP_LIST[@]}"; do

    elif [[ ! -z "${PROFILE_CLONEDEPS[${dep_name}]:-}" ]]; then

        dep_args=""
        dep_args=()

        # find required version for dependency
        dep_version="${PROFILE_CLONEDEPS[${dep_name}]}"
@@ -527,7 +528,7 @@ for dep_name in "${PROFILE_DEP_LIST[@]}"; do
        # version may be a commit hash, a tag or something like HEAD@BRANCH_NAME
        # if it's the latter, remove the @BRANCH_NAME
        if [[ "${dep_version}" =~ ^(.*)@(.*)$ ]]; then
            dep_args+="-b ${BASH_REMATCH[2]}"
            dep_args+=("--branch=${BASH_REMATCH[2]}")
            dep_version=${BASH_REMATCH[1]}
        fi

@@ -543,11 +544,16 @@ for dep_name in "${PROFILE_DEP_LIST[@]}"; do
        dep_url="${dep_url/\{\{VERSION\}\}/${dep_version}}"

        # check if extra args are required
        dep_args+="${PROFILE_CLONEDEPS_ARGS[${dep_name}]}"
        for arg in "${PROFILE_CLONEDEPS_ARGS[${dep_name}]}";
        do
            if [[ -n "${arg}" ]]; then
                dep_args+=("${arg}")
            fi
        done

        dep_patch=${PROFILE_CLONEDEPS_PATCHES[${dep_name}]}

        clonedeps "${dep_name}" "${dep_url}" "${dep_version}" "${dep_args}" "${dep_patch}" &
        clonedeps "${dep_name}" "${dep_url}" "${dep_version}" "${dep_patch}" "${dep_args[@]}" &

    else
        echo "Unknown dependency '${dep_name}'."
+2 −2
Original line number Diff line number Diff line
@@ -3,12 +3,12 @@ Downloaded 'https://github.com/google/snappy/archive/1.1.7.tar.gz' to 'snappy'
Downloaded 'https://github.com/aquynh/capstone/archive/4.0.1.tar.gz' to 'capstone'
Cloned 'https://github.com/radix-io/bmi/' to 'bmi' with commit '[6ea0b78fce1b964e45102828cdd05df7040a94c8]' and flags ''
Downloaded 'https://sourceforge.net/projects/bzip2/files/bzip2-1.0.6.tar.gz' to 'bzip2'
Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric' with commit '[HEAD]' and flags '-b v1.8.1'
Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric' with commit '[HEAD]' and flags '--branch=v1.8.1'
Downloaded 'https://github.com/lz4/lz4/archive/v1.8.0.tar.gz' to 'lz4'
Cloned 'https://github.com/mercury-hpc/mercury' to 'mercury' with commit '[41caa143a07ed179a3149cac4af0dc7aa3f946fd]' and flags '--recurse-submodules'
Cloned 'https://xgitlab.cels.anl.gov/sds/margo.git' to 'margo' with commit '[v0.6.3]' and flags ''
Downloaded 'https://github.com/facebook/rocksdb/archive/v6.2.2.tar.gz' to 'rocksdb'
Cloned 'https://github.com/pmem/syscall_intercept.git' to 'syscall_intercept' with commit '[f7cebb7b7e7512a19b78a31ce236ad6ca22636dd]' and flags ''
Cloned 'https://github.com/HowardHinnant/date.git' to 'date' with commit '[e7e1482087f58913b80a20b04d5c58d9d6d90155]' and flags ''
Cloned 'https://github.com/francielizanon/agios.git' to 'agios' with commit '[c26a6544200f823ebb8f890dd94e653d148bf226]' and flags '-b development'
Cloned 'https://github.com/francielizanon/agios.git' to 'agios' with commit '[c26a6544200f823ebb8f890dd94e653d148bf226]' and flags '--branch=development'
Downloaded 'https://github.com/pmodels/argobots/archive/v1.0rc1.tar.gz' to 'argobots'
+2 −2
Original line number Diff line number Diff line
Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric' with commit '[HEAD]' and flags '-b v1.8.1'
Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric' with commit '[HEAD]' and flags '--branch=v1.8.1'
Cloned 'https://github.com/mercury-hpc/mercury' to 'mercury' with commit '[41caa143a07ed179a3149cac4af0dc7aa3f946fd]' and flags '--recurse-submodules'
Downloaded 'https://github.com/pmodels/argobots/archive/v1.0rc1.tar.gz' to 'argobots'
Cloned 'https://xgitlab.cels.anl.gov/sds/margo.git' to 'margo' with commit '[v0.6.3]' and flags ''
Downloaded 'https://github.com/facebook/rocksdb/archive/v6.2.2.tar.gz' to 'rocksdb'
Cloned 'https://github.com/pmem/syscall_intercept.git' to 'syscall_intercept' with commit '[f7cebb7b7e7512a19b78a31ce236ad6ca22636dd]' and flags ''
Cloned 'https://github.com/HowardHinnant/date.git' to 'date' with commit '[e7e1482087f58913b80a20b04d5c58d9d6d90155]' and flags ''
Cloned 'https://github.com/francielizanon/agios.git' to 'agios' with commit '[c26a6544200f823ebb8f890dd94e653d148bf226]' and flags '-b development'
Cloned 'https://github.com/francielizanon/agios.git' to 'agios' with commit '[c26a6544200f823ebb8f890dd94e653d148bf226]' and flags '--branch=development'
+4 −4
Original line number Diff line number Diff line
@@ -3,9 +3,9 @@ Downloaded 'https://github.com/facebook/zstd/archive/v1.3.2.tar.gz' to 'zstd'
Downloaded 'https://github.com/lz4/lz4/archive/v1.8.0.tar.gz' to 'lz4'
Downloaded 'https://github.com/google/snappy/archive/1.1.7.tar.gz' to 'snappy'
Downloaded 'https://github.com/aquynh/capstone/archive/4.0.1.tar.gz' to 'capstone'
Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric' with commit '[HEAD]' and flags '-b v1.8.1'
Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric:experimental' with commit '[HEAD]' and flags '-b v1.9.1'
Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric:verbs' with commit '[HEAD]' and flags '-b v1.7.2'
Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric' with commit '[HEAD]' and flags '--branch=v1.8.1'
Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric:experimental' with commit '[HEAD]' and flags '--branch=v1.9.1'
Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric:verbs' with commit '[HEAD]' and flags '--branch=v1.7.2'
Downloaded 'https://github.com/pmodels/argobots/archive/v1.0rc1.tar.gz' to 'argobots'
Cloned 'https://xgitlab.cels.anl.gov/sds/margo.git' to 'margo' with commit '[v0.6.3]' and flags ''
Downloaded 'https://github.com/facebook/rocksdb/archive/v6.2.2.tar.gz' to 'rocksdb'
@@ -13,4 +13,4 @@ Downloaded 'https://github.com/facebook/rocksdb/archive/v6.11.4.tar.gz' to 'rock
Cloned 'https://github.com/pmem/syscall_intercept.git' to 'syscall_intercept' with commit '[f7cebb7b7e7512a19b78a31ce236ad6ca22636dd]' and flags ''
Cloned 'https://github.com/HowardHinnant/date.git' to 'date' with commit '[e7e1482087f58913b80a20b04d5c58d9d6d90155]' and flags ''
Downloaded 'https://github.com/intel/opa-psm2/archive/PSM2_11.2.86.tar.gz' to 'psm2'
Cloned 'https://github.com/francielizanon/agios.git' to 'agios' with commit '[c26a6544200f823ebb8f890dd94e653d148bf226]' and flags '-b development'
Cloned 'https://github.com/francielizanon/agios.git' to 'agios' with commit '[c26a6544200f823ebb8f890dd94e653d148bf226]' and flags '--branch=development'
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ Downloaded 'https://github.com/facebook/zstd/archive/v1.3.2.tar.gz' to 'zstd'
Downloaded 'https://github.com/lz4/lz4/archive/v1.8.0.tar.gz' to 'lz4'
Downloaded 'https://github.com/google/snappy/archive/1.1.7.tar.gz' to 'snappy'
Downloaded 'https://github.com/aquynh/capstone/archive/4.0.1.tar.gz' to 'capstone'
Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric:verbs' with commit '[HEAD]' and flags '-b v1.7.2'
Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric:verbs' with commit '[HEAD]' and flags '--branch=v1.7.2'
Cloned 'https://github.com/mercury-hpc/mercury' to 'mercury' with commit '[41caa143a07ed179a3149cac4af0dc7aa3f946fd]' and flags '--recurse-submodules'
Downloaded 'https://github.com/pmodels/argobots/archive/v1.0rc1.tar.gz' to 'argobots'
Cloned 'https://xgitlab.cels.anl.gov/sds/margo.git' to 'margo' with commit '[v0.6.3]' and flags ''
Loading