commit:     94b33c1bc3251401014b010c9b983ff7365058bb
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 15 08:02:16 2016 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Wed Jun 15 08:02:16 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=94b33c1b

scripts/bootstrap-prefix.sh: setup android overlay as staged RAP repo.

      setup name databases.

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

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 7096801..828043f 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -238,6 +238,34 @@ bootstrap_setup() {
                } > "${ROOT}"/etc/portage/make.conf
        fi
 
+       if is-rap && [[ ! -f ${ROOT}/etc/portage/repos.conf ]] ; then
+               cat <<EOF >"${ROOT}"/etc/portage/repos.conf
+[DEFAULT]
+main-repo = gentoo
+eclass-overrides = rap
+
+[gentoo]
+location = ${ROOT}/usr/portage
+sync-type = rsync
+sync-uri = rsync://rsync.gentoo.org/gentoo-portage
+
+[rap]
+location = ${ROOT}/usr/portage-stage
+sync-type = git
+sync-uri = https://anongit.gentoo.org/git/proj/android.git
+auto-sync = no
+EOF
+       fi
+
+       if is-rap ; then
+               [[ -f ${ROOT}/etc/passwd ]] || getent passwd > 
"${ROOT}"/etc/passwd || \
+                       ln -sf {,"${ROOT}"}/etc/passwd
+               [[ -f ${ROOT}/etc/group ]] || getent group > 
"${ROOT}"/etc/group || \
+                       ln -sf {,"${ROOT}"}/etc/group
+               [[ -f ${ROOT}/etc/resolv.conf ]] || ln -s 
{,"${ROOT}"}/etc/resolv.conf
+               [[ -f ${ROOT}/etc/hosts ]] || cp {,"${ROOT}"}/etc/hosts
+       fi
+
        local linux=$(rapx linux-standalone linux)
        
        case ${CHOST} in
@@ -419,6 +447,10 @@ bootstrap_tree() {
        else
                do_tree http://dev.gentoo.org/~grobian/distfiles 
prefix-overlay-${PV}.tar.bz2
        fi
+       if is-rap; then
+               PORTDIR="${ROOT}/usr/portage-stage" \
+                      do_tree http://dev.gentoo.org/~heroxbd 
android-master.tar.bz2
+       fi
 }
 
 bootstrap_startscript() {
@@ -528,7 +560,9 @@ bootstrap_portage() {
 
        [[ -e "${ROOT}"/tmp/usr/portage ]] || ln -s "${PORTDIR}" 
"${ROOT}"/tmp/usr/portage
 
-       if [[ -s ${PORTDIR}/profiles/repo_name ]]; then
+       if is-rap; then
+               cp -f "${ROOT}"/etc/portage/repos.conf 
"${ROOT}"/tmp/usr/share/portage/config/repos.conf
+       elif [[ -s ${PORTDIR}/profiles/repo_name ]]; then
                # sync portage's repos.conf with the tree being used
                sed -i -e 
"s,gentoo_prefix,$(<"${PORTDIR}"/profiles/repo_name)," 
"${ROOT}"/tmp/usr/share/portage/config/repos.conf || return 1
        fi

Reply via email to