Commit 0ca123d2 authored by Dick Hollenbeck's avatar Dick Hollenbeck

add --uninstall-libraries to kicad-install.sh

parent 1173eff7
......@@ -19,8 +19,9 @@ usage()
echo ""
echo "./kicad-install.sh <cmd>"
echo " where <cmd> is one of:"
echo " --install-or-update (does full installation or update.)"
echo " --remove-sources (removes source trees for another attempt.)"
echo " --install-or-update (does full installation or update.)"
echo " --remove-sources (removes source trees for another attempt.)"
echo " --uninstall-libraries (removes KiCad supplied libraries.)"
echo ""
echo "example:"
echo ' $ ./kicad-install.sh --install-or-update'
......@@ -85,6 +86,27 @@ rm_build_dir()
}
cmake_uninstall()
{
# assume caller set the CWD, and is only telling us about it in $1
local dir="$1"
cwd=`pwd`
if [ "$cwd" != "$dir" ]; then
echo "missing dir $dir"
elif [ ! -e install_manifest.txt ]; then
echo
echo "Missing file $dir/install_manifest.txt."
echo "Libraries may have already been uinstalled, or were not"
echo 'originally installed with an "uninstall" knowledgable CMakeLists.txt file.'
else
echo "uninstalling from $dir"
sudo make uninstall
sudo rm install_manifest.txt
fi
}
install_or_update()
{
echo "step 1) installing pre-requisites"
......@@ -202,4 +224,11 @@ if [ $# -eq 1 -a "$1" == "--install-or-update" ]; then
exit
fi
if [ $# -eq 1 -a "$1" == "--uninstall-libraries" ]; then
cd "$WORKING_TREES/kicad-lib.bzr/build"
cmake_uninstall "$WORKING_TREES/kicad-lib.bzr/build"
exit
fi
usage
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment