Switch to --force | More cleanup

This commit is contained in:
Abraham Gonzalez
2022-09-22 13:42:01 -07:00
parent c5447b168c
commit cf2c6c8a36
11 changed files with 47 additions and 52 deletions

View File

@@ -26,7 +26,8 @@ usage() {
echo " --prefix PREFIX : Install destination. If unset, defaults to $CONDA_PREFIX/riscv-tools"
echo " or $CONDA_PREFIX/esp-tools"
echo " --clean-after-install : Run make clean in calls to module_make and module_build"
echo " --batch : Skip prompt checking for conda"
echo " --force -f : Skip prompt checking for conda"
echo " --skip-validate : DEPRECATED: Same functionality as --force"
echo " --help -h : Display this message"
exit "$1"
}
@@ -34,7 +35,7 @@ usage() {
TOOLCHAIN="riscv-tools"
CLEANAFTERINSTALL=""
RISCV=""
BATCH=false
FORCE=false
# getopts does not support long options, and is inflexible
while [ "$1" != "" ];
@@ -49,8 +50,8 @@ do
CLEANAFTERINSTALL="true" ;;
riscv-tools | esp-tools)
TOOLCHAIN=$1 ;;
--batch)
BATCH=true;
--force | -f | --skip-validate)
FORCE=true;
;;
* )
error "invalid option $1"
@@ -59,7 +60,7 @@ do
shift
done
if [ "$BATCH" = false ]; then
if [ "$FORCE" = false ]; then
if [ -z ${CONDA_DEFAULT_ENV+x} ]; then
error "ERROR: No conda environment detected. Did you activate the conda environment (e.x. 'conda activate chipyard')?"
exit 1

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
# exit script if any command fails
set -e
set -o pipefail

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
# exit script if any command fails
set -e
set -o pipefail

View File

@@ -13,18 +13,19 @@ common_setup
function usage
{
echo "Usage: $0 [--batch]"
echo "Usage: $0 [--force]"
echo "Initialize Chipyard submodules and setup initial env.sh script."
echo ""
echo " --batch Skip prompt checking for tagged release"
echo " --force -f : Skip prompt checking for tagged release"
echo " --skip-validate : DEPRECATED: Same functionality as --force"
}
BATCH=false
FORCE=false
while test $# -gt 0
do
case "$1" in
--batch)
BATCH=true;
--force | -f | --skip-validate)
FORCE=true;
;;
-h | -H | --help | help)
usage
@@ -46,7 +47,7 @@ git_tag=$(git describe --exact-match --tags)
git_tag_rc=$?
restore_bash_options
if [ "$git_tag_rc" -ne 0 ]; then
if [ "$BATCH" == false ]; then
if [ "$FORCE" == false ]; then
while true; do
read -p "WARNING: You are not on an official release of Chipyard."$'\n'"Type \"y\" to continue if this is intended or \"n\" if not: " validate
case "$validate" in

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
# exit script if any command fails
set -e
set -o pipefail

View File

@@ -3,19 +3,9 @@
set -e
# this should be run from chipyard repo top
TOPDIR=$(pwd)
RDIR=$(git rev-parse --show-toplevel)
cd generators/cva6/src/main/resources/vsrc
git submodule deinit cva6
cd $TOPDIR
cd toolchains/qemu/roms/
git submodule deinit edk2
cd ../
rm -rf build
cd ../libgloss
cd $RDIR/libgloss
rm -rf build.log
cd ../riscv-tools/riscv-isa-sim/
@@ -27,6 +17,5 @@ rm -rf build.log
cd ../riscv-tests
rm -rf build.log
cd $TOPDIR
cd tools/api-config-chipsalliance
cd $RDIR/tools/api-config-chipsalliance
git config --local status.showUntrackedFiles no

View File

@@ -1,6 +1,10 @@
#!/bin/bash
set -e -x
set -ex
RDIR=$(git rev-parse --show-toplevel)
cd $RDIR
git rm generators/chipyard/src/main/scala/config/RocketSha3Configs.scala
git rm -rf generators/sha3