summaryrefslogtreecommitdiff
blob: 1b84ed3c28e14da07458b2e110657fa129fcb9cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash

. "@GENTOO_PORTAGE_EPREFIX@"/sbin/functions.sh
einfo "entering chained prefix @GENTOO_PORTAGE_EPREFIX@ ..."

# inform profiles very early of us beeing interactive (or at least,
# we will _start_ an interactive shell, so we want the according bits.)
set -i

. "@GENTOO_PORTAGE_EPREFIX@"/etc/profile

# if there is no local portage, foreign portage instances need to know 
# where to merge to - and thus we need to set EPREFIX.
# the other way round, if there is a local portage, EPREFIX may not
# point anywhere else than to our local EPREFIX or be unset...

# DISABLED: this is done by etc/profile now, to be able to start a
#           prefix environment by sourcing etc/profile.

#if [[ -x "@GENTOO_PORTAGE_EPREFIX@"/usr/bin/emerge ]]; then
#	if [[ -n "${EPREFIX}" ]] && [[ "${EPREFIX}" != "@GENTOO_PORTAGE_EPREFIX@" ]]; then
#		ewarn "EPREFIX is set. this will render portage unusable, unsetting"
#		unset EPREFIX
#	fi
#else
#	export EPREFIX="@GENTOO_PORTAGE_EPREFIX@"
#fi

# a common problem: the child has no less installed, but baselayout insists
# on setting PAGER to EPREFIX/usr/bin/less. everything gets back to normal
# when unsetting PAGER in this case.
if [[ ! -x "${PAGER}" ]]; then
	unset PAGER
fi

bash --noprofile
einfo "leaving chained prefix @GENTOO_PORTAGE_EPREFIX@ ..."