diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-11-01 12:43:56 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-11-01 12:43:56 +0000 |
commit | 4cb4b3c0ee6e900b07bfa7d5e293f93e301f9e71 (patch) | |
tree | aea54bc542734c65d5d47145a158e8138f332958 /misc/uClibc++/uninstall.sh | |
parent | d1bcab320dc8d1431ff6a15ba47e78b6b67ee869 (diff) | |
download | nuttx-4cb4b3c0ee6e900b07bfa7d5e293f93e301f9e71.tar.gz nuttx-4cb4b3c0ee6e900b07bfa7d5e293f93e301f9e71.tar.bz2 nuttx-4cb4b3c0ee6e900b07bfa7d5e293f93e301f9e71.zip |
Correct name of another uClibc++ directory
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5288 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'misc/uClibc++/uninstall.sh')
-rwxr-xr-x | misc/uClibc++/uninstall.sh | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/misc/uClibc++/uninstall.sh b/misc/uClibc++/uninstall.sh new file mode 100755 index 000000000..ae7344449 --- /dev/null +++ b/misc/uClibc++/uninstall.sh @@ -0,0 +1,94 @@ +#!/bin/bash + +usage="USAGE: $0 <full path to the NuttX directory>" +special="include/features.h" + +# Get the single, required command line argument + +nuttx_path=$1 +if [ -z "${nuttx_path}" ]; then + echo "ERROR: Missing path to the NuttX directory" + echo $usage + exit 1 +fi + +# Lots of sanity checking so that we do not do anything too stupid + +if [ ! -d libxx ]; then + echo "ERROR: Directory libxx does not exist in this directory" + echo " Please CD into the misc/uClibc++ directory and try again" + echo $usage + exit 1 +fi + +if [ ! -d include ]; then + echo "ERROR: Directory include does not exist in this directory" + echo " Please CD into the misc/uClibc++ directory and try again" + echo $usage + exit 1 +fi + +if [ ! -d "${nuttx_path}" ]; then + echo "ERROR: Directory ${nuttx_path} does not exist" + echo $usage + exit 1 +fi + +if [ ! -f "${nuttx_path}/Makefile" ]; then + echo "ERROR: No Makefile in directory ${nuttx_path}" + echo $usage + exit 1 +fi + +libxx_srcdir=${nuttx_path}/libxx + +if [ ! -d "${libxx_srcdir}" ]; then + echo "ERROR: Directory ${libxx_srcdir} does not exist" + echo $usage + exit 1 +fi + +if [ ! -f "${libxx_srcdir}/Makefile" ]; then + echo "ERROR: No Makefile in directory ${libxx_srcdir}" + echo $usage + exit 1 +fi + +uclibc_srcdir=${libxx_srcdir}/uClibc++ + +if [ ! -d "${uclibc_srcdir}" ]; then + echo "ERROR: Directory ${uclibc_srcdir} already exists" + echo " uClibc++ is not installed" + exit 0 +fi + +nuttx_incdir=${nuttx_path}/include + +if [ ! -d "${nuttx_incdir}" ]; then + echo "ERROR: Directory ${nuttx_incdir} does not exist" + echo $usage + exit 1 +fi + +uclibc_incdir=${nuttx_incdir}/uClibc++ + +if [ ! -d "${uclibc_incdir}" ]; then + echo "ERROR: Directory ${uclibc_incdir} does not exist" + echo " uClibc++ is only partially installed" +fi + +echo "Removing uClibc++ in the NuttX source tree" + +rm -rf ${uclibc_incdir} || \ + { echo "ERROR: 'rm -rf ${uclibc_incdir}' failed"; exit 1; } + +rm -rf ${uclibc_srcdir} || \ + { echo "ERROR: 'rm -rf ${libxx_srcdir}' failed"; exit 1; } + +for file in $special; do + rm -f ${nuttx_path}/${special} || \ + { echo "ERROR: ' rm -f ${nuttx_path}/${special}' failed"; exit 1; } +done + +echo "Successfully uninstalled" +echo "" |