mirror of
https://github.com/pygos/build.git
synced 2024-11-05 03:27:10 +01:00
df68358afd
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
27 lines
698 B
Bash
27 lines
698 B
Bash
run_pkg_command() {
|
|
local FUNCTION="$1"
|
|
local DEPLOYDIR="$PKGDEPLOYDIR/$2"
|
|
local OUT="$PKGBUILDDIR/${PKGDIR}-${PKGNAME}"
|
|
local CHECKFILE="$PKGLOGDIR/.${PKGDIR}-${PKGNAME}-${FUNCTION}"
|
|
|
|
echo "$PKGNAME - $FUNCTION"
|
|
|
|
if [ -e "$CHECKFILE" ]; then
|
|
return
|
|
fi
|
|
|
|
local LOGFILE="$PKGLOGDIR/${PKGDIR}-${PKGNAME}-${FUNCTION}.log"
|
|
local SRC="$PKGSRCDIR/$SRCDIR"
|
|
|
|
mkdir -p "$DEPLOYDIR" "$OUT" "${DEPLOYDIR}-dev"
|
|
|
|
pushd "$OUT" > /dev/null
|
|
$FUNCTION "$SRC" "$OUT" "$DEPLOYDIR" "${DEPLOYDIR}-dev" &>> "$LOGFILE" < /dev/null
|
|
popd > /dev/null
|
|
|
|
(rmdir "$DEPLOYDIR" || true) 2> /dev/null ;
|
|
(rmdir "$OUT" || true) 2> /dev/null ;
|
|
(rmdir "${DEPLOYDIR}-dev" || true) 2> /dev/null ;
|
|
|
|
touch "$CHECKFILE"
|
|
}
|