sh-elf-vhex - v2.0.0-rc14 : hotfix missing newline in install + remove deprecated scripts

*update*
> [scripts]
  | [utils] check tar integrity
  | [gcc/build] update logs

*fix*
> [scripts]
  | [install] hotfix missing newline in install
  | [_uninstall] remove goofy script
This commit is contained in:
YannMagnin 2023-12-20 20:07:41 +01:00
parent 6a2443861c
commit dc219da739
No known key found for this signature in database
GPG Key ID: D82629D933EADC59
4 changed files with 11 additions and 107 deletions

View File

@ -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

View File

@ -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..."

View File

@ -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

View File

@ -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\"'"