add --uninstall-libraries to kicad-install.sh
This commit is contained in:
parent
1173eff777
commit
0ca123d255
|
@ -21,6 +21,7 @@ usage()
|
|||
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 " --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
|
||||
|
|
Loading…
Reference in New Issue