1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 19:19:46 +01:00
build/util/pkgcmd.sh
David Oberhollenzer 2147fbb3b2 Remove "-dev" prefix for development files
Instead of adding a prefix, move development files to a different
deploy directory.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-02-17 03:02:16 +01:00

26 lines
646 B
Bash

run_pkg_command() {
local FUNCTION="$1"
local DEPLOYDIR="$PKGDEPLOYDIR/$PKGNAME"
local DEVDEPLOYDIR="$PKGDEVDEPLOYDIR/$PKGNAME"
local CHECKFILE="$PKGLOGDIR/.${PKGNAME}-${FUNCTION}"
echo "$PKGNAME - $FUNCTION"
if [ -e "$CHECKFILE" ]; then
return
fi
local LOGFILE="$PKGLOGDIR/${PKGNAME}-${FUNCTION}.log"
local SRC="$PKGSRCDIR/$SRCDIR"
mkdir -p "$PKGBUILDDIR" "$DEPLOYDIR" "$DEVDEPLOYDIR"
pushd "$PKGBUILDDIR" > /dev/null
$FUNCTION "$SRC" "$DEPLOYDIR" "$DEVDEPLOYDIR" &>> "$LOGFILE" < /dev/null
popd > /dev/null
(rmdir "$DEPLOYDIR" || true) 2> /dev/null ;
(rmdir "$DEVDEPLOYDIR" || true) 2> /dev/null ;
touch "$CHECKFILE"
}