Lakka/scripts/clean
2010-07-22 05:07:09 +02:00

44 lines
709 B
Bash
Executable File

#!/bin/sh
. config/options $1
clean ()
{
echo " CLEAN $1" >&$SILENT_OUT
if [ "$CLEAN_SOURCES" = true ]; then
rm -rf $SOURCES/$1
return
fi
if [ "$FULL" = true ]; then
rm -rf $BUILD_BASE*/$STAMPS_NOARCH/$1*
rm -rf $BUILD_BASE*/$1*
rm -rf $STAMPS_NOARCH/$1
rm -rf $SOURCES/$1
else
rm -rf $PKG_BUILD
rm -f $STAMPS/$1*/unpack
rm -f $STAMPS/$1*/build
fi
}
if [ "$1" = "--full" ]; then
FULL=true
shift
elif [ "$1" = "--sources" ]; then
CLEAN_SOURCES=true
shift
fi
if [ -z "$1" ]; then
for i in $PACKAGES/*; do clean ${i#$PACKAGES/}; done
rm -rf $BUILD/iso
rm -rf $BUILD/ziso
[ "$FULL" = true ] && rm -rf $CCACHE_DIR
else
clean $1
fi
exit 0