scripts/unpack: quote tests and some more variables

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2010-12-18 22:55:20 +01:00
parent c3e0c981b1
commit 5b63210f4e

View File

@ -11,21 +11,21 @@ $SCRIPTS/get $1
mkdir -p $BUILD
[ ! -d $SOURCES/$1 -a ! -d $PKG_DIR/sources ] && exit 0
[ ! -d "$SOURCES/$1" -a ! -d "$PKG_DIR/sources" ] && exit 0
mkdir -p $STAMPS/$1
STAMP=$STAMPS/$1/unpack
[ -f $STAMP -a -f $PKG_DIR/need_unpack ] && $PKG_DIR/need_unpack $@
[ -f "$STAMP" -a -f "$PKG_DIR/need_unpack" ] && $PKG_DIR/need_unpack $@
for patch in $PKG_DIR/patches/*; do
if [ $patch -nt $STAMP ]; then
if [ "$patch" -nt "$STAMP" ]; then
rm -f $STAMP
break
fi
done
[ -f $STAMP ] && exit 0
[ -f "$STAMP" ] && exit 0
printf "%${INDENT}c UNPACK $1\n" >&$SILENT_OUT
export INDENT=$((${INDENT:-1}+$INDENT_SIZE))
@ -43,16 +43,16 @@ if [ -n "$PKG_URL" ]; then
$SCRIPTS/extract $1 "$1*.7z" $BUILD
fi
if [ -d $PKG_DIR/sources ]; then
[ ! -d $BUILD/$1* ] && mkdir -p $BUILD/$1
if [ -d "$PKG_DIR/sources" ]; then
[ ! -d "$BUILD/$1*" ] && mkdir -p $BUILD/$1
cp -PRf $PKG_DIR/sources/* $BUILD/$1*/
fi
[ -d $BUILD/${PKG_NAME}[-_.]${PKG_VERSION} ] && PKG_BUILD=`ls -d $BUILD/${PKG_NAME}[-_.]${PKG_VERSION}`
[ -d $BUILD/${PKG_NAME}${PKG_VERSION} ] && PKG_BUILD=`ls -d $BUILD/${PKG_NAME}${PKG_VERSION}`
[ -d "$BUILD/${PKG_NAME}[-_.]${PKG_VERSION}" ] && PKG_BUILD=`ls -d $BUILD/${PKG_NAME}[-_.]${PKG_VERSION}`
[ -d "$BUILD/${PKG_NAME}${PKG_VERSION}" ] && PKG_BUILD=`ls -d $BUILD/${PKG_NAME}${PKG_VERSION}`
for i in $PKG_DIR/patches/$PKG_NAME-$PKG_VERSION*.patch ; do
if [ -f $i ]; then
if [ -f "$i" ]; then
PATCH=`basename $i`
PT=`echo $PATCH | sed 's/.*\.\(.*\)$/\1/'`
if [ "$PT" != "patch" -a "$PT" != "$TARGET_ARCH" ]; then
@ -67,7 +67,7 @@ done
$SCRIPTS/fixconfigtools $PKG_BUILD
[ -f $PKG_DIR/unpack ] && $PKG_DIR/unpack $@ >&$VERBOSE_OUT
[ -f "$PKG_DIR/unpack" ] && $PKG_DIR/unpack $@ >&$VERBOSE_OUT
rm -f $STAMPS/$1/build