Skip to content

Commit

Permalink
wip: remove deps
Browse files Browse the repository at this point in the history
Signed-off-by: Prakhar Gurunani <[email protected]>
  • Loading branch information
FirePing32 committed Oct 18, 2023
1 parent 314ebcf commit 7877cb4
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions tools/remove_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/bash

# Copyright 2019 The Vitess Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Remove tools and dependencies installed by "make tools"

source ./../dev.env

uninstall_protoc() {
echo "Removing protoc..."
local dist="$1"

unlink "$dist/bin/protoc"
rm -rf $dist
}

uninstall_zookeeper() {
echo "Removing zookeeper..."
local dist="$1"

rm -rf $dist
}

uninstall_etcd() {
echo "Removing etcd..."
local version="$1"
local dist="$2"

case $(uname) in
Linux) local platform=linux; local ext=tar.gz;;
Darwin) local platform=darwin; local ext=zip;;
*) echo "ERROR: unsupported platform for etcd"; exit 1;;
esac

case $(get_arch) in
aarch64) local target=arm64;;
x86_64) local target=amd64;;
arm64) local target=arm64;;
*) echo "ERROR: unsupported architecture for etcd"; exit 1;;
esac


unlink "$dist/etcd-${version}-${platform}-${target}/etcd"
unlink "$dist/etcd-${version}-${platform}-${target}/etcdctl"
rm -rf $dist
}

uninstall_consul() {
echo "Removing consul..."
local dist="$1"

unlink "$dist/consul"
rm -rf $dist
}

0 comments on commit 7877cb4

Please sign in to comment.