2018-01-25 00:09:29 +01:00
|
|
|
run_pkg_command() {
|
2018-01-24 21:48:10 +01:00
|
|
|
local FUNCTION="$1"
|
2018-02-15 23:47:54 +01:00
|
|
|
local DEPLOYDIR="$PKGDEPLOYDIR/$PKGNAME"
|
|
|
|
local CHECKFILE="$PKGLOGDIR/.${PKGNAME}-${FUNCTION}"
|
2017-12-09 21:51:48 +01:00
|
|
|
|
2018-01-24 21:48:10 +01:00
|
|
|
echo "$PKGNAME - $FUNCTION"
|
2017-12-09 21:51:48 +01:00
|
|
|
|
|
|
|
if [ -e "$CHECKFILE" ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2018-02-15 23:47:54 +01:00
|
|
|
local LOGFILE="$PKGLOGDIR/${PKGNAME}-${FUNCTION}.log"
|
2017-12-09 21:51:48 +01:00
|
|
|
local SRC="$PKGSRCDIR/$SRCDIR"
|
|
|
|
|
2018-02-16 18:45:25 +01:00
|
|
|
mkdir -p "$DEPLOYDIR" "$PKGBUILDDIR" "${DEPLOYDIR}-dev"
|
2017-12-09 21:51:48 +01:00
|
|
|
|
2018-02-16 18:45:25 +01:00
|
|
|
pushd "$PKGBUILDDIR" > /dev/null
|
2018-02-16 23:22:04 +01:00
|
|
|
$FUNCTION "$SRC" "$DEPLOYDIR" "${DEPLOYDIR}-dev" &>> "$LOGFILE" < /dev/null
|
2017-12-09 21:51:48 +01:00
|
|
|
popd > /dev/null
|
|
|
|
|
|
|
|
(rmdir "$DEPLOYDIR" || true) 2> /dev/null ;
|
|
|
|
(rmdir "${DEPLOYDIR}-dev" || true) 2> /dev/null ;
|
|
|
|
|
|
|
|
touch "$CHECKFILE"
|
|
|
|
}
|