From b873ddc1c6c82e33092204bdd5472f48e16495d9 Mon Sep 17 00:00:00 2001 From: Michael Haubenwallner Date: Mon, 27 Mar 2017 15:23:28 +0200 Subject: app-portage/prefix-chain-setup: bump, lookup functions.sh and make.conf Package-Manager: portage-2.3.3 --- .../prefix-chain-setup/files/prefix-chain-setup.in | 51 +++++++++++++++------- .../prefix-chain-setup-0.4-r5.ebuild | 22 ---------- .../prefix-chain-setup-0.5.ebuild | 23 ++++++++++ 3 files changed, 59 insertions(+), 37 deletions(-) delete mode 100644 app-portage/prefix-chain-setup/prefix-chain-setup-0.4-r5.ebuild create mode 100644 app-portage/prefix-chain-setup/prefix-chain-setup-0.5.ebuild (limited to 'app-portage') diff --git a/app-portage/prefix-chain-setup/files/prefix-chain-setup.in b/app-portage/prefix-chain-setup/files/prefix-chain-setup.in index 1d2f9b11a5da..dacb48318dfb 100644 --- a/app-portage/prefix-chain-setup/files/prefix-chain-setup.in +++ b/app-portage/prefix-chain-setup/files/prefix-chain-setup.in @@ -11,7 +11,22 @@ PORT_TMPDIR= # # get ourselfs the functions.sh script for ebegin/eend/etc. # -. "${PARENT_EPREFIX}"/sbin/functions.sh +for f in \ + /lib/gentoo/functions.sh \ + /etc/init.d/functions.sh \ + /sbin/functions.sh \ +; do + if [[ -r ${PARENT_EPREFIX}${f} ]]; then + . "${PARENT_EPREFIX}${f}" + f=found + break + fi +done + +if [[ ${f} != found ]]; then + echo "Cannot find Gentoo functions, aborting." >&2 + exit 1 +fi for arg in "$@"; do case "${arg}" in @@ -64,7 +79,7 @@ eend_exit() { ebegin "creating directory structure" ( set -e - mkdir -p "${CHILD_EPREFIX}"/etc + mkdir -p "${CHILD_EPREFIX}"/etc/portage mkdir -p "${CHILD_EPREFIX}"/var/log ) eend_exit $? @@ -82,13 +97,13 @@ ebegin "creating make.conf" echo "CFLAGS=\"$(portageq envvar CFLAGS)\"" echo "CXXFLAGS=\"$(portageq envvar CXXFLAGS)\"" echo "MAKEOPTS=\"$(portageq envvar MAKEOPTS)\"" - niceness=$(portageq envvar PORTAGE_NICENESS) + niceness=$(portageq envvar PORTAGE_NICENESS || true) [[ -n ${niceness} ]] && echo "PORTAGE_NICENESS=\"${niceness}\"" echo "USE=\"prefix-chaining\"" echo echo "# Mirrors from parent prefix." - echo "GENTOO_MIRRORS=\"$(portageq envvar GENTOO_MIRRORS)\"" + echo "GENTOO_MIRRORS=\"$(portageq envvar GENTOO_MIRRORS || true)\"" echo echo "#" echo "# Below comes the chained-prefix setup. Only change things" @@ -99,7 +114,7 @@ ebegin "creating make.conf" echo "# all that is possible" echo "#" echo "PORTDIR=\"$(portageq envvar PORTDIR)\"" - echo "SYNC=\"$(portageq envvar SYNC)\"" + echo "SYNC=\"$(portageq envvar SYNC || true)\"" if test -z "${PORT_TMPDIR}"; then case "${CHILD_PROFILE}" in *winnt*) echo "PORTAGE_TMPDIR=/var/tmp" ;; @@ -111,10 +126,15 @@ ebegin "creating make.conf" echo "READONLY_EPREFIX=\"${PARENT_EPREFIX}:DEPEND\"" if test "${DO_SOURCES}" == "yes"; then - # don't fail if nothing found - egrep "^source .*" "${PARENT_EPREFIX}/etc/make.conf" 2>/dev/null || true + # don't fail if nothing found + for f in /etc/portage/make.conf /etc/make.conf; do + if [[ -r ${PARENT_EPREFIX}${f} ]]; then + egrep "^source .*" "${PARENT_EPREFIX}${f}" 2>/dev/null || true + break; + fi + done fi -) > "${CHILD_EPREFIX}"/etc/make.conf +) > "${CHILD_EPREFIX}"/etc/portage/make.conf eend_exit $? # @@ -122,7 +142,7 @@ eend_exit $? # ebegin "creating make.profile" ( - ln -s "${CHILD_PROFILE}" "${CHILD_EPREFIX}/etc/make.profile" + ln -s "${CHILD_PROFILE}" "${CHILD_EPREFIX}/etc/portage/make.profile" ) eend_exit $? @@ -131,7 +151,7 @@ eend_exit $? # ebegin "adjusting permissions" ( - chmod 644 "${CHILD_EPREFIX}"/etc/make.conf + chmod 644 "${CHILD_EPREFIX}"/etc/portage/make.conf ) eend_exit $? @@ -142,22 +162,23 @@ ebegin "installing required basic packages" ( # this -pv is there to avoid the global update output, which is # there on the first emerge run. (thus, just cosmetics). - EPREFIX="${CHILD_EPREFIX}" emerge -p1qO baselayout > /dev/null 2>&1 + PORTAGE_CONFIGROOT="${CHILD_EPREFIX}" EPREFIX="${CHILD_EPREFIX}" emerge -p1qO baselayout-prefix > /dev/null 2>&1 - EPREFIX="${CHILD_EPREFIX}" emerge -1qO baselayout prefix-chain-utils + set -e + PORTAGE_CONFIGROOT="${CHILD_EPREFIX}" EPREFIX="${CHILD_EPREFIX}" emerge -1qO gentoo-functions baselayout-prefix prefix-chain-utils # merge with the parent's chost. this forces the use of the parent # compiler, which generally would be illegal - this is an exception. # This is required for example on winnt, because the wrapper has to # be able to use/resolve symlinks, etc. native winnt binaries miss that # ability, but interix binaries don't. - EPREFIX="${CHILD_EPREFIX}" CHOST="${PARENT_CHOST}" emerge -1qO gcc-config + PORTAGE_CONFIGROOT="${CHILD_EPREFIX}" EPREFIX="${CHILD_EPREFIX}" CHOST="${PARENT_CHOST}" emerge -1qO gcc-config # select the chain wrapper profile from gcc-config env -i "$(type -P bash)" "${CHILD_EPREFIX}"/usr/bin/gcc-config 1 # do this _AFTER_ selecting the correct compiler! - EPREFIX="${CHILD_EPREFIX}" emerge -1qO libtool + PORTAGE_CONFIGROOT="${CHILD_EPREFIX}" EPREFIX="${CHILD_EPREFIX}" emerge -1qO libtool ) eend_exit $? @@ -165,6 +186,6 @@ eend_exit $? # wow, all ok :) # ewarn -ewarn "all done. don't forget to tune ${CHILD_EPREFIX}/etc/make.conf." +ewarn "all done. don't forget to tune ${CHILD_EPREFIX}/etc/portage/make.conf." ewarn "to enter the new prefix, run \"${CHILD_EPREFIX}/startprefix\"." ewarn diff --git a/app-portage/prefix-chain-setup/prefix-chain-setup-0.4-r5.ebuild b/app-portage/prefix-chain-setup/prefix-chain-setup-0.4-r5.ebuild deleted file mode 100644 index 21ead2f506b0..000000000000 --- a/app-portage/prefix-chain-setup/prefix-chain-setup-0.4-r5.ebuild +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -inherit prefix - -DESCRIPTION="Chained EPREFIX bootstrapping utility" -HOMEPAGE="https://dev.gentoo.org/~mduft" -SRC_URI="" - -LICENSE="GPL-3" -SLOT="0" -KEYWORDS="~ppc-aix ~x64-cygwin ~x86-linux ~sparc-solaris ~x86-solaris" -IUSE="" - -DEPEND="" -RDEPEND="" - -src_install() { - cp "${FILESDIR}"/prefix-chain-setup.in "${T}"/prefix-chain-setup - eprefixify "${T}"/prefix-chain-setup - dobin "${T}"/prefix-chain-setup -} diff --git a/app-portage/prefix-chain-setup/prefix-chain-setup-0.5.ebuild b/app-portage/prefix-chain-setup/prefix-chain-setup-0.5.ebuild new file mode 100644 index 000000000000..1285b03d119a --- /dev/null +++ b/app-portage/prefix-chain-setup/prefix-chain-setup-0.5.ebuild @@ -0,0 +1,23 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +inherit prefix + +DESCRIPTION="Chained EPREFIX bootstrapping utility" +HOMEPAGE="https://dev.gentoo.org/~mduft" +SRC_URI="" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~ppc-aix ~x64-cygwin ~x86-linux ~sparc-solaris ~x86-solaris" +IUSE="" + +DEPEND="" +RDEPEND="" + +src_install() { + cp "${FILESDIR}"/prefix-chain-setup.in "${T}"/prefix-chain-setup + eprefixify "${T}"/prefix-chain-setup + sed -e "s,@GENTOO_PORTAGE_CHOST@,${CHOST}," -i "${T}"/prefix-chain-setup + dobin "${T}"/prefix-chain-setup +} -- cgit v1.2.3-65-gdbad