Skip to content
Snippets Groups Projects
Commit fcc401f6 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

safer uninstall

ask for confirm before deleting files
parent 922b3885
No related branches found
No related tags found
No related merge requests found
......@@ -216,6 +216,17 @@ endif
uninstall:
@echo WARNING
@echo I will remove the following files now
@echo "$(DESTDIR)$(libdir)/$(program_name)"
@echo "$(DESTDIR)$(htmldir)"
@echo "$(DESTDIR)$(includedir)/$(program_name)"
@echo "$(DESTDIR)$(bindir)/$(program_name)"
@echo "$(DESTDIR)$(bindir)/$(program_name)-patch"
@echo "$(DESTDIR)$(libdir)/lib$(program_name).$(SOEXT)"
@echo "$(DESTDIR)$(libdir)/lib$(program_name)Kernel.$(SOEXT)"
../maketools/confirm_uninstall
@echo Removing previously installed files
rm -fr "$(DESTDIR)$(libdir)/$(program_name)"
rm -fr "$(DESTDIR)$(htmldir)"
rm -fr "$(DESTDIR)$(includedir)/$(program_name)"
......
#! /bin/bash
confirm () {
# call with a prompt string or use a default
read -r -p "${1:-Are you sure? [y/N]} " response
case $response in
[yY][eE][sS]|[yY])
true
;;
*)
false
;;
esac
}
confirm "Are you shure that you want to Uninstall? This might lead to data loss! [y/N]" || exit 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment