commit:     032ef433319e81ca59fd4e064059fab3dc11bada
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 25 17:12:30 2019 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Mon Mar 25 17:16:52 2019 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=032ef433

bootstrap-prefix.sh: emerging prefix-toolkit if available

Still create /startprefix when app-portage/prefix-toolkit is not
available in the tree.

Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>

 scripts/bootstrap-prefix.sh | 35 ++++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 94040d941d..7d6d808d87 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -607,22 +607,27 @@ bootstrap_startscript() {
                eerror "automate starting your prefix, set SHELL and rerun this 
script" > /dev/stderr
                return 1
        fi
-       einfo "Creating the Prefix start script (startprefix)"
-       # currently I think right into the prefix is the best location, as
-       # putting it in /bin or /usr/bin just hides it some more for the
-       # user
-       if is-rap ; then
-               mkdir -p "${ROOT}"/usr/portage/scripts
-               wget $([[ $(wget -h) == *"--no-check-certificate"* ]] && echo 
--no-check-certificate) \
-                    
https://gitweb.gentoo.org/repo/proj/prefix.git/plain/scripts/startprefix.in \
-                    -O "${ROOT}"/usr/portage/scripts/startprefix.in
-       fi
+       if [[ -d ${ROOT}/usr/portage/app-portage/prefix-toolkit ]] ; then
+               einfo "Finally, emerging prefix-toolkit for your convenience"
+               emerge -u app-portage/prefix-toolkit || return 1
+       else
+               einfo "Creating the Prefix start script (startprefix)"
+               # currently I think right into the prefix is the best location, 
as
+               # putting it in /bin or /usr/bin just hides it some more for the
+               # user
+               if is-rap ; then
+                       mkdir -p "${ROOT}"/usr/portage/scripts
+                       wget $([[ $(wget -h) == *"--no-check-certificate"* ]] 
&& echo --no-check-certificate) \
+                                
https://gitweb.gentoo.org/repo/proj/prefix.git/plain/scripts/startprefix.in \
+                                -O "${ROOT}"/usr/portage/scripts/startprefix.in
+               fi
 
-       sed \
-               -e "s|@GENTOO_PORTAGE_EPREFIX@|${ROOT}|g" \
-               "${ROOT}"/usr/portage/scripts/startprefix.in \
-               > "${ROOT}"/startprefix
-       chmod 755 "${ROOT}"/startprefix
+               sed \
+                       -e "s|@GENTOO_PORTAGE_EPREFIX@|${ROOT}|g" \
+                       "${ROOT}"/usr/portage/scripts/startprefix.in \
+                       > "${ROOT}"/startprefix
+               chmod 755 "${ROOT}"/startprefix
+       fi
        einfo "To start Gentoo Prefix, run the script ${ROOT}/startprefix"
        einfo "You can copy this file to a more convenient place if you like."
 

Reply via email to