Misc. updates to bash scripts

This commit is contained in:
Abraham Gonzalez
2022-09-21 22:45:13 -07:00
parent 85f16d3342
commit c5447b168c
5 changed files with 136 additions and 100 deletions

View File

@@ -28,7 +28,7 @@ usage() {
echo "Options"
echo " --help -h : Display this message"
echo " --unpinned-deps -ud : Use unpinned conda environment"
echo " --skip-validate : Skip prompt checking for tagged release/conda"
echo " --batch : Skip prompt checking for tagged release/conda"
echo " --skip-conda : Skip conda env creation"
echo " --skip-toolchain-extra : Skip building extra RISC-V toolchain collateral (Spike, PK, tests, libgloos)"
exit "$1"
@@ -36,7 +36,7 @@ usage() {
TOOLCHAIN="riscv-tools"
USE_PINNED_DEPS=true
SKIP_VALIDATE_FLAG=""
BATCH_FLAG=""
SKIP_CONDA=false
SKIP_TOOLCHAIN=false
@@ -50,8 +50,8 @@ do
TOOLCHAIN=$1 ;;
-ud | --unpinned-deps )
USE_PINNED_DEPS=false ;;
--skip-validate)
SKIP_VALIDATE_FLAG=$1 ;;
--batch)
BATCH_FLAG=$1 ;;
--skip-conda)
SKIP_CONDA=true ;;
--skip-toolchain-extra)
@@ -80,19 +80,21 @@ if [ "$SKIP_CONDA" = false ]; then
conda activate $DIR/.conda-env
fi
if [ -z "$SKIP_VALIDATE_FLAG" ]; then
if [ -z "$BATCH_FLAG" ]; then
if [ -z ${CONDA_DEFAULT_ENV+x} ]; then
error "ERROR: No conda environment detected. Did you activate the conda environment (e.x. 'conda activate base')?"
exit 1
fi
fi
$DIR/scripts/init-submodules-no-riscv-tools.sh $SKIP_VALIDATE_FLAG
$DIR/scripts/init-submodules-no-riscv-tools.sh $BATCH_FLAG
if [ "$SKIP_TOOLCHAIN" = false ]; then
$DIR/scripts/build-toolchain-extra.sh $SKIP_VALIDATE_FLAG $TOOLCHAIN
$DIR/scripts/build-toolchain-extra.sh $BATCH_FLAG $TOOLCHAIN
fi
$DIR/scripts/gen-tags.sh
cat << EOT >> env.sh
# line auto-generated by $0
conda activate $DIR/.conda-env