mirror of
https://github.com/pygos/build.git
synced 2024-11-14 15:37:11 +01:00
ec9e6f8857
This way, we can have sysroot packages with the same name as toolchain packages. Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
41 lines
994 B
Bash
41 lines
994 B
Bash
run_pkg_command_common() {
|
|
local NAME="$1"
|
|
local FUNCTION="$2"
|
|
local PKGDIR="$3"
|
|
local DEPLOYDIR="$PKGDEPLOYDIR/$4"
|
|
local OUT="$PKGBUILDDIR/$5"
|
|
local CHECKFILE="$PKGLOGDIR/.${6}-${FUNCTION}"
|
|
|
|
echo "$NAME - $FUNCTION"
|
|
|
|
if [ -e "$CHECKFILE" ]; then
|
|
return
|
|
fi
|
|
|
|
unset -f build deploy prepare
|
|
unset -v VERSION TARBALL URL SRCDIR SHA256SUM
|
|
source "$SCRIPTDIR/$PKGDIR/$NAME/build"
|
|
|
|
local LOGFILE="$PKGLOGDIR/${7}-${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"
|
|
}
|
|
|
|
run_pkg_command() {
|
|
run_pkg_command_common "$1" "$2" "pkg" "$1" "$1" "$1" "$1"
|
|
}
|
|
|
|
run_tcpkg_command() {
|
|
run_pkg_command_common "$1" "$2" "tcpkg" "toolchain" "tc-$1" "tc-$1" "tc-$1"
|
|
}
|