diff --git a/scripts/_uninstall.sh b/scripts/_uninstall.sh deleted file mode 100644 index 7874126..0000000 --- a/scripts/_uninstall.sh +++ /dev/null @@ -1,105 +0,0 @@ -#! /usr/bin/env bash - -#--- -# Help screen -#--- - -function help() -{ - cat << EOF -Script for the uninstallation of sh-elf-vhex - -Usage $0 [options...] - -Configurations: - -h, --help Display this help - -v, --verbose Display extra information during operation - --prefix-install Installation (bin) prefix - --prefix-sysroot Sysroot (lib, header, ...) prefix - --prefix-clone Clone prefix - --no-purge Do not remove the cloned folder -EOF - exit 0 -} - -#--- -# Parse arguments -#--- - -purge='true' -prefix_install=~/.local/bin -prefix_sysroot=~/.local/share/sh-elf-vhex/_sysroot -prefix_clone=~/.local/share/sh-elf-vhex -for arg - do case "$arg" in - --help | -h) help;; - --no-purge) purge='false';; - --prefix-install=*) prefix_install=${arg#*=};; - --prefix-sysroot=*) prefix_sysroot=${arg#*=};; - --prefix-clone=*) prefix_clone=${arg#*=};; - *) - echo "error: unrecognized argument '$arg', giving up." >&2 - exit 1 - esac -done - -#--- -# Preliminary check -#--- - -if [[ ! -d "$prefix_clone" ]] -then - echo -e \ - 'Are you sure to have installed the project ?\n' \ - '\rIt seems that the cloned prefix does not exists' \ - >&2 - exit 1 -fi - -if [[ ! -d "$prefix_install" ]] -then - echo -e \ - 'WARNING: seems that the install prefix does not exists\n' \ - 'WARNING: if you continue, the install prefix will be ignored and' \ - 'nothing will be removed' \ - >&2 - read -p 'Proccess anyway ? [yN]' -r valid < /dev/tty - if [[ "$valid" != 'y' ]]; then - echo 'Operation aborted o(x_x)o' >&2 - exit 1 - fi -fi - -if [[ ! -x "$prefix_sysroot/bin/sh-elf-vhex-as" ]] -then - echo -e \ - 'ERROR: Are you sure to have built sh-elf-vhex ? Seems that the' \ - 'sh-elf-vhex-as cannot be found in the sysroot prefix' \ - >&2 - exit 1 -fi - -#--- -# Unistall step -#--- - -_src=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) -cd "$_src" || exit 1 -source ./_utils.sh - -echo "$TAG removing symlinks to binaries..." -for x in "$prefix_sysroot"/bin/*; do - utils_callcmd unlink "$x" - if [[ -L "$prefix_install/$(basename "$x")" ]]; then - utils_callcmd unlink "$prefix_install/$(basename "$x")" - fi -done - -echo "$TAG removing sysroot..." -rm -rf "$prefix_sysroot" - -if [[ "$purge" == 'true' ]] -then - echo "$TAG removing cloned folder..." - rm -rf "$prefix_clone" -fi diff --git a/scripts/_utils.sh b/scripts/_utils.sh index b2b51bc..df4f479 100644 --- a/scripts/_utils.sh +++ b/scripts/_utils.sh @@ -102,6 +102,15 @@ function utils_archive_download() exit 0 fi + if test -f "$archive" + then + if ! tar -tf "$archive" &> /dev/null + then + echo "WARNING: Unable to validate the archive, force re-download" >&2 + rm -f "$archive" + fi + fi + if ! test -f "$archive" then echo "$TAG Downloading $url..." diff --git a/scripts/gcc/build.sh b/scripts/gcc/build.sh index b7ed45f..e0475e7 100755 --- a/scripts/gcc/build.sh +++ b/scripts/gcc/build.sh @@ -81,7 +81,7 @@ echo "$TAG Compiling GCC (usually 10-20 minutes)..." utils_makecmd all-gcc -echo "$TAG Install GCC..." +echo "$TAG Install partial GCC..." utils_makecmd install-strip-gcc diff --git a/scripts/install.sh b/scripts/install.sh index a0154fe..378bb70 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -158,7 +158,7 @@ then rm -rf ../../build fi -echo -en \ +echo -e \ 'Successfully installed sh-elf-vhex !\n' \ '\rDo not forget to export the binary path' \ "'export PATH=\"\$PATH:$prefix_install\"'"