1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-14 07:27:10 +01:00
build/util/pkgcmd.sh
David Oberhollenzer c8d01f966a Use pkgtool to resolve and manage dependencies, add sub package support
Been working on this for too long, don't remember the specifics, will add
documentation.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-03 17:47:02 +01:00

28 lines
663 B
Bash

include_pkg() {
PKGNAME="$1" # globally visible package name
unset -f build deploy prepare check_update
unset -v VERSION TARBALL URL SRCDIR SHA256SUM DEPENDS SUBPKG
source "$SCRIPTDIR/pkg/$PKGNAME/build"
if [ -z "$SUBPKG" ]; then
SUBPKG="$PKGNAME"
fi
}
run_pkg_command() {
local FUNCTION="$1"
local DEPLOYDIR="$PKGDEPLOYDIR/$PKGNAME"
local LOGFILE="$PKGLOGDIR/${PKGNAME}-${FUNCTION}.log"
local SRC="$PKGSRCDIR/$SRCDIR"
echo "$PKGNAME - $FUNCTION"
mkdir -p "$PKGBUILDDIR" "$DEPLOYDIR"
pushd "$PKGBUILDDIR" > /dev/null
$FUNCTION "$SRC" "$DEPLOYDIR" &>> "$LOGFILE" < /dev/null
popd > /dev/null
(rmdir "$DEPLOYDIR" || true) 2> /dev/null ;
}