From 3bcab636b4addc4ca6e083334caf68b09e097690 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 2 Sep 2019 21:55:32 +0200 Subject: Switch to persistent container --- scripts/bootstrap/builder.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'scripts/bootstrap/builder.sh') diff --git a/scripts/bootstrap/builder.sh b/scripts/bootstrap/builder.sh index 89ff9d0..c16fce1 100644 --- a/scripts/bootstrap/builder.sh +++ b/scripts/bootstrap/builder.sh @@ -1,11 +1,23 @@ #! /bin/bash -emerge --usepkg --buildpkg --keep-going --update --deep --with-bdeps=y --newuse @world -status=$? +# ENVIRONMENTAL PARAMETERS +# REBUILD_INTERVAL (days), manual if not specified +# REBUILD_FAILED (days), manual if not specified -if [ $status -ne 0 ]; then - while [ 1 ]; do +# This is intended as permanent container +while [ 1 ]; do + emerge --usepkg --buildpkg --keep-going --update --deep --with-bdeps=y --newuse @world + status=$? + + if [ $status -eq 0 ]; then + echo "Emerge successful" + [ -n "$REBUILD_INTERVAL" ] && echo "Rebuild is scheduled in $REBUILD_INTERVAL days" + bash /etc/portage/scripts/bootstrap/builder_sleep.sh "$REBUILD_INTERVAL" + bash /etc/portage/scripts/bootstrap/builder_sync.sh + else echo "Emerge crashed with error code: $status" - sleep 21600 - done + [ -n "$REBUILD_FAILED" ] && echo "Automatic rebuild is scheduled in $REBUILD_FAILED days" + bash /etc/portage/scripts/bootstrap/builder_sleep.sh "$REBUILD_FAILED" + [ -n "$REBUILD_FAILED" ] && bash /etc/portage/scripts/bootstrap/builder_sync.sh + fi fi -- cgit v1.2.1