commit:     f3c51fb01b54321c026cfb2857ba3ee65cecaf98
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  4 07:25:15 2016 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Thu Jul  7 02:40:57 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=f3c51fb0

s/bootstrap-prefix.sh: remove EPREFIX/tmp after "emerge -e system".

  partially reverts 3a945696443b.

  A rerun of bootstrap script after "emerge -e system" failure
  should not go through stage1 again.

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

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index a46ccdf..e05c81a 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1520,12 +1520,6 @@ bootstrap_stage3() {
        # Switch to the proper portage.
        hash -r
 
-       # Get rid of the temporary tools.
-       if [[ -d ${ROOT}/tmp/var/tmp ]] ; then
-               rm -rf "${ROOT}"/tmp
-               mkdir "${ROOT}"/tmp
-       fi
-
        # Update the portage tree.
        treedate=$(date -f "${ROOT}"/usr/portage/metadata/timestamp +%s)
        nowdate=$(date +%s)
@@ -2173,7 +2167,13 @@ EOF
 
        hash -r  # tmp/* stuff is removed in stage3
 
-       if ! emerge -e system ; then
+       if emerge -e system ; then
+               # Now, after 'emerge -e system', we can get rid of the 
temporary tools.
+               if [[ -d ${EPREFIX}/tmp/var/tmp ]] ; then
+                       rm -Rf "${EPREFIX}"/tmp || return 1
+                       mkdir -p "${EPREFIX}"/tmp || return 1
+               fi
+       else
                # emerge -e system fail
                cat << EOF
 

Reply via email to