1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 11:09:46 +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

4
mk.sh
View file

@ -65,6 +65,7 @@ done < "$PACKAGELIST"
echo "--- building package ---"
while read pkg; do
if [ ! -e "$PKGLOGDIR/.$pkg" ]; then
include_pkg "$pkg"
install_build_deps
@ -74,5 +75,8 @@ while read pkg; do
rm -rf "$PKGBUILDDIR"
restore_toolchain
touch "$PKGLOGDIR/.$pkg"
fi
done < "$PACKAGELIST"

View file

@ -2,17 +2,11 @@ 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"
echo "$PKGNAME - $FUNCTION"
mkdir -p "$PKGBUILDDIR" "$DEPLOYDIR" "$DEVDEPLOYDIR"
pushd "$PKGBUILDDIR" > /dev/null
@ -21,6 +15,4 @@ run_pkg_command() {
(rmdir "$DEPLOYDIR" || true) 2> /dev/null ;
(rmdir "$DEVDEPLOYDIR" || true) 2> /dev/null ;
touch "$CHECKFILE"
}