Skip to content
Snippets Groups Projects
chaos_clean.sh 1.03 KiB
Newer Older
  • Learn to ignore specific revisions
  • #!/bin/bash
    dir=`dirname $0`
    
    Andrea Michelotti's avatar
    Andrea Michelotti committed
    if [ -n "$1" ];then
        chaos_bundle=$1
    
    else
    
    Andrea Michelotti's avatar
    Andrea Michelotti committed
        if [ -n "$CHAOS_BUNDLE" ];then
    	chaos_bundle="$CHAOS_BUNDLE"
        else
    	chaos_bundle=$dir/..
        fi
    
    fi
    function cleandir(){
        echo "* cleaning $1"
        rm -rf $1
    }
    
    Andrea Michelotti's avatar
    Andrea Michelotti committed
    sys=`uname -s`
    mac=`uname -m`
    
    Andrea Michelotti's avatar
    Andrea Michelotti committed
    cleandir $chaos_bundle/usr
    
    Andrea Michelotti's avatar
    Andrea Michelotti committed
    
    if [ -n "$CHAOS_TARGET" ];then
        cleandir $chaos_bundle/chaosframwork/external-${CHAOS_TARGET}
        cleandir $chaos_bundle/build-${CHAOS_TARGET}
    else
        cleandir $chaos_bundle/chaosframwork/external-$sys-$mac
            cleandir $chaos_bundle/build-$sys-$mac
    fi
    
    cleandir $chaos_bundle/chaosframwork/usr
    cleandir $chaos_bundle/chaosframework/bin
    cleandir $chaos_bundle/chaosframework/build
    
    Andrea Michelotti's avatar
    Andrea Michelotti committed
    cleandir $chaos_bundle/build
    
    if [ -n "$CHAOS_PREFIX" ]; then
    
    Andrea Michelotti's avatar
    Andrea Michelotti committed
        echo "* cleaning CHAOS_PREFIX=$CHAOS_PREFIX" 
    
        cleandir $CHAOS_PREFIX
    fi
    find $chaos_bundle -name "CMakeFiles" -exec rm -rf \{\} \; >& /dev/null
    find $chaos_bundle -name "CMakeCache.txt" -exec rm -rf \{\} \; >& /dev/null
    
    Andrea Michelotti's avatar
    Andrea Michelotti committed
    find $chaos_bundle -name "cmake_install.cmake" -exec rm -rf \{\} \; >& /dev/null