commit:     f6bbc6f47013448193cbc328645c0cdfb679bfea
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 13 13:52:10 2020 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Jun 13 13:52:10 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=f6bbc6f4

scripts/bootstrap-prefix: allow stopping after stage{1,2,3}

export STOP_BOOTSTRAP_AFTER to stage1, stage2 or stage3 to make the
interactive bootstrap stop after finishing the mentioned stage.  This
will be useless for most, but handy for certain automated setups.

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 scripts/bootstrap-prefix.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 84e31751be..c9391bf75c 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -2767,6 +2767,8 @@ EOF
                exit 1
        fi
 
+       [[ ${STOP_BOOTSTRAP_AFTER} == stage1 ]] && exit 0
+
        unset ROOT
 
        # stage1 has set a profile, which defines CHOST, so unset any CHOST
@@ -2816,6 +2818,8 @@ EOF
                exit 1
        fi
 
+       [[ ${STOP_BOOTSTRAP_AFTER} == stage2 ]] && exit 0
+
        # new bash
        hash -r
 
@@ -2854,6 +2858,8 @@ EOF
                exit 1
        fi
 
+       [[ ${STOP_BOOTSTRAP_AFTER} == stage3 ]] && exit 0
+
        local cmd="emerge -e system"
        if [[ -e ${EPREFIX}/var/cache/edb/mtimedb ]] && \
                grep -q resume "${EPREFIX}"/var/cache/edb/mtimedb ;

Reply via email to