commit: 19d921bfc563897c6ee35e75f34095eae13a2d02 Author: Benda Xu <heroxbd <AT> gentoo <DOT> org> AuthorDate: Thu May 26 09:48:19 2016 +0000 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org> CommitDate: Wed Jun 15 07:59:44 2016 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=19d921bf
scripts/bootstrap-prefix.sh: rap helpers for profiles and portage tree. scripts/bootstrap-prefix.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index 3c57b92..2c8e5f1 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -7,6 +7,8 @@ trap 'exit 1' TERM KILL INT QUIT ABRT # some basic output functions eerror() { echo "!!! $*" 1>&2; } einfo() { echo "* $*"; } +is-rap() { [[ ${BASH_SOURCE} = *rap.sh ]]; } +rapx() { is-rap && echo $1 || echo $2; } # prefer gtar over tar [[ x$(type -t gtar) == "xfile" ]] \ @@ -235,6 +237,8 @@ bootstrap_setup() { echo 'FETCHCOMMAND="bash -c \"echo I need \${FILE} from \${URI} in \${DISTDIR}; read\""' } > "${ROOT}"/etc/portage/make.conf fi + + local linux=$(rapx linux-standalone linux) case ${CHOST} in powerpc-apple-darwin7) @@ -261,22 +265,22 @@ bootstrap_setup() { profile="prefix/darwin/macos/10.$((rev - 4))/x64" ;; i*86-pc-linux-gnu) - profile="prefix/linux/x86" + profile="prefix/${linux}/x86" ;; x86_64-pc-linux-gnu) - profile="prefix/linux/amd64" + profile="prefix/${linux}/amd64" ;; ia64-pc-linux-gnu) - profile="prefix/linux/ia64" + profile="prefix/${linux}/ia64" ;; powerpc-unknown-linux-gnu) - profile="prefix/linux/ppc" + profile="prefix/${linux}/ppc" ;; powerpc64-unknown-linux-gnu) - profile="prefix/linux/ppc64" + profile="prefix/${linux}/ppc64" ;; armv7l-pc-linux-gnu) - profile="prefix/linux/arm" + profile="prefix/${linux}/arm" ;; sparc-sun-solaris2.9) profile="prefix/sunos/solaris/5.9/sparc" @@ -408,6 +412,7 @@ do_tree() { } bootstrap_tree() { + is-rap && LATEST_TREE_YES=1 local PV="20160614" if [[ -n ${LATEST_TREE_YES} ]]; then do_tree "${SNAPSHOT_URL}" portage-latest.tar.bz2 @@ -2404,9 +2409,10 @@ export PORTDIR=${PORTDIR:-"${ROOT}/usr/portage"} export DISTDIR=${DISTDIR:-"${PORTDIR}/distfiles"} PORTAGE_TMPDIR=${PORTAGE_TMPDIR:-${ROOT}/tmp/var/tmp} DISTFILES_URL=${DISTFILES_URL:-"http://dev.gentoo.org/~grobian/distfiles"} -SNAPSHOT_URL=${SNAPSHOT_URL:-"http://rsync.prefix.bitzolder.nl/snapshots"} GNU_URL=${GNU_URL:="http://ftp.gnu.org/gnu"} GENTOO_MIRRORS=${GENTOO_MIRRORS:="http://distfiles.gentoo.org"} +SNAPSHOT_HOST=$(rapx ${GENTOO_MIRRORS} http://rsync.prefix.bitzolder.nl) +SNAPSHOT_URL=${SNAPSHOT_URL:-"${SNAPSHOT_HOST}/snapshots"} GCC_APPLE_URL="http://www.opensource.apple.com/darwinsource/tarballs/other" export MAKE CONFIG_SHELL