Merge pull request #1474 from MilhouseVH/clean_fix

scripts: revert changes that led to accumulation of old packages
This commit is contained in:
Lukas Rusak 2017-03-24 00:06:18 -07:00 committed by GitHub
commit 853989c931
2 changed files with 16 additions and 15 deletions

View File

@ -29,21 +29,20 @@ clean_package() {
return
fi
STAMP=$PKG_BUILD/.libreelec-unpack
if [ -d "$PKG_BUILD" ]; then
if [ -f "$STAMP" ] ; then
. "$STAMP"
# Use a wilcard here to remove all versions of the package
for i in $BUILD/$1-*; do
if [ -d $i -a -f "$i/.libreelec-unpack" ] ; then
. "$i/.libreelec-unpack"
if [ "$STAMP_PKG_NAME" = "$1" ]; then
printf "%${BUILD_INDENT}c ${boldred}*${endcolor} ${red}Removing $PKG_BUILD ...${endcolor}\n" ' '>&$SILENT_OUT
rm -rf "$PKG_BUILD"
printf "%${BUILD_INDENT}c ${boldred}*${endcolor} ${red}Removing $i ...${endcolor}\n" ' '>&$SILENT_OUT
rm -rf $i
fi
else
# force clean if no stamp found (previous unpack failed)
printf "%${BUILD_INDENT}c * Removing $PKG_BUILD ...\n" ' '>&$SILENT_OUT
rm -rf "$PKG_BUILD"
printf "%${BUILD_INDENT}c * Removing $i ...\n" ' '>&$SILENT_OUT
rm -rf $i
fi
fi
done
rm -f $STAMPS/$1/build_*
}

View File

@ -39,17 +39,19 @@ mkdir -p $BUILD
STAMP_DEPENDS="$PKG_DIR $PKG_NEED_UNPACK $PROJECT_DIR/$PROJECT/patches/$PKG_NAME"
[ -n "$DEVICE" ] && STAMP_DEPENDS="$STAMP_DEPENDS $PROJECT_DIR/$PROJECT/devices/$DEVICE/patches/$PKG_NAME"
if [ -d "$PKG_BUILD" ]; then
if [ -f "$STAMP" ] ; then
. "$STAMP"
# Perform a wildcard match on the package to ensure old versions are cleaned too
PKG_DEEPMD5=
for i in $BUILD/$1-*; do
if [ -d $i -a -f "$i/.libreelec-unpack" ] ; then
. "$i/.libreelec-unpack"
if [ "$STAMP_PKG_NAME" = "$1" ]; then
PKG_DEEPMD5=$(find $STAMP_DEPENDS -exec md5sum {} \; 2>/dev/null | sort | md5sum | cut -d" " -f1)
[ -z "${PKG_DEEPMD5}" ] && PKG_DEEPMD5=$(find $STAMP_DEPENDS -exec md5sum {} \; 2>/dev/null | sort | md5sum | cut -d" " -f1)
if [ ! "$PKG_DEEPMD5" = "$STAMP_PKG_DEEPMD5" ] ; then
$SCRIPTS/clean $1
fi
fi
fi
fi
done
if [ -d "$PKG_BUILD" -a ! -f "$STAMP" ]; then
# stale pkg build dir