From 48712f9e541bac0bbff4cb94c92152b9e933198c Mon Sep 17 00:00:00 2001 From: Richard Lander Date: Sat, 14 May 2016 21:46:25 -0700 Subject: [PATCH 1/3] Change to correct variable --- scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh b/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh index 7ce52ee5d..a712c8a1a 100755 --- a/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh +++ b/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh @@ -31,7 +31,7 @@ remove_dotnet_pkgs [ "$?" -ne 0 ] && echo "Failed to remove dotnet packages." && exit 1 echo "Deleting install root - $dotnet_install_root" -rm -rf $dotnet_install_location +rm -rf $dotnet_install_root rm -f $dotnet_path_file echo "dotnet packages removal succeeded." From 13d760c6a4a9b4202885b10df551456a4834c714 Mon Sep 17 00:00:00 2001 From: Richard Lander Date: Sat, 14 May 2016 23:57:25 -0700 Subject: [PATCH 2/3] Remove .nuget dir on uninstall --- scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh b/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh index a712c8a1a..7b9fc7320 100755 --- a/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh +++ b/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh @@ -17,6 +17,9 @@ dotnet_pkg_name_suffix="com.microsoft.dotnet" dotnet_install_root="/usr/local/share/dotnet" dotnet_path_file="/etc/paths.d/dotnet" +# nuget paths +nuget_root=~/.nuget + remove_dotnet_pkgs(){ installed_pkgs=($(pkgutil --pkgs | grep $dotnet_pkg_name_suffix)) @@ -34,5 +37,8 @@ echo "Deleting install root - $dotnet_install_root" rm -rf $dotnet_install_root rm -f $dotnet_path_file +echo "Deleting NuGet package location" +rm -rf $nuget_root + echo "dotnet packages removal succeeded." exit 0 From 584bd3e72d768876f3578da43a8e7a25db1ce60c Mon Sep 17 00:00:00 2001 From: Bryan Date: Wed, 18 May 2016 09:32:48 -0700 Subject: [PATCH 3/3] Clean + fixup --- .../uninstall/dotnet-uninstall-debian-packages.sh | 2 +- scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/scripts/obtain/uninstall/dotnet-uninstall-debian-packages.sh b/scripts/obtain/uninstall/dotnet-uninstall-debian-packages.sh index 7abb9a486..4a2fa7f1c 100755 --- a/scripts/obtain/uninstall/dotnet-uninstall-debian-packages.sh +++ b/scripts/obtain/uninstall/dotnet-uninstall-debian-packages.sh @@ -8,7 +8,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" current_user=$(whoami) if [ $current_user != "root" ]; then - echo "$(basename $0) uninstallation script requires superuser privileges to run" + echo "$(basename "$0") uninstallation script requires superuser privileges to run" exit 1 fi diff --git a/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh b/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh index 7b9fc7320..b03efa61e 100755 --- a/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh +++ b/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh @@ -8,7 +8,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" current_user=$(whoami) if [ $current_user != "root" ]; then - echo "`basename "$0"` uninstallation script requires superuser privileges to run" + echo "$(basename "$0") uninstallation script requires superuser privileges to run" exit 1 fi @@ -17,9 +17,6 @@ dotnet_pkg_name_suffix="com.microsoft.dotnet" dotnet_install_root="/usr/local/share/dotnet" dotnet_path_file="/etc/paths.d/dotnet" -# nuget paths -nuget_root=~/.nuget - remove_dotnet_pkgs(){ installed_pkgs=($(pkgutil --pkgs | grep $dotnet_pkg_name_suffix)) @@ -34,11 +31,8 @@ remove_dotnet_pkgs [ "$?" -ne 0 ] && echo "Failed to remove dotnet packages." && exit 1 echo "Deleting install root - $dotnet_install_root" -rm -rf $dotnet_install_root -rm -f $dotnet_path_file - -echo "Deleting NuGet package location" -rm -rf $nuget_root +rm -r "$dotnet_install_root" +rm "$dotnet_path_file" echo "dotnet packages removal succeeded." exit 0