2013-07-19 00:35:52 +00:00
|
|
|
#!/bin/bash
|
2011-01-09 22:32:01 +00:00
|
|
|
|
2011-01-09 20:26:03 +00:00
|
|
|
################################################################################
|
|
|
|
# This file is part of OpenELEC - http://www.openelec.tv
|
2016-01-02 16:26:58 +00:00
|
|
|
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
|
2011-01-09 20:26:03 +00:00
|
|
|
#
|
2013-12-21 20:51:48 +00:00
|
|
|
# OpenELEC is free software: you can redistribute it and/or modify
|
2011-01-09 20:26:03 +00:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
2013-12-21 20:51:48 +00:00
|
|
|
# the Free Software Foundation, either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
2011-01-09 20:26:03 +00:00
|
|
|
#
|
2013-12-21 20:51:48 +00:00
|
|
|
# OpenELEC is distributed in the hope that it will be useful,
|
2011-01-09 20:26:03 +00:00
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2013-12-21 20:51:48 +00:00
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2011-01-09 20:26:03 +00:00
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2013-12-21 20:51:48 +00:00
|
|
|
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
2011-01-09 20:26:03 +00:00
|
|
|
################################################################################
|
2009-03-18 12:02:53 +00:00
|
|
|
|
2010-07-21 16:54:45 +00:00
|
|
|
. config/options $1
|
2009-03-18 12:02:53 +00:00
|
|
|
|
2016-04-01 06:53:08 +00:00
|
|
|
clean_package() {
|
2013-12-20 14:51:09 +00:00
|
|
|
printf "%${BUILD_INDENT}c ${boldred}CLEAN${endcolor} $1\n" ' '>&$SILENT_OUT
|
2013-12-10 17:26:56 +00:00
|
|
|
export BUILD_INDENT=$((${BUILD_INDENT:-1}+$BUILD_INDENT_SIZE))
|
2009-03-18 12:02:53 +00:00
|
|
|
|
|
|
|
if [ "$CLEAN_SOURCES" = true ]; then
|
2010-07-22 03:07:09 +00:00
|
|
|
rm -rf $SOURCES/$1
|
2009-03-18 12:02:53 +00:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2013-12-12 17:59:28 +00:00
|
|
|
for i in $BUILD/$1-*; do
|
2016-06-08 07:13:39 +00:00
|
|
|
if [ -d $i -a -f "$i/.libreelec-unpack" ] ; then
|
|
|
|
. "$i/.libreelec-unpack"
|
2013-12-12 17:59:28 +00:00
|
|
|
if [ "$STAMP_PKG_NAME" = "$1" ]; then
|
2013-12-20 14:51:09 +00:00
|
|
|
printf "%${BUILD_INDENT}c ${boldred}*${endcolor} ${red}Removing $i ...${endcolor}\n" ' '>&$SILENT_OUT
|
2013-12-12 17:59:28 +00:00
|
|
|
rm -rf $i
|
2013-12-10 17:26:56 +00:00
|
|
|
fi
|
2013-12-12 17:59:28 +00:00
|
|
|
else
|
|
|
|
# force clean if no stamp found (previous unpack failed)
|
|
|
|
printf "%${BUILD_INDENT}c * Removing $i ...\n" ' '>&$SILENT_OUT
|
|
|
|
rm -rf $i
|
|
|
|
fi
|
|
|
|
done
|
2014-07-19 10:46:57 +00:00
|
|
|
rm -f $STAMPS/$1/build_*
|
2016-04-01 06:53:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if [ "$1" = "--all" ]; then
|
|
|
|
if [ ! -z "$2" ]; then
|
|
|
|
for PROJECT in $(ls -1 projects); do
|
2016-04-05 09:13:29 +00:00
|
|
|
for archfile in projects/$PROJECT/linux/linux.*.conf; do
|
2016-04-01 06:53:08 +00:00
|
|
|
if [ ! -f "$archfile" ]; then
|
2016-04-05 09:13:29 +00:00
|
|
|
archfile="$(ls -1 projects/$PROJECT/linux/*/linux.*.conf | head -1)"
|
2016-04-01 06:53:08 +00:00
|
|
|
fi
|
|
|
|
ARCH=`echo $archfile | sed -n '$s/\.conf//;$s/.*\.//p'`
|
|
|
|
PROJECT=$PROJECT ARCH=$ARCH ./scripts/clean $2
|
|
|
|
done
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if [ ! -z "$1" ]; then
|
|
|
|
clean_package $1
|
|
|
|
fi
|
2009-03-18 12:02:53 +00:00
|
|
|
fi
|
2016-04-01 06:53:08 +00:00
|
|
|
|