Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 509136 | Differences between
and this patch

Collapse All | Expand All

(-)prefix-portage-2.2.14.orig/bin/install-qa-check.d/05prefix (-2 / +28 lines)
Lines 79-94 Link Here
79
		# unprefixed shebang, is the script directly in $PATH or an init
79
		# unprefixed shebang, is the script directly in $PATH or an init
80
		# script?
80
		# script?
81
		if [[ ":${PATH}:${EPREFIX}/etc/init.d:" == *":${fp}:"* ]] ; then
81
		if [[ ":${PATH}:${EPREFIX}/etc/init.d:" == *":${fp}:"* ]] ; then
82
			if [[ -e ${EROOT}${line[0]} || -e ${ED}${line[0]} ]] ; then
82
			all_epfs="$PORTAGE_READONLY_EPREFIXES:$EPREFIX:$EROOT:$ED"
83
			save_IFS=$IFS
84
			IFS=:
85
			epfs=( $all_epfs )
86
			IFS=$save_IFS
87
88
			found=
89
			for x in "${epfs[@]}"; do
90
				[[ -z "${x}" ]] && continue
91
				check="${x}${line[0]}"
92
93
				# might already contain a prefix
94
				if [[ "${line[0]}" == "${x}"* ]]; then
95
					check="${line[0]}"
96
				fi
97
98
				if [[ -e ${check} ]]; then
99
					found="${check}"
100
				fi
101
			done
102
103
			if [[ -n ${found} ]] ; then
83
				# is it unprefixed, but we can just fix it because a
104
				# is it unprefixed, but we can just fix it because a
84
				# prefixed variant exists
105
				# prefixed variant exists
85
				eqawarn "prefixing shebang of ${fn#${D}}"
106
				eqawarn "prefixing shebang of ${fn#${D}}"
107
108
				if [[ ${found} == "${ED}"* || ${found} == "${EROOT}"* ]]; then
109
					found="${EPREFIX}${line[0]}"
110
				fi
111
86
				# statement is made idempotent on purpose, because
112
				# statement is made idempotent on purpose, because
87
				# symlinks may point to the same target, and hence the
113
				# symlinks may point to the same target, and hence the
88
				# same real file may be sedded multiple times since we
114
				# same real file may be sedded multiple times since we
89
				# read the shebangs in one go upfront for performance
115
				# read the shebangs in one go upfront for performance
90
				# reasons
116
				# reasons
91
				sed -i -e '1s:^#! \?'"${line[0]}"':#!'"${EPREFIX}"${line[0]}':' "${rf}"
117
				sed -i -e '1s:^#! \?'"${line[0]}"':#!'"${found}"':' "${rf}"
92
				continue
118
				continue
93
			else
119
			else
94
				# this is definitely wrong: script in $PATH and invalid shebang
120
				# this is definitely wrong: script in $PATH and invalid shebang
(-)prefix-portage-2.2.14.orig/bin/phase-helpers.sh (+28 lines)
Lines 758-763 Link Here
758
		"${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" has_version "${eroot}" "${atom}"
758
		"${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" has_version "${eroot}" "${atom}"
759
	fi
759
	fi
760
	local retval=$?
760
	local retval=$?
761
	if [[ ${retval} -eq 1 && -n ${READONLY_EPREFIX} ]]; then
762
		${SHELL} -c "EPREFIX='${READONLY_EPREFIX%:*}' EPYTHON= '${READONLY_EPREFIX%:*}'/usr/lib/portage/bin/portageq has_version '${READONLY_EPREFIX%:*}' '${atom}'"
763
		retval=$?
764
	fi
761
	case "${retval}" in
765
	case "${retval}" in
762
		0|1)
766
		0|1)
763
			return ${retval}
767
			return ${retval}
Lines 817-822 Link Here
817
		"${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" best_version "${eroot}" "${atom}"
821
		"${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" best_version "${eroot}" "${atom}"
818
	fi
822
	fi
819
	local retval=$?
823
	local retval=$?
824
	if [[ ${retval} -eq 1 && -n ${READONLY_EPREFIX} ]]; then
825
		${SHELL} -c "EPREFIX='${READONLY_EPREFIX%:*}' EPYTHON= '${READONLY_EPREFIX%:*}'/usr/lib/portage/bin/portageq best_version '${READONLY_EPREFIX%:*}' '${atom}'"
826
		retval=$?
827
	fi
820
	case "${retval}" in
828
	case "${retval}" in
821
		0|1)
829
		0|1)
822
			return ${retval}
830
			return ${retval}
Lines 846-851 Link Here
846
			output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" master_repositories "${EROOT}" "${repository}")
854
			output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" master_repositories "${EROOT}" "${repository}")
847
		fi
855
		fi
848
		retval=$?
856
		retval=$?
857
		if [[ ${retval} -eq 1 && -n ${READONLY_EPREFIX} ]]; then
858
			output=$(${SHELL} -c "EPREFIX='${READONLY_EPREFIX%:*}' EPYTHON= '${READONLY_EPREFIX%:*}'/usr/lib/portage/bin/portageq master_repositories '${READONLY_EPREFIX%:*}' '${repository}'")
859
			retval=$?
860
		fi
849
		[[ -n ${output} ]] && echo "${output}"
861
		[[ -n ${output} ]] && echo "${output}"
850
		case "${retval}" in
862
		case "${retval}" in
851
			0|1)
863
			0|1)
Lines 877-882 Link Here
877
			output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" get_repo_path "${EROOT}" "${repository}")
889
			output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" get_repo_path "${EROOT}" "${repository}")
878
		fi
890
		fi
879
		retval=$?
891
		retval=$?
892
		if [[ ${retval} -eq 1 && -n ${READONLY_EPREFIX} ]]; then
893
			output=$(${SHELL} -c "EPREFIX='${READONLY_EPREFIX%:*}' EPYTHON= '${READONLY_EPREFIX%:*}'/usr/lib/portage/bin/portageq repository_path '${READONLY_EPREFIX%:*}' '${repository}'")
894
			retval=$?
895
		fi
880
		[[ -n ${output} ]] && echo "${output}"
896
		[[ -n ${output} ]] && echo "${output}"
881
		case "${retval}" in
897
		case "${retval}" in
882
			0|1)
898
			0|1)
Lines 907-912 Link Here
907
			output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" available_eclasses "${EROOT}" "${repository}")
923
			output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" available_eclasses "${EROOT}" "${repository}")
908
		fi
924
		fi
909
		retval=$?
925
		retval=$?
926
		if [[ ${retval} -eq 1 && -n ${READONLY_EPREFIX} ]]; then
927
			output=$(${SHELL} -c "EPREFIX='${READONLY_EPREFIX%:*}' EPYTHON= '${READONLY_EPREFIX%:*}'/usr/lib/portage/bin/portageq available_eclasses '${READONLY_EPREFIX%:*}' '${repository}'")
928
			retval=$?
929
		fi
910
		[[ -n ${output} ]] && echo "${output}"
930
		[[ -n ${output} ]] && echo "${output}"
911
		case "${retval}" in
931
		case "${retval}" in
912
			0|1)
932
			0|1)
Lines 937-942 Link Here
937
		else
957
		else
938
			output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" eclass_path "${EROOT}" "${repository}" "${eclass}")
958
			output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" eclass_path "${EROOT}" "${repository}" "${eclass}")
939
		fi
959
		fi
960
		if [[ ${retval} -eq 1 && -n ${READONLY_EPREFIX} ]]; then
961
			output=$(${SHELL} -c "EPREFIX='${READONLY_EPREFIX%:*}' EPYTHON= '${READONLY_EPREFIX%:*}'/usr/lib/portage/bin/portageq eclass_path '${READONLY_EPREFIX%:*}' '${repository}' '${eclass}'")
962
			retval=$?
963
		fi
940
		retval=$?
964
		retval=$?
941
		[[ -n ${output} ]] && echo "${output}"
965
		[[ -n ${output} ]] && echo "${output}"
942
		case "${retval}" in
966
		case "${retval}" in
Lines 968-973 Link Here
968
		else
992
		else
969
			output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" license_path "${EROOT}" "${repository}" "${license}")
993
			output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" license_path "${EROOT}" "${repository}" "${license}")
970
		fi
994
		fi
995
		if [[ ${retval} -eq 1 && -n ${READONLY_EPREFIX} ]]; then
996
			output=(${SHELL} -c "EPREFIX='${READONLY_EPREFIX%:*}' EPYTHON= '${READONLY_EPREFIX%:*}'/usr/lib/portage/bin/portageq license_path '${READONLY_EPREFIX%:*}' '${repository}' '${license}'")
997
			retval=$?
998
		fi
971
		retval=$?
999
		retval=$?
972
		[[ -n ${output} ]] && echo "${output}"
1000
		[[ -n ${output} ]] && echo "${output}"
973
		case "${retval}" in
1001
		case "${retval}" in
(-)prefix-portage-2.2.14.orig/pym/_emerge/actions.py (-2 / +14 lines)
Lines 38-44 Link Here
38
from portage import shutil
38
from portage import shutil
39
from portage import eapi_is_supported, _encodings, _unicode_decode
39
from portage import eapi_is_supported, _encodings, _unicode_decode
40
from portage.cache.cache_errors import CacheError
40
from portage.cache.cache_errors import CacheError
41
from portage.const import EPREFIX
41
from portage.const import EPREFIX, BPREFIX
42
from portage.const import GLOBAL_CONFIG_PATH, VCS_DIRS, _DEPCLEAN_LIB_CHECK_DEFAULT
42
from portage.const import GLOBAL_CONFIG_PATH, VCS_DIRS, _DEPCLEAN_LIB_CHECK_DEFAULT
43
from portage.const import SUPPORTED_BINPKG_FORMATS, TIMESTAMP_FORMAT
43
from portage.const import SUPPORTED_BINPKG_FORMATS, TIMESTAMP_FORMAT
44
from portage.dbapi.dep_expand import dep_expand
44
from portage.dbapi.dep_expand import dep_expand
Lines 62-67 Link Here
62
from portage.util._async.run_main_scheduler import run_main_scheduler
62
from portage.util._async.run_main_scheduler import run_main_scheduler
63
from portage.util._async.SchedulerInterface import SchedulerInterface
63
from portage.util._async.SchedulerInterface import SchedulerInterface
64
from portage.util._eventloop.global_event_loop import global_event_loop
64
from portage.util._eventloop.global_event_loop import global_event_loop
65
from portage.util._path import exists_raise_eaccess
65
from portage._global_updates import _global_updates
66
from portage._global_updates import _global_updates
66
67
67
from _emerge.clear_caches import clear_caches
68
from _emerge.clear_caches import clear_caches
Lines 2629-2635 Link Here
2629
				out.eerror(line)
2630
				out.eerror(line)
2630
			return exitcode
2631
			return exitcode
2631
	elif repo.sync_type == "cvs":
2632
	elif repo.sync_type == "cvs":
2632
		if not os.path.exists(EPREFIX + "/usr/bin/cvs"):
2633
		cvs_bin = portage.process.find_binary("cvs")
2634
		if cvs_bin is None:
2633
			print("!!! %s/usr/bin/cvs does not exist, so CVS support is disabled." % (EPREFIX))
2635
			print("!!! %s/usr/bin/cvs does not exist, so CVS support is disabled." % (EPREFIX))
2634
			print("!!! Type \"emerge %s\" to enable CVS support." % portage.const.CVS_PACKAGE_ATOM)
2636
			print("!!! Type \"emerge %s\" to enable CVS support." % portage.const.CVS_PACKAGE_ATOM)
2635
			return os.EX_UNAVAILABLE
2637
			return os.EX_UNAVAILABLE
Lines 2697-2702 Link Here
2697
			writemsg_level(" %s spawn failed of %s\n" % (bad("*"), postsync,),
2699
			writemsg_level(" %s spawn failed of %s\n" % (bad("*"), postsync,),
2698
				level=logging.ERROR, noiselevel=-1)
2700
				level=logging.ERROR, noiselevel=-1)
2699
2701
2702
	postsync = os.path.join(BPREFIX, portage.USER_CONFIG_PATH, "bin", "post_sync")
2703
	if os.access(postsync, os.X_OK):
2704
		retval = portage.process.spawn([postsync, dosyncuri], env=settings.environ())
2705
		if retval != os.EX_OK:
2706
			writemsg_level(" %s spawn failed of %s\n" % (bad("*"), postsync,),
2707
				level=logging.ERROR, noiselevel=-1)
2708
2700
	return os.EX_OK
2709
	return os.EX_OK
2701
2710
2702
def action_uninstall(settings, trees, ldpath_mtimes,
2711
def action_uninstall(settings, trees, ldpath_mtimes,
Lines 3413-3418 Link Here
3413
	if portage.const.EPREFIX:
3422
	if portage.const.EPREFIX:
3414
		global_config_path = os.path.join(portage.const.EPREFIX,
3423
		global_config_path = os.path.join(portage.const.EPREFIX,
3415
				portage.const.GLOBAL_CONFIG_PATH.lstrip(os.sep))
3424
				portage.const.GLOBAL_CONFIG_PATH.lstrip(os.sep))
3425
		if not exists_raise_eaccess(global_config_path) and portage.const.BPREFIX:
3426
			global_config_path = os.path.join(portage.const.BPREFIX,
3427
                    portage.const.GLOBAL_CONFIG_PATH.lstrip(os.sep))
3416
	msg.append("        This usually means that '%s'" % \
3428
	msg.append("        This usually means that '%s'" % \
3417
		(os.path.join(global_config_path, "sets/portage.conf"),))
3429
		(os.path.join(global_config_path, "sets/portage.conf"),))
3418
	msg.append("        is missing or corrupt.")
3430
	msg.append("        is missing or corrupt.")
(-)prefix-portage-2.2.14.orig/pym/_emerge/depgraph.py (-21 / +30 lines)
Lines 2743-2765 Link Here
2743
				edepend["HDEPEND"] = ""
2743
				edepend["HDEPEND"] = ""
2744
2744
2745
		deps = (
2745
		deps = (
2746
			(depend_root, edepend["DEPEND"],
2746
			(depend_root, "DEPEND",
2747
				self._priority(buildtime=True,
2747
				self._priority(buildtime=True,
2748
				optional=(pkg.built or ignore_depend_deps),
2748
				optional=(pkg.built or ignore_depend_deps),
2749
				ignored=ignore_depend_deps)),
2749
				ignored=ignore_depend_deps)),
2750
			(self._frozen_config._running_root.root, edepend["HDEPEND"],
2750
			(self._frozen_config._running_root.root, "HDEPEND",
2751
				self._priority(buildtime=True,
2751
				self._priority(buildtime=True,
2752
				optional=(pkg.built or ignore_hdepend_deps),
2752
				optional=(pkg.built or ignore_hdepend_deps),
2753
				ignored=ignore_hdepend_deps)),
2753
				ignored=ignore_hdepend_deps)),
2754
			(myroot, edepend["RDEPEND"],
2754
			(myroot, "RDEPEND",
2755
				self._priority(runtime=True)),
2755
				self._priority(runtime=True)),
2756
			(myroot, edepend["PDEPEND"],
2756
			(myroot, "PDEPEND",
2757
				self._priority(runtime_post=True))
2757
				self._priority(runtime_post=True))
2758
		)
2758
		)
2759
2759
2760
		debug = "--debug" in self._frozen_config.myopts
2760
		debug = "--debug" in self._frozen_config.myopts
2761
2761
2762
		for dep_root, dep_string, dep_priority in deps:
2762
		for dep_root, dep_type, dep_priority in deps:
2763
				dep_string = edepend[dep_type]
2763
				if not dep_string:
2764
				if not dep_string:
2764
					continue
2765
					continue
2765
				if debug:
2766
				if debug:
Lines 2797-2803 Link Here
2797
2798
2798
				try:
2799
				try:
2799
					dep_string = list(self._queue_disjunctive_deps(
2800
					dep_string = list(self._queue_disjunctive_deps(
2800
						pkg, dep_root, dep_priority, dep_string))
2801
						pkg, dep_root, dep_priority, dep_string, dep_type))
2801
				except portage.exception.InvalidDependString as e:
2802
				except portage.exception.InvalidDependString as e:
2802
					if pkg.installed:
2803
					if pkg.installed:
2803
						self._dynamic_config._masked_installed.add(pkg)
2804
						self._dynamic_config._masked_installed.add(pkg)
Lines 2812-2825 Link Here
2812
2813
2813
				if not self._add_pkg_dep_string(
2814
				if not self._add_pkg_dep_string(
2814
					pkg, dep_root, dep_priority, dep_string,
2815
					pkg, dep_root, dep_priority, dep_string,
2815
					allow_unsatisfied):
2816
					allow_unsatisfied, dep_type):
2816
					return 0
2817
					return 0
2817
2818
2818
		self._dynamic_config._traversed_pkg_deps.add(pkg)
2819
		self._dynamic_config._traversed_pkg_deps.add(pkg)
2819
		return 1
2820
		return 1
2820
2821
2821
	def _add_pkg_dep_string(self, pkg, dep_root, dep_priority, dep_string,
2822
	def _add_pkg_dep_string(self, pkg, dep_root, dep_priority, dep_string,
2822
		allow_unsatisfied):
2823
		allow_unsatisfied, dep_type=None):
2823
		_autounmask_backup = self._dynamic_config._autounmask
2824
		_autounmask_backup = self._dynamic_config._autounmask
2824
		if dep_priority.optional or dep_priority.ignored:
2825
		if dep_priority.optional or dep_priority.ignored:
2825
			# Temporarily disable autounmask for deps that
2826
			# Temporarily disable autounmask for deps that
Lines 2828-2834 Link Here
2828
		try:
2829
		try:
2829
			return self._wrapped_add_pkg_dep_string(
2830
			return self._wrapped_add_pkg_dep_string(
2830
				pkg, dep_root, dep_priority, dep_string,
2831
				pkg, dep_root, dep_priority, dep_string,
2831
				allow_unsatisfied)
2832
				allow_unsatisfied, dep_type)
2832
		finally:
2833
		finally:
2833
			self._dynamic_config._autounmask = _autounmask_backup
2834
			self._dynamic_config._autounmask = _autounmask_backup
2834
2835
Lines 2864-2870 Link Here
2864
			not slot_operator_rebuild
2865
			not slot_operator_rebuild
2865
2866
2866
	def _wrapped_add_pkg_dep_string(self, pkg, dep_root, dep_priority,
2867
	def _wrapped_add_pkg_dep_string(self, pkg, dep_root, dep_priority,
2867
		dep_string, allow_unsatisfied):
2868
		dep_string, allow_unsatisfied, dep_type=None):
2868
		if isinstance(pkg.depth, int):
2869
		if isinstance(pkg.depth, int):
2869
			depth = pkg.depth + 1
2870
			depth = pkg.depth + 1
2870
		else:
2871
		else:
Lines 2888-2894 Link Here
2888
		try:
2889
		try:
2889
			selected_atoms = self._select_atoms(dep_root,
2890
			selected_atoms = self._select_atoms(dep_root,
2890
				dep_string, myuse=self._pkg_use_enabled(pkg), parent=pkg,
2891
				dep_string, myuse=self._pkg_use_enabled(pkg), parent=pkg,
2891
				strict=strict, priority=dep_priority)
2892
				strict=strict, priority=dep_priority, dep_type=dep_type)
2892
		except portage.exception.InvalidDependString:
2893
		except portage.exception.InvalidDependString:
2893
			if pkg.installed:
2894
			if pkg.installed:
2894
				self._dynamic_config._masked_installed.add(pkg)
2895
				self._dynamic_config._masked_installed.add(pkg)
Lines 3186-3192 Link Here
3186
					child_pkgs.sort()
3187
					child_pkgs.sort()
3187
				yield (atom, child_pkgs[-1])
3188
				yield (atom, child_pkgs[-1])
3188
3189
3189
	def _queue_disjunctive_deps(self, pkg, dep_root, dep_priority, dep_struct):
3190
	def _queue_disjunctive_deps(self, pkg, dep_root, dep_priority, dep_struct, dep_type=None):
3190
		"""
3191
		"""
3191
		Queue disjunctive (virtual and ||) deps in self._dynamic_config._dep_disjunctive_stack.
3192
		Queue disjunctive (virtual and ||) deps in self._dynamic_config._dep_disjunctive_stack.
3192
		Yields non-disjunctive deps. Raises InvalidDependString when
3193
		Yields non-disjunctive deps. Raises InvalidDependString when
Lines 3195-3227 Link Here
3195
		for x in dep_struct:
3196
		for x in dep_struct:
3196
			if isinstance(x, list):
3197
			if isinstance(x, list):
3197
				if x and x[0] == "||":
3198
				if x and x[0] == "||":
3198
					self._queue_disjunction(pkg, dep_root, dep_priority, [x])
3199
					self._queue_disjunction(pkg, dep_root, dep_priority, [x], dep_type)
3199
				else:
3200
				else:
3200
					for y in self._queue_disjunctive_deps(
3201
					for y in self._queue_disjunctive_deps(
3201
						pkg, dep_root, dep_priority, x):
3202
						pkg, dep_root, dep_priority, x, dep_type):
3202
						yield y
3203
						yield y
3203
			else:
3204
			else:
3204
				# Note: Eventually this will check for PROPERTIES=virtual
3205
				# Note: Eventually this will check for PROPERTIES=virtual
3205
				# or whatever other metadata gets implemented for this
3206
				# or whatever other metadata gets implemented for this
3206
				# purpose.
3207
				# purpose.
3207
				if x.cp.startswith('virtual/'):
3208
				if x.cp.startswith('virtual/'):
3208
					self._queue_disjunction(pkg, dep_root, dep_priority, [x])
3209
					self._queue_disjunction(pkg, dep_root, dep_priority, [x], dep_type)
3209
				else:
3210
				else:
3210
					yield x
3211
					yield x
3211
3212
3212
	def _queue_disjunction(self, pkg, dep_root, dep_priority, dep_struct):
3213
	def _queue_disjunction(self, pkg, dep_root, dep_priority, dep_struct, dep_type=None):
3213
		self._dynamic_config._dep_disjunctive_stack.append(
3214
		self._dynamic_config._dep_disjunctive_stack.append(
3214
			(pkg, dep_root, dep_priority, dep_struct))
3215
			(pkg, dep_root, dep_priority, dep_struct, dep_type))
3215
3216
3216
	def _pop_disjunction(self, allow_unsatisfied):
3217
	def _pop_disjunction(self, allow_unsatisfied):
3217
		"""
3218
		"""
3218
		Pop one disjunctive dep from self._dynamic_config._dep_disjunctive_stack, and use it to
3219
		Pop one disjunctive dep from self._dynamic_config._dep_disjunctive_stack, and use it to
3219
		populate self._dynamic_config._dep_stack.
3220
		populate self._dynamic_config._dep_stack.
3220
		"""
3221
		"""
3221
		pkg, dep_root, dep_priority, dep_struct = \
3222
		pkg, dep_root, dep_priority, dep_struct, dep_type = \
3222
			self._dynamic_config._dep_disjunctive_stack.pop()
3223
			self._dynamic_config._dep_disjunctive_stack.pop()
3223
		if not self._add_pkg_dep_string(
3224
		if not self._add_pkg_dep_string(
3224
			pkg, dep_root, dep_priority, dep_struct, allow_unsatisfied):
3225
			pkg, dep_root, dep_priority, dep_struct, allow_unsatisfied, dep_type):
3225
			return 0
3226
			return 0
3226
		return 1
3227
		return 1
3227
3228
Lines 4030-4036 Link Here
4030
			**portage._native_kwargs(kwargs))
4031
			**portage._native_kwargs(kwargs))
4031
4032
4032
	def _select_atoms_highest_available(self, root, depstring,
4033
	def _select_atoms_highest_available(self, root, depstring,
4033
		myuse=None, parent=None, strict=True, trees=None, priority=None):
4034
		myuse=None, parent=None, strict=True, trees=None, priority=None, dep_type=None):
4034
		"""This will raise InvalidDependString if necessary. If trees is
4035
		"""This will raise InvalidDependString if necessary. If trees is
4035
		None then self._dynamic_config._filtered_trees is used."""
4036
		None then self._dynamic_config._filtered_trees is used."""
4036
4037
Lines 4053-4058 Link Here
4053
		pkgsettings = self._frozen_config.pkgsettings[root]
4054
		pkgsettings = self._frozen_config.pkgsettings[root]
4054
		if trees is None:
4055
		if trees is None:
4055
			trees = self._dynamic_config._filtered_trees
4056
			trees = self._dynamic_config._filtered_trees
4057
4058
		# this one is needed to guarantee good readonly root
4059
		# resolution display in the merge list. required since
4060
		# parent (below) can be None
4061
		trees[root]["disp_parent"] = parent
4062
4063
4056
		mytrees = trees[root]
4064
		mytrees = trees[root]
4057
		atom_graph = digraph()
4065
		atom_graph = digraph()
4058
		if True:
4066
		if True:
Lines 4081-4087 Link Here
4081
4089
4082
				mycheck = portage.dep_check(depstring, None,
4090
				mycheck = portage.dep_check(depstring, None,
4083
					pkgsettings, myuse=myuse,
4091
					pkgsettings, myuse=myuse,
4084
					myroot=root, trees=trees)
4092
					myroot=root, trees=trees, dep_type=dep_type)
4085
			finally:
4093
			finally:
4086
				# restore state
4094
				# restore state
4087
				self._dynamic_config._autounmask = _autounmask_backup
4095
				self._dynamic_config._autounmask = _autounmask_backup
Lines 4152-4157 Link Here
4152
							continue
4160
							continue
4153
						node_stack.append((child_node, node, child_atom))
4161
						node_stack.append((child_node, node, child_atom))
4154
4162
4163
		trees[root].pop("disp_parent")
4155
		return selected_atoms
4164
		return selected_atoms
4156
4165
4157
	def _expand_virt_from_graph(self, root, atom):
4166
	def _expand_virt_from_graph(self, root, atom):
(-)prefix-portage-2.2.14.orig/pym/_emerge/resolver/output.py (-1 / +39 lines)
Lines 22-32 Link Here
22
from portage.package.ebuild.config import _get_feature_flags
22
from portage.package.ebuild.config import _get_feature_flags
23
from portage.package.ebuild._spawn_nofetch import spawn_nofetch
23
from portage.package.ebuild._spawn_nofetch import spawn_nofetch
24
from portage.output import ( blue, colorize, create_color_func,
24
from portage.output import ( blue, colorize, create_color_func,
25
	darkblue, darkgreen, green, nc_len, teal)
25
	darkblue, darkgreen, green, nc_len, teal, yellow, turquoise)
26
bad = create_color_func("BAD")
26
bad = create_color_func("BAD")
27
from portage._sets.base import InternalPackageSet
27
from portage._sets.base import InternalPackageSet
28
from portage.util import writemsg_stdout
28
from portage.util import writemsg_stdout
29
from portage.versions import best, cpv_getversion
29
from portage.versions import best, cpv_getversion
30
from portage.dep.dep_check import ro_selected
30
31
31
from _emerge.Blocker import Blocker
32
from _emerge.Blocker import Blocker
32
from _emerge.create_world_atom import create_world_atom
33
from _emerge.create_world_atom import create_world_atom
Lines 556-561 Link Here
556
			writemsg_stdout("%s\n" % (pkg,), noiselevel=-1)
557
			writemsg_stdout("%s\n" % (pkg,), noiselevel=-1)
557
		return
558
		return
558
559
560
	def print_readonly_prefix(self):
561
		"""Performs the actual output printing for the readonly prefix
562
		information stuff
563
		"""
564
		out = sys.stdout
565
566
        # print readonly selected packages
567
		if len(ro_selected) > 0:
568
			out.write("\n%s\n\n" % (darkgreen("Packages resolved from readonly installations:")))
569
570
		ro_mismatch_warning = False
571
		ro_dupcheck = []
572
		for x in ro_selected:
573
			tmp_type = x["type"].replace("END","")
574
			while len(tmp_type) < 4:
575
				tmp_type += " "
576
			if x["parent"] and str(x["atom"]) not in ro_dupcheck:
577
				out.write("[%s %s] %s %s %s (%s by %s)" % (teal("readonly"),
578
					green(tmp_type), green(str(x["matches"][0])), yellow("from"),
579
					blue(x["ro_root"]), turquoise(str(x["atom"])), green(x["parent"].cpv)))
580
581
				ro_dupcheck.append(str(x["atom"]))
582
583
				if x["host_mismatch"]:
584
					ro_mismatch_warning = True
585
					out.write(" %s\n" % (red("**")))
586
				else:
587
					out.write("\n")
588
589
		if ro_mismatch_warning:
590
			out.write("\n%s:" % (red("**")))
591
			out.write(yellow(" WARNING: packages marked with ** have been resolved as a\n"))
592
			out.write(yellow("    runtime dependency, but the CHOST variable for the parent\n"))
593
			out.write(yellow("    and dependency package don't match. This could cause link\n"))
594
			out.write(yellow("    errors. It is recommended to use RDEPEND READONLY_EPREFIX's\n"))
595
			out.write(yellow("    only with matching CHOST portage instances.\n"))
559
596
560
	def print_verbose(self, show_repos):
597
	def print_verbose(self, show_repos):
561
		"""Prints the verbose output to std_out
598
		"""Prints the verbose output to std_out
Lines 907-912 Link Here
907
		# now finally print out the messages
944
		# now finally print out the messages
908
		self.print_messages(show_repos)
945
		self.print_messages(show_repos)
909
		self.print_blockers()
946
		self.print_blockers()
947
		self.print_readonly_prefix()
910
		if self.conf.verbosity == 3:
948
		if self.conf.verbosity == 3:
911
			self.print_verbose(show_repos)
949
			self.print_verbose(show_repos)
912
		for pkg, pkg_info in self.restrict_fetch_list.items():
950
		for pkg, pkg_info in self.restrict_fetch_list.items():
(-)prefix-portage-2.2.14.orig/pym/portage/const.py (+6 lines)
Lines 187-192 Link Here
187
	"notitles",
187
	"notitles",
188
	"parallel-fetch",
188
	"parallel-fetch",
189
	"parallel-install",
189
	"parallel-install",
190
	"prefix-chaining",
190
	"prelink-checksums",
191
	"prelink-checksums",
191
	"preserve-libs",
192
	"preserve-libs",
192
	"protect-owned",
193
	"protect-owned",
Lines 265-270 Link Here
265
#EPREFIX = ""
266
#EPREFIX = ""
266
# END PREFIX LOCAL
267
# END PREFIX LOCAL
267
268
269
BPREFIX = EPREFIX
270
271
# --prefix commandline arg always rules, ends up in os.environ["EPREFIX"]
272
if "EPREFIX" in os.environ:
273
    os.environ["PORTAGE_OVERRIDE_EPREFIX"] = os.environ["EPREFIX"]
268
# pick up EPREFIX from the environment if set
274
# pick up EPREFIX from the environment if set
269
if "PORTAGE_OVERRIDE_EPREFIX" in os.environ:
275
if "PORTAGE_OVERRIDE_EPREFIX" in os.environ:
270
	EPREFIX = os.environ["PORTAGE_OVERRIDE_EPREFIX"]
276
	EPREFIX = os.environ["PORTAGE_OVERRIDE_EPREFIX"]
(-)prefix-portage-2.2.14.orig/pym/portage/dbapi/vartree.py (-5 / +29 lines)
Lines 184-191 Link Here
184
		self._counter_path = os.path.join(self._eroot,
184
		self._counter_path = os.path.join(self._eroot,
185
			CACHE_PATH, "counter")
185
			CACHE_PATH, "counter")
186
186
187
		self._plib_registry = PreservedLibsRegistry(settings["ROOT"],
187
		plibreg_path = os.path.join(self._eroot, PRIVATE_PATH, "preserved_libs_registry")
188
			os.path.join(self._eroot, PRIVATE_PATH, "preserved_libs_registry"))
188
189
		if vartree:
190
			self._kill_eprefix = vartree._kill_eprefix
191
		else:
192
			self._kill_eprefix = False
193
194
		if self._kill_eprefix:
195
			self._aux_cache_filename = self._aux_cache_filename.replace(EPREFIX, "")
196
			self._counter_path = self._counter_path.replace(EPREFIX, "")
197
			plibreg_path = plibreg_path.replace(EPREFIX, "")
198
199
		self._plib_registry = PreservedLibsRegistry(settings["ROOT"], plibreg_path)
189
		self._linkmap = LinkageMap(self)
200
		self._linkmap = LinkageMap(self)
190
		chost = self.settings.get('CHOST')
201
		chost = self.settings.get('CHOST')
191
		if not chost:
202
		if not chost:
Lines 215-220 Link Here
215
		# This is an optimized hotspot, so don't use unicode-wrapped
226
		# This is an optimized hotspot, so don't use unicode-wrapped
216
		# os module and don't use os.path.join().
227
		# os module and don't use os.path.join().
217
		rValue = self._eroot + VDB_PATH + _os.sep + mykey
228
		rValue = self._eroot + VDB_PATH + _os.sep + mykey
229
		if self._kill_eprefix:
230
			rValue = rValue.replace(EPREFIX, "")
231
218
		if filename is not None:
232
		if filename is not None:
219
			# If filename is always relative, we can do just
233
			# If filename is always relative, we can do just
220
			# rValue += _os.sep + filename
234
			# rValue += _os.sep + filename
Lines 440-445 Link Here
440
		returnme = []
454
		returnme = []
441
		basepath = os.path.join(self._eroot, VDB_PATH) + os.path.sep
455
		basepath = os.path.join(self._eroot, VDB_PATH) + os.path.sep
442
456
457
		if self._kill_eprefix:
458
			basepath = os.path.join(self.root, basepath.replace(EPREFIX, ""))
459
443
		if use_cache:
460
		if use_cache:
444
			from portage import listdir
461
			from portage import listdir
445
		else:
462
		else:
Lines 530-540 Link Here
530
				del self.matchcache[mycat]
547
				del self.matchcache[mycat]
531
			return list(self._iter_match(mydep,
548
			return list(self._iter_match(mydep,
532
				self.cp_list(mydep.cp, use_cache=use_cache)))
549
				self.cp_list(mydep.cp, use_cache=use_cache)))
550
551
		_tmp_path = os.path.join(self._eroot, VDB_PATH, mycat)
552
553
		if self._kill_eprefix:
554
			_tmp_path = _tmp_path.replace(EPREFIX, "")
555
533
		try:
556
		try:
534
			if sys.hexversion >= 0x3030000:
557
			if sys.hexversion >= 0x3030000:
535
				curmtime = os.stat(os.path.join(self._eroot, VDB_PATH, mycat)).st_mtime_ns
558
				curmtime = os.stat(_tmp_path).st_mtime_ns
536
			else:
559
			else:
537
				curmtime = os.stat(os.path.join(self._eroot, VDB_PATH, mycat)).st_mtime
560
				curmtime = os.stat(_tmp_path).st_mtime
538
		except (IOError, OSError):
561
		except (IOError, OSError):
539
			curmtime=0
562
			curmtime=0
540
563
Lines 1339-1345 Link Here
1339
class vartree(object):
1362
class vartree(object):
1340
	"this tree will scan a var/db/pkg database located at root (passed to init)"
1363
	"this tree will scan a var/db/pkg database located at root (passed to init)"
1341
	def __init__(self, root=None, virtual=DeprecationWarning, categories=None,
1364
	def __init__(self, root=None, virtual=DeprecationWarning, categories=None,
1342
		settings=None):
1365
		settings=None, kill_eprefix=None):
1343
1366
1344
		if settings is None:
1367
		if settings is None:
1345
			settings = portage.settings
1368
			settings = portage.settings
Lines 1357-1362 Link Here
1357
				" constructor is unused",
1380
				" constructor is unused",
1358
				DeprecationWarning, stacklevel=2)
1381
				DeprecationWarning, stacklevel=2)
1359
1382
1383
		self._kill_eprefix = kill_eprefix
1360
		self.settings = settings
1384
		self.settings = settings
1361
		self.dbapi = vardbapi(settings=settings, vartree=self)
1385
		self.dbapi = vardbapi(settings=settings, vartree=self)
1362
		self.populated = 1
1386
		self.populated = 1
(-)prefix-portage-2.2.14.orig/pym/portage/dep/dep_check.py (-1 / +98 lines)
Lines 247-252 Link Here
247
	__slots__ = ('atoms', 'slot_map', 'cp_map', 'all_available',
247
	__slots__ = ('atoms', 'slot_map', 'cp_map', 'all_available',
248
		'all_installed_slots')
248
		'all_installed_slots')
249
249
250
ro_trees={}
251
ro_vartrees={}
252
ro_selected=[]
253
254
def dep_match_readonly_roots(settings, atom, dep_type, parent=None):
255
   if len(ro_trees) < len(settings.readonly_prefixes):
256
       # MDUFT: create additional vartrees for every readonly root here.
257
       # the ro_vartrees instances are created below as they are needed to
258
       # avoid reading vartrees of portage instances which aren't required
259
       # while resolving this dependencies.
260
       for type in ("DEPEND","RDEPEND", "PDEPEND"):
261
           ro_trees[type] = []
262
263
           for ro_root, ro_dep_types in settings.readonly_prefixes.items():
264
               if type in ro_dep_types:
265
                   ro_trees[type].append(ro_root)
266
267
   if len(ro_trees) == 0:
268
       return []
269
270
   matches = []
271
272
   for ro_root in ro_trees[dep_type]:
273
       if not ro_vartrees.has_key(ro_root):
274
           # target_root=ro_root ok? or should it be the real target_root?
275
           _tmp_settings = portage.config(config_root=ro_root, target_root=ro_root,
276
               config_incrementals=portage.const.INCREMENTALS)
277
278
           ro_vartrees[ro_root] = portage.vartree(root=ro_root,
279
               categories=_tmp_settings.categories,
280
               settings=_tmp_settings, kill_eprefix=True)
281
282
       ro_matches = ro_vartrees[ro_root].dbapi.match(atom)
283
284
       if ro_matches:
285
           ro_host_mismatch = False
286
           if dep_type is "RDEPEND":
287
               # we need to assure binary compatability, so it needs to be
288
               # the same CHOST! But how? for now i cannot do anything...
289
               if parent and parent.metadata["CHOST"] != ro_vartrees[ro_root].settings.get("CHOST", ""):
290
                   # provocate a big fat warning in the list of external packages.
291
                   ro_host_mismatch = True
292
               pass
293
294
           matches.append({ "ro_root": ro_root, "atom": atom, "matches": ro_matches,
295
               "type": dep_type, "parent": parent, "host_mismatch": ro_host_mismatch })
296
297
   return matches
298
299
def dep_wordreduce_readonly(reduced, unreduced, settings, dep_type, parent):
300
   for mypos, token in enumerate(unreduced):
301
       # recurse if it's a list.
302
       if isinstance(reduced[mypos], list):
303
           reduced[mypos] = dep_wordreduce_readonly(reduced[mypos],
304
               unreduced[mypos], settings, dep_type, parent)
305
306
       # do nothing if it's satisfied already.
307
       elif not reduced[mypos]:
308
           ro_matches = dep_match_readonly_roots(settings, unreduced[mypos], dep_type, parent)
309
310
           if ro_matches:
311
               # TODO: select a match if there are more than one?
312
               # for now, the first match is taken...
313
               ro_selected.append(ro_matches[0])
314
               reduced[mypos] = True
315
316
   return reduced
317
318
# this may be better placed somewhere else, but i put it here for now, to
319
# keep all functions in the patch on one big heap.
320
def readonly_pathmatch_any(settings, path):
321
   path = path.lstrip('/')
322
   # first try locally, and match that if it exists.
323
   if os.path.exists(os.path.join(EPREFIX,path)):
324
       return os.path.join(EPREFIX,path)
325
326
   # after that try all readonly roots where DEPEND is allowed. this makes
327
   # sure that executing binaries is possible from there.
328
   for ro_root, ro_deps in settings.readonly_roots.items():
329
       if "DEPEND" in ro_deps:
330
           print(" --- checking %s --- " % (os.path.join(ro_root,path)))
331
           if os.path.exists(os.path.join(ro_root,path)):
332
               return os.path.join(ro_root,path)
333
           break
334
335
   # as a fallback make the string the same as it was originally.
336
   # even though this path doesn't exist.
337
   return os.path.join(EPREFIX,path)
338
250
def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
339
def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
251
	"""
340
	"""
252
	Takes an unreduced and reduced deplist and removes satisfied dependencies.
341
	Takes an unreduced and reduced deplist and removes satisfied dependencies.
Lines 567-573 Link Here
567
	assert(False) # This point should not be reachable
656
	assert(False) # This point should not be reachable
568
657
569
def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None,
658
def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None,
570
	use_cache=1, use_binaries=0, myroot=None, trees=None):
659
	use_cache=1, use_binaries=0, myroot=None, trees=None, dep_type=None):
571
	"""
660
	"""
572
	Takes a depend string, parses it, and selects atoms.
661
	Takes a depend string, parses it, and selects atoms.
573
	The myroot parameter is unused (use mysettings['EROOT'] instead).
662
	The myroot parameter is unused (use mysettings['EROOT'] instead).
Lines 663-668 Link Here
663
	writemsg("mysplit:  %s\n" % (mysplit), 1)
752
	writemsg("mysplit:  %s\n" % (mysplit), 1)
664
	writemsg("mysplit2: %s\n" % (mysplit2), 1)
753
	writemsg("mysplit2: %s\n" % (mysplit2), 1)
665
754
755
	if dep_type is not None:
756
		mysplit2=dep_wordreduce_readonly(unreduced=mysplit[:],
757
				reduced=mysplit2, settings=mysettings,
758
				dep_type=dep_type, parent=trees[myroot].get("disp_parent"))
759
760
		writemsg("\n", 1)
761
		writemsg("mysplit2 after readonly reduce: %s\n" % (mysplit2), 1)
762
666
	selected_atoms = dep_zapdeps(mysplit, mysplit2, myroot,
763
	selected_atoms = dep_zapdeps(mysplit, mysplit2, myroot,
667
		use_binaries=use_binaries, trees=trees)
764
		use_binaries=use_binaries, trees=trees)
668
765
(-)prefix-portage-2.2.14.orig/pym/portage/package/ebuild/_config/LocationsManager.py (+3 lines)
Lines 285-290 Link Here
285
		if portage.const.EPREFIX:
285
		if portage.const.EPREFIX:
286
			self.global_config_path = os.path.join(portage.const.EPREFIX,
286
			self.global_config_path = os.path.join(portage.const.EPREFIX,
287
				GLOBAL_CONFIG_PATH.lstrip(os.sep))
287
				GLOBAL_CONFIG_PATH.lstrip(os.sep))
288
			if not exists_raise_eaccess(self.global_config_path) and portage.const.BPREFIX:
289
				self.global_config_path = os.path.join(portage.const.BPREFIX,
290
					GLOBAL_CONFIG_PATH.lstrip(os.sep))
288
291
289
	def set_port_dirs(self, portdir, portdir_overlay):
292
	def set_port_dirs(self, portdir, portdir_overlay):
290
		self.portdir = portdir
293
		self.portdir = portdir
(-)prefix-portage-2.2.14.orig/pym/portage/package/ebuild/config.py (+62 lines)
Lines 298-303 Link Here
298
			self.features = features_set(self)
298
			self.features = features_set(self)
299
			self.features._features = copy.deepcopy(clone.features._features)
299
			self.features._features = copy.deepcopy(clone.features._features)
300
			self._features_overrides = copy.deepcopy(clone._features_overrides)
300
			self._features_overrides = copy.deepcopy(clone._features_overrides)
301
			self.readonly_prefixes = copy.deepcopy(clone.readonly_prefixes)
301
302
302
			#Strictly speaking _license_manager is not immutable. Users need to ensure that
303
			#Strictly speaking _license_manager is not immutable. Users need to ensure that
303
			#extract_global_changes() is called right after __init__ (if at all).
304
			#extract_global_changes() is called right after __init__ (if at all).
Lines 894-899 Link Here
894
895
895
			self._validate_commands()
896
			self._validate_commands()
896
897
898
			# expand READONLY_EPREFIX to a list of all readonly portage instances
899
			# all the way down to the last one. beware that ATM a deeper instance
900
			# in the chain can provide more than the toplevel! this means that
901
			# if you only inherit DEPENDS from one instance, that instance may
902
			# inherit RDEPENDs from another one, making the top-level instance
903
			# inherit RDEPENDs from there too - even if the intermediate prefix
904
			# does not do this.
905
			self.readonly_prefixes = {}
906
			ro_cfg_root = config_root
907
			ro_widest_depset = set(['DEPEND', 'RDEPEND', 'PDEPEND'])
908
909
			while ro_cfg_root:
910
				ro_make_conf_paths = [
911
					os.path.join(ro_cfg_root, 'etc', 'make.conf'),
912
					os.path.join(ro_cfg_root, MAKE_CONF_FILE)
913
				]
914
				try:
915
					if os.path.samefile(*ro_make_conf_paths):
916
						ro_make_conf_paths.pop()
917
				except OSError:
918
					pass
919
920
				ro_cfg_root = None
921
				for ro_make_conf in ro_make_conf_paths:
922
					if not os.path.exists(ro_make_conf):
923
						continue
924
925
					ro_cfg = getconfig(ro_make_conf, tolerant=True, allow_sourcing=True)
926
					if not ro_cfg.has_key("READONLY_EPREFIX"):
927
						continue
928
929
					if not ro_cfg["READONLY_EPREFIX"].find(":"):
930
						raise portage.exception.InvalidReadonlyERoot("ERROR: malformed READONLY_EPREFIX in %s" % (ro_make_conf))
931
932
					if ro_cfg_root is not None:
933
						raise portage.exception.InvalidReadonlyERoot("ERROR: duplicate READONLY_EPREFIX in %s and %s" % tuple(ro_make_conf_paths))
934
935
					(ro_cfg_root,ro_cfg_root_deps) = ro_cfg["READONLY_EPREFIX"].rsplit(":",1)
936
937
					if not os.path.exists(ro_cfg_root):
938
						raise portage.exception.InvalidReadonlyERoot("ERROR: malformed READONLY_EPREFIX in %s: %s does not exist!" % (ro_make_conf, ro_cfg_root))
939
940
					if os.path.samefile(ro_cfg_root, config_root):
941
						raise portage.exception.InvalidReadonlyERoot("ERROR: cannot add this instance (%s) as READONLY_EPREFIX in %s." % (ro_cfg_root, ro_make_conf))
942
943
					if self.readonly_prefixes.has_key(ro_cfg_root):
944
						raise portage.exception.InvalidReadonlyERoot("ERROR: circular READONLY_EPREFIX's in %s. %s already checked for %s" % (ro_make_conf, ro_cfg_root, self.readonly_prefixes[ro_cfg_root])) 
945
946
					# intersect the widest depset with the current one to strip down
947
					# the allowed dependency resolution to not be wider than the
948
					# next higher one. this way we can prevent for a given prefix
949
					# to resolve RDEPENDs from a prefix with a different CHOST that
950
					# is a few levels deeper in the chain.
951
					ro_widest_depset = set(ro_cfg_root_deps.split(",")) & ro_widest_depset
952
					self.readonly_prefixes[ro_cfg_root] = ro_widest_depset
953
				pass
954
897
			for k in self._case_insensitive_vars:
955
			for k in self._case_insensitive_vars:
898
				if k in self:
956
				if k in self:
899
					self[k] = self[k].lower()
957
					self[k] = self[k].lower()
Lines 2671-2676 Link Here
2671
		if not eapi_exports_merge_type(eapi):
2729
		if not eapi_exports_merge_type(eapi):
2672
			mydict.pop("MERGE_TYPE", None)
2730
			mydict.pop("MERGE_TYPE", None)
2673
2731
2732
		# populate with PORTAGE_READONLY_EPREFIXES
2733
		if self.readonly_prefixes and len(self.readonly_prefixes) > 0:
2734
			mydict["PORTAGE_READONLY_EPREFIXES"] = ':'.join(self.readonly_prefixes)
2735
2674
		# Prefix variables are supported beginning with EAPI 3, or when
2736
		# Prefix variables are supported beginning with EAPI 3, or when
2675
		# force-prefix is in FEATURES, since older EAPIs would otherwise be
2737
		# force-prefix is in FEATURES, since older EAPIs would otherwise be
2676
		# useless with prefix configurations. This brings compatibility with
2738
		# useless with prefix configurations. This brings compatibility with
(-)prefix-portage-2.2.14.orig/pym/portage/package/ebuild/doebuild.py (-2 / +23 lines)
Lines 46-51 Link Here
46
	unmerge, _encodings, _os_merge, \
46
	unmerge, _encodings, _os_merge, \
47
	_shell_quote, _unicode_decode, _unicode_encode
47
	_shell_quote, _unicode_decode, _unicode_encode
48
from portage.const import EBUILD_SH_ENV_FILE, EBUILD_SH_ENV_DIR, \
48
from portage.const import EBUILD_SH_ENV_FILE, EBUILD_SH_ENV_DIR, \
49
    GLOBAL_CONFIG_PATH, \
49
	EBUILD_SH_BINARY, INVALID_ENV_FILE, MISC_SH_BINARY, PORTAGE_PYM_PACKAGES, EPREFIX, MACOSSANDBOX_PROFILE
50
	EBUILD_SH_BINARY, INVALID_ENV_FILE, MISC_SH_BINARY, PORTAGE_PYM_PACKAGES, EPREFIX, MACOSSANDBOX_PROFILE
50
from portage.data import portage_gid, portage_uid, secpass, \
51
from portage.data import portage_gid, portage_uid, secpass, \
51
	uid, userpriv_groups
52
	uid, userpriv_groups
Lines 66-72 Link Here
66
from portage.package.ebuild.prepare_build_dirs import prepare_build_dirs
67
from portage.package.ebuild.prepare_build_dirs import prepare_build_dirs
67
from portage.util import apply_recursive_permissions, \
68
from portage.util import apply_recursive_permissions, \
68
	apply_secpass_permissions, noiselimit, normalize_path, \
69
	apply_secpass_permissions, noiselimit, normalize_path, \
69
	writemsg, writemsg_stdout, write_atomic
70
	writemsg, writemsg_stdout, write_atomic, getconfig
71
from portage.util._path import exists_raise_eaccess
70
from portage.util.lafilefixer import rewrite_lafile	
72
from portage.util.lafilefixer import rewrite_lafile	
71
from portage.versions import _pkgsplit
73
from portage.versions import _pkgsplit
72
from _emerge.BinpkgEnvExtractor import BinpkgEnvExtractor
74
from _emerge.BinpkgEnvExtractor import BinpkgEnvExtractor
Lines 212-219 Link Here
212
		path.append(os.path.join(portage_bin_path, "ebuild-helpers", "bsd"))
214
		path.append(os.path.join(portage_bin_path, "ebuild-helpers", "bsd"))
213
215
214
	path.append(os.path.join(portage_bin_path, "ebuild-helpers"))
216
	path.append(os.path.join(portage_bin_path, "ebuild-helpers"))
217
218
	# PREFIX CHAINING: append default path for all prefixes involved
219
	pfxs = [ eprefix ]
220
	pfxs.extend(settings.readonly_prefixes)
221
	for prefix in pfxs:
222
		global_config_path = os.path.join(prefix, GLOBAL_CONFIG_PATH.lstrip(os.sep))
223
		make_globals_path = os.path.join(global_config_path, "make.globals")
224
		if exists_raise_eaccess(make_globals_path):
225
			expand_map = { "EPREFIX": prefix }
226
			pxcfg = getconfig(make_globals_path, True, expand_map)
227
			pxdefp = [x for x in pxcfg.get("DEFAULT_PATH", "").split(":") if x]
228
			for x in pxdefp:
229
				if x.startswith(prefix) and not x in path:
230
					path.append(x)
231
		else:
232
			pxdefs = [prefix + "/usr/sbin", prefix + "/usr/bin", prefix + "/sbin", prefix + "/bin"]
233
			path.extend(pxdefs)
234
	# END PREFIX CHAINING
235
215
	path.extend(prerootpath)
236
	path.extend(prerootpath)
216
	path.extend(defaultpath)
237
	# path.extend(defaultpath) # PREFIX CHAINING appends the default path for involved prefixes above
217
	path.extend(rootpath)
238
	path.extend(rootpath)
218
	path.extend(extrapath)
239
	path.extend(extrapath)
219
	# END PREFIX LOCAL
240
	# END PREFIX LOCAL
(-)prefix-portage-2.2.14.orig/pym/portage/package/ebuild/fetch.py (+4 lines)
Lines 43-48 Link Here
43
from portage.util import apply_recursive_permissions, \
43
from portage.util import apply_recursive_permissions, \
44
	apply_secpass_permissions, ensure_dirs, grabdict, shlex_split, \
44
	apply_secpass_permissions, ensure_dirs, grabdict, shlex_split, \
45
	varexpand, writemsg, writemsg_level, writemsg_stdout
45
	varexpand, writemsg, writemsg_level, writemsg_stdout
46
from portage.util._path import exists_raise_eaccess
46
from portage.process import spawn
47
from portage.process import spawn
47
48
48
_userpriv_spawn_kwargs = (
49
_userpriv_spawn_kwargs = (
Lines 869-874 Link Here
869
				global_config_path = GLOBAL_CONFIG_PATH
870
				global_config_path = GLOBAL_CONFIG_PATH
870
				if portage.const.EPREFIX:
871
				if portage.const.EPREFIX:
871
					global_config_path = os.path.join(portage.const.EPREFIX,
872
					global_config_path = os.path.join(portage.const.EPREFIX,
873
						GLOBAL_CONFIG_PATH.lstrip(os.sep))
874
					if not exists_raise_eaccess(global_config_path) and portage.const.BPREFIX:
875
						global_config_path = os.path.join(portage.const.BPREFIX,
872
							GLOBAL_CONFIG_PATH.lstrip(os.sep))
876
							GLOBAL_CONFIG_PATH.lstrip(os.sep))
873
877
874
				missing_file_param = False
878
				missing_file_param = False
(-)prefix-portage-2.2.14.orig/pym/portage/_sets/__init__.py (+5 lines)
Lines 28-33 Link Here
28
from portage.exception import PackageSetNotFound
28
from portage.exception import PackageSetNotFound
29
from portage.localization import _
29
from portage.localization import _
30
from portage.util import writemsg_level
30
from portage.util import writemsg_level
31
from portage.util._path import exists_raise_eaccess
31
32
32
SETPREFIX = "@"
33
SETPREFIX = "@"
33
34
Lines 299-304 Link Here
299
	if portage.const.EPREFIX:
300
	if portage.const.EPREFIX:
300
		global_config_path = os.path.join(portage.const.EPREFIX,
301
		global_config_path = os.path.join(portage.const.EPREFIX,
301
			GLOBAL_CONFIG_PATH.lstrip(os.sep))
302
			GLOBAL_CONFIG_PATH.lstrip(os.sep))
303
		if not exists_raise_eaccess(global_config_path) and portage.const.BPREFIX:
304
			global_config_path = os.path.join(portage.const.BPREFIX,
305
				GLOBAL_CONFIG_PATH.lstrip(os.sep))
306
302
	def _getfiles():
307
	def _getfiles():
303
		for path, dirs, files in os.walk(os.path.join(global_config_path, "sets")):
308
		for path, dirs, files in os.walk(os.path.join(global_config_path, "sets")):
304
			for f in files:
309
			for f in files:
(-)prefix-portage-2.2.14.orig/pym/portage/util/_dyn_libs/LinkageMapELF.py (-2 / +2 lines)
Lines 17-23 Link Here
17
from portage.util import grabfile
17
from portage.util import grabfile
18
from portage.util import normalize_path
18
from portage.util import normalize_path
19
from portage.util import writemsg_level
19
from portage.util import writemsg_level
20
from portage.const import EPREFIX
20
from portage.const import BPREFIX
21
21
22
class LinkageMapELF(object):
22
class LinkageMapELF(object):
23
23
Lines 235-241 Link Here
235
					continue
235
					continue
236
				plibs.update((x, cpv) for x in items)
236
				plibs.update((x, cpv) for x in items)
237
		if plibs:
237
		if plibs:
238
			args = [EPREFIX + "/usr/bin/scanelf", "-qF", "%a;%F;%S;%r;%n"]
238
			args = [BPREFIX + "/usr/bin/scanelf", "-qF", "%a;%F;%S;%r;%n"]
239
			args.extend(os.path.join(root, x.lstrip("." + os.sep)) \
239
			args.extend(os.path.join(root, x.lstrip("." + os.sep)) \
240
				for x in plibs)
240
				for x in plibs)
241
			try:
241
			try:

Return to bug 509136