vxOpenLibm - v1.0.0-dev3 : uninstall support
*add* > [scripts] | [uninstall] support uninstall using cmake install manifest parsing *fix* > [scripts] | [install] fix help message
This commit is contained in:
parent
c968733af4
commit
14a9385edd
|
@ -13,7 +13,7 @@ Usage: $0 [options...]
|
|||
Options:
|
||||
-h, --help display this help
|
||||
-y, --yes do not display validation step
|
||||
--verbose display more information during operations
|
||||
-v, --verbose display more information during operations
|
||||
--prefix-sysroot sysroot (install) prefix path
|
||||
|
||||
Notes:
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
#---
|
||||
# Help screen
|
||||
#---
|
||||
|
||||
function help() {
|
||||
cat << EOF
|
||||
Uninstallation script for vxOpenLibm project (for of OpenLibm)
|
||||
|
||||
Usage: $0 [options...]
|
||||
|
||||
Options:
|
||||
-h, --help display this help
|
||||
-y, --yes do not display validation step
|
||||
-v, --verbose display more information during operations
|
||||
|
||||
Notes:
|
||||
This project is a dependency of "sh-elf-vhex" compiler, manual
|
||||
uninstallation can break all the toolchain.
|
||||
EOF
|
||||
exit 0
|
||||
}
|
||||
|
||||
#---
|
||||
# Parse arguments
|
||||
#---
|
||||
|
||||
verbose=false
|
||||
skip_input=false
|
||||
for arg; do
|
||||
case "$arg" in
|
||||
-h | --help) help;;
|
||||
-y | --yes) skip_input=true;;
|
||||
-v | --verbose) verbose=true;;
|
||||
*)
|
||||
echo "error: unreconized argument '$arg', giving up." >&2
|
||||
exit 1
|
||||
esac
|
||||
done
|
||||
|
||||
#---
|
||||
# Preliminary check
|
||||
#---
|
||||
|
||||
_src=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
cd "$_src" || exit 1
|
||||
source ./_utils.sh
|
||||
|
||||
if ! test -f '../openlibm/_build-vhex/install_manifest.txt'
|
||||
then
|
||||
echo 'vxOpenLibm not installed, nothing to do'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "$skip_input" != 'true' ]]
|
||||
then
|
||||
echo 'This script will remove the vxOpenLibm from the builded sysroot'
|
||||
read -p 'Perform operation [yN] ? ' -r valid
|
||||
if [[ "$valid" != 'y' ]]
|
||||
then
|
||||
echo 'Operation aborded' >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
#---
|
||||
# Manual uninstall
|
||||
#---
|
||||
|
||||
echo "$TAG removing installed files..."
|
||||
while IFS='' read -r line || [[ -n "$line" ]]
|
||||
do
|
||||
! test -f "$line" && continue
|
||||
[[ "$verbose" == 'true' ]] && echo "rm $line"
|
||||
rm "$line"
|
||||
done < '../openlibm/_build-vhex/install_manifest.txt'
|
Loading…
Reference in New Issue