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

Collapse All | Expand All

(-)file_not_specified_in_diff (-25 / +25 lines)
Line  Link Here
0
-- files/boost.eselect-0.4
0
++ files/boost.eselect-0.4
Lines 17-23 Link Here
17
find_targets() {
17
find_targets() {
18
	local f
18
	local f
19
	# use ls here to get a really empty set in case no boost is installed
19
	# use ls here to get a really empty set in case no boost is installed
20
	for d in $(ls -d "${ROOT}"/usr/share/boost-eselect/profiles/* 2>/dev/null) ; do
20
	for d in $(ls -d "${EROOT}"/usr/share/boost-eselect/profiles/* 2>/dev/null) ; do
21
		for p in "${d}"/* ; do
21
		for p in "${d}"/* ; do
22
			echo "boost-$(basename ${d})/$(basename ${p})"
22
			echo "boost-$(basename ${d})/$(basename ${p})"
23
		done
23
		done
Lines 28-34 Link Here
28
	echo "Removing symlinks from old version"
28
	echo "Removing symlinks from old version"
29
29
30
	local link
30
	local link
31
	for link in "${ROOT}/usr/include/boost" "${ROOT}/usr/share/boostbook" ; do
31
	for link in "${EROOT}/usr/include/boost" "${EROOT}/usr/share/boostbook" ; do
32
		if [[ -L "${link}" ]] ; then
32
		if [[ -L "${link}" ]] ; then
33
			rm "${link}" || die -q "Couldn't remove \"${link}\" symlink"
33
			rm "${link}" || die -q "Couldn't remove \"${link}\" symlink"
34
		else
34
		else
Lines 36-50 Link Here
36
		fi
36
		fi
37
	done
37
	done
38
38
39
	pushd "${ROOT}/usr/%LIBDIR%" 1>/dev/null
39
	pushd "${EROOT}/usr/%LIBDIR%" 1>/dev/null
40
	local lib
40
	local lib
41
	for lib in libboost_*.{a,so} ; do
41
	for lib in libboost_*.{a,so,dylib} ; do
42
		[[ -L "${lib}" && "${lib}" != libboost_*[[:digit:]]_[[:digit:]][[:digit:]]@(${_suffices}).@(a|so) ]] || continue
42
		[[ -L "${lib}" && "${lib}" != libboost_*[[:digit:]]_[[:digit:]][[:digit:]]@(${_suffices}).@(a|so|dylib) ]] || continue
43
		rm "${lib}" || die -q "Unable to remove \"/usr/%LIBDIR%/${lib}\" symlink"
43
		rm "${lib}" || die -q "Unable to remove \"/usr/%LIBDIR%/${lib}\" symlink"
44
	done
44
	done
45
	popd 1>/dev/null
45
	popd 1>/dev/null
46
46
47
	pushd "${ROOT}"/usr/bin 1>/dev/null
47
	pushd "${EROOT}"/usr/bin 1>/dev/null
48
	local tool
48
	local tool
49
	for tool in ${_boost_tools} ; do
49
	for tool in ${_boost_tools} ; do
50
		[[ -L "${tool}" ]] && ( rm "${tool}" || die -q "Unable to remove \"/usr/bin/${tool}\" symlink" )
50
		[[ -L "${tool}" ]] && ( rm "${tool}" || die -q "Unable to remove \"/usr/bin/${tool}\" symlink" )
Lines 53-59 Link Here
53
53
54
	local python_module python_module_dir
54
	local python_module python_module_dir
55
	for python_module in mpi.py mpi_debug.py ; do
55
	for python_module in mpi.py mpi_debug.py ; do
56
		for python_module_dir in "${ROOT}"usr/%LIBDIR%/python*/site-packages ; do
56
		for python_module_dir in "${EROOT}"usr/%LIBDIR%/python*/site-packages ; do
57
			if [[ -e "${python_module_dir}/${python_module}" ]] ; then
57
			if [[ -e "${python_module_dir}/${python_module}" ]] ; then
58
				rm "${python_module_dir}/${python_module}" || die -q "Unable to remove \"${python_module_dir}/${python_module}\""
58
				rm "${python_module_dir}/${python_module}" || die -q "Unable to remove \"${python_module_dir}/${python_module}\""
59
			fi
59
			fi
Lines 62-68 Link Here
62
62
63
	# Deprecated code for older versions of Boost.
63
	# Deprecated code for older versions of Boost.
64
	local mod="mpi.so"
64
	local mod="mpi.so"
65
	for moddir in "${ROOT}"/usr/%LIBDIR%/python*/site-packages ; do
65
	for moddir in "${EROOT}"/usr/%LIBDIR%/python*/site-packages ; do
66
		if [ -L "${moddir}/${mod}" ] ; then
66
		if [ -L "${moddir}/${mod}" ] ; then
67
			rm "${moddir}/${mod}" || die -q "Unable to remove \"${moddir}/${mod}\" symlink"
67
			rm "${moddir}/${mod}" || die -q "Unable to remove \"${moddir}/${mod}\" symlink"
68
		else
68
		else
Lines 74-86 Link Here
74
	for python_module in ${python_modules} ; do
74
	for python_module in ${python_modules} ; do
75
		local target_python_module="${python_module#*:}"
75
		local target_python_module="${python_module#*:}"
76
		local wrapper_python_module="${python_module%:*}"
76
		local wrapper_python_module="${python_module%:*}"
77
		echo "from ${target_python_module} import *" > "${ROOT}${wrapper_python_module}" || die -q "Couldn't create wrapper python module \"$(pwd)/${wrapper_python_module}\""
77
		echo "from ${target_python_module} import *" > "${EROOT}${wrapper_python_module}" || die -q "Couldn't create wrapper python module \"$(pwd)/${wrapper_python_module}\""
78
	done
78
	done
79
79
80
	if [ -L "${ROOT}/etc/eselect/boost/active" ] ; then
80
	if [ -L "${EROOT}/etc/eselect/boost/active" ] ; then
81
		rm  "${ROOT}/etc/eselect/boost/active" || die -q "Unable to remove \"${ROOT}/etc/eselect/boost/active\" symlink"
81
		rm  "${EROOT}/etc/eselect/boost/active" || die -q "Unable to remove \"${EROOT}/etc/eselect/boost/active\" symlink"
82
	else
82
	else
83
		[[ -e "${ROOT}/etc/eselect/boost/active" ]] && die -q "\"${ROOT}/etc/eselect/boost/active\" exists and isn't a symlink"
83
		[[ -e "${EROOT}/etc/eselect/boost/active" ]] && die -q "\"${EROOT}/etc/eselect/boost/active\" exists and isn't a symlink"
84
	fi
84
	fi
85
}
85
}
86
86
Lines 95-104 Link Here
95
	version="${version/boost-}"
95
	version="${version/boost-}"
96
	version="${version/./_}"
96
	version="${version/./_}"
97
97
98
	cd "${ROOT}/etc/eselect/boost"
98
	cd "${EROOT}/etc/eselect/boost"
99
	ln -s "${ROOT}/usr/share/boost-eselect/profiles/${target//boost-}" active || die -q "Couldn't create symlink active -> /usr/share/boost-eselect/profiles/${target//boost-}/${profile}"
99
	ln -s "${EROOT}/usr/share/boost-eselect/profiles/${target//boost-}" active || die -q "Couldn't create symlink active -> /usr/share/boost-eselect/profiles/${target//boost-}/${profile}"
100
100
101
	. "${ROOT}/usr/share/boost-eselect/profiles/${target//boost-}"
101
	. "${EROOT}/usr/share/boost-eselect/profiles/${target//boost-}"
102
102
103
	for t in ${dirs} ${bins} ${libs} ; do
103
	for t in ${dirs} ${bins} ${libs} ; do
104
		[[ -e "${ROOT}${t}" ]] || die -q "\"${t}\" listed as target does not exist"
104
		[[ -e "${ROOT}${t}" ]] || die -q "\"${t}\" listed as target does not exist"
Lines 112-126 Link Here
112
	done
112
	done
113
113
114
	[[ -d "${ROOT}${includes}" ]] || die -q "\"${includes}\" does not exist"
114
	[[ -d "${ROOT}${includes}" ]] || die -q "\"${includes}\" does not exist"
115
	pushd "${ROOT}/usr/include" 1>/dev/null
115
	pushd "${EROOT}/usr/include" 1>/dev/null
116
	ln -s ${includes//\/usr\/include\/} boost || die -q "Couldn't create symlink \"/usr/include/boost\""
116
	ln -s ${includes//"${EROOT}/usr/include/"} boost || die -q "Couldn't create symlink \"/usr/include/boost\""
117
	popd 1>/dev/null
117
	popd 1>/dev/null
118
118
119
	local python_module
119
	local python_module
120
	for python_module in ${python_modules} ; do
120
	for python_module in ${python_modules} ; do
121
		local target_python_module="${python_module#*:}"
121
		local target_python_module="${python_module#*:}"
122
		local wrapper_python_module="${python_module%:*}"
122
		local wrapper_python_module="${python_module%:*}"
123
		echo "from ${target_python_module} import *" > "${ROOT}${wrapper_python_module}" || die -q "Couldn't create wrapper python module \"$(pwd)/${wrapper_python_module}\""
123
		echo "from ${target_python_module} import *" > "${EROOT}${wrapper_python_module}" || die -q "Couldn't create wrapper python module \"$(pwd)/${wrapper_python_module}\""
124
	done
124
	done
125
125
126
	# Deprecated code for older versions of Boost.
126
	# Deprecated code for older versions of Boost.
Lines 144-151 Link Here
144
	local include
144
	local include
145
145
146
	write_list_start "Current boost version:"
146
	write_list_start "Current boost version:"
147
	if [[ -L "${ROOT}"/usr/include/boost ]] ; then
147
	if [[ -L "${EROOT}"/usr/include/boost ]] ; then
148
		include=$(basename $(dirname $(canonicalise "${ROOT}"/usr/include/boost )))
148
		include=$(basename $(dirname $(canonicalise "${EROOT}"/usr/include/boost )))
149
		write_kv_list_entry "${include%/}" ""
149
		write_kv_list_entry "${include%/}" ""
150
	else
150
	else
151
		write_kv_list_entry "(unset)" ""
151
		write_kv_list_entry "(unset)" ""
Lines 163-170 Link Here
163
	write_list_start "Available boost versions:"
163
	write_list_start "Available boost versions:"
164
	if [[ -n "${targets[@]}" ]] ; then
164
	if [[ -n "${targets[@]}" ]] ; then
165
		local i
165
		local i
166
		local active_slot=$(canonicalise "${ROOT}/etc/eselect/boost/active")
166
		local active_slot=$(canonicalise "${EROOT}/etc/eselect/boost/active")
167
		active_slot=${active_slot/"${ROOT}/usr/share/boost-eselect/profiles/"/boost-}
167
		active_slot=${active_slot/"${EROOT}/usr/share/boost-eselect/profiles/"/boost-}
168
		for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do
168
		for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do
169
			if [[ "${targets[${i}]}" == ${active_slot} ]] ; then
169
			if [[ "${targets[${i}]}" == ${active_slot} ]] ; then
170
				targets[${i}]="${targets[${i}]} $(highlight '*' )"
170
				targets[${i}]="${targets[${i}]} $(highlight '*' )"
Lines 217-224 Link Here
217
	profile="default"
217
	profile="default"
218
218
219
	# extract profile if there's already one boost version selected
219
	# extract profile if there's already one boost version selected
220
	if [ -L "${ROOT}"/etc/eselect/boost/active ] ; then
220
	if [ -L "${EROOT}"/etc/eselect/boost/active ] ; then
221
		profile=$(basename $(canonicalise "${ROOT}/etc/eselect/boost/active"))
221
		profile=$(basename $(canonicalise "${EROOT}/etc/eselect/boost/active"))
222
	fi
222
	fi
223
223
224
	echo "Previously selected profile: ${profile}"
224
	echo "Previously selected profile: ${profile}"

Return to bug 413447