1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-25 20:30:43 +01:00

Move checkfile test to package main loop

- Only one checkfile per package, not per stage
 - Have to rebuild entire package on failure anyway
 - Faster build since we can simply guard toolchain restore
   with checkfile test

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-02-18 17:46:06 +01:00
parent b0e2497a99
commit b36d66bb9b
2 changed files with 12 additions and 16 deletions

16
mk.sh
View file

@ -65,14 +65,18 @@ done < "$PACKAGELIST"
echo "--- building package ---" echo "--- building package ---"
while read pkg; do while read pkg; do
include_pkg "$pkg" if [ ! -e "$PKGLOGDIR/.$pkg" ]; then
include_pkg "$pkg"
install_build_deps install_build_deps
run_pkg_command "build" run_pkg_command "build"
run_pkg_command "deploy" run_pkg_command "deploy"
rm -rf "$PKGBUILDDIR" rm -rf "$PKGBUILDDIR"
restore_toolchain restore_toolchain
touch "$PKGLOGDIR/.$pkg"
fi
done < "$PACKAGELIST" done < "$PACKAGELIST"

View file

@ -2,17 +2,11 @@ run_pkg_command() {
local FUNCTION="$1" local FUNCTION="$1"
local DEPLOYDIR="$PKGDEPLOYDIR/$PKGNAME" local DEPLOYDIR="$PKGDEPLOYDIR/$PKGNAME"
local DEVDEPLOYDIR="$PKGDEVDEPLOYDIR/$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 LOGFILE="$PKGLOGDIR/${PKGNAME}-${FUNCTION}.log"
local SRC="$PKGSRCDIR/$SRCDIR" local SRC="$PKGSRCDIR/$SRCDIR"
echo "$PKGNAME - $FUNCTION"
mkdir -p "$PKGBUILDDIR" "$DEPLOYDIR" "$DEVDEPLOYDIR" mkdir -p "$PKGBUILDDIR" "$DEPLOYDIR" "$DEVDEPLOYDIR"
pushd "$PKGBUILDDIR" > /dev/null pushd "$PKGBUILDDIR" > /dev/null
@ -21,6 +15,4 @@ run_pkg_command() {
(rmdir "$DEPLOYDIR" || true) 2> /dev/null ; (rmdir "$DEPLOYDIR" || true) 2> /dev/null ;
(rmdir "$DEVDEPLOYDIR" || true) 2> /dev/null ; (rmdir "$DEVDEPLOYDIR" || true) 2> /dev/null ;
touch "$CHECKFILE"
} }