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

Collapse All | Expand All

(-)/usr/portage/eclass/eutils.eclass (-14 / +26 lines)
Lines 955-965 Link Here
955
# @DESCRIPTION:
955
# @DESCRIPTION:
956
# Validate desktop entries using desktop-file-utils
956
# Validate desktop entries using desktop-file-utils
957
validate_desktop_entries() {
957
validate_desktop_entries() {
958
	if [[ -x /usr/bin/desktop-file-validate ]] ; then
958
	has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}" && EPREFIX=
959
	if [[ -x "${EPREFIX}"/usr/bin/desktop-file-validate ]] ; then
959
		einfo "Checking desktop entry validity"
960
		einfo "Checking desktop entry validity"
960
		local directories=""
961
		local directories=""
961
		for d in /usr/share/applications $@ ; do
962
		for d in /usr/share/applications $@ ; do
962
			[[ -d ${D}${d} ]] && directories="${directories} ${D}${d}"
963
			[[ -d ${ED}${d} ]] && directories="${directories} ${ED}${d}"
963
		done
964
		done
964
		if [[ -n ${directories} ]] ; then
965
		if [[ -n ${directories} ]] ; then
965
			for FILE in $(find ${directories} -name "*\.desktop" \
966
			for FILE in $(find ${directories} -name "*\.desktop" \
Lines 967-973 Link Here
967
			do
968
			do
968
				local temp=$(desktop-file-validate ${FILE} | grep -v "warning:" | \
969
				local temp=$(desktop-file-validate ${FILE} | grep -v "warning:" | \
969
								sed -e "s|error: ||" -e "s|${FILE}:|--|g" )
970
								sed -e "s|error: ||" -e "s|${FILE}:|--|g" )
970
				[[ -n $temp ]] && elog ${temp/--/${FILE/${D}/}:}
971
				[[ -n $temp ]] && elog ${temp/--/${FILE/${ED}/}:}
971
			done
972
			done
972
		fi
973
		fi
973
		echo ""
974
		echo ""
Lines 1227-1232 Link Here
1227
# solution, so instead you can call this from pkg_preinst.  See also the
1228
# solution, so instead you can call this from pkg_preinst.  See also the
1228
# preserve_old_lib_notify function.
1229
# preserve_old_lib_notify function.
1229
preserve_old_lib() {
1230
preserve_old_lib() {
1231
	has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}" && ED="${D}"
1230
	if [[ ${EBUILD_PHASE} != "preinst" ]] ; then
1232
	if [[ ${EBUILD_PHASE} != "preinst" ]] ; then
1231
		eerror "preserve_old_lib() must be called from pkg_preinst() only"
1233
		eerror "preserve_old_lib() must be called from pkg_preinst() only"
1232
		die "Invalid preserve_old_lib() usage"
1234
		die "Invalid preserve_old_lib() usage"
Lines 1238-1248 Link Here
1238
1240
1239
	local lib dir
1241
	local lib dir
1240
	for lib in "$@" ; do
1242
	for lib in "$@" ; do
1241
		[[ -e ${ROOT}/${lib} ]] || continue
1243
		[[ -e ${EROOT}/${lib} ]] || continue
1242
		dir=${lib%/*}
1244
		dir=${lib%/*}
1243
		dodir ${dir} || die "dodir ${dir} failed"
1245
		dodir ${dir} || die "dodir ${dir} failed"
1244
		cp "${ROOT}"/${lib} "${D}"/${lib} || die "cp ${lib} failed"
1246
		cp "${EROOT}"/${lib} "${ED}"/${lib} || die "cp ${lib} failed"
1245
		touch "${D}"/${lib}
1247
		touch "${ED}"/${lib}
1246
	done
1248
	done
1247
}
1249
}
1248
1250
Lines 1259-1267 Link Here
1259
	# let portage worry about it
1261
	# let portage worry about it
1260
	has preserve-libs ${FEATURES} && return 0
1262
	has preserve-libs ${FEATURES} && return 0
1261
1263
1264
	has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
1265
	
1262
	local lib notice=0
1266
	local lib notice=0
1263
	for lib in "$@" ; do
1267
	for lib in "$@" ; do
1264
		[[ -e ${ROOT}/${lib} ]] || continue
1268
		[[ -e ${EROOT}/${lib} ]] || continue
1265
		if [[ ${notice} -eq 0 ]] ; then
1269
		if [[ ${notice} -eq 0 ]] ; then
1266
			notice=1
1270
			notice=1
1267
			ewarn "Old versions of installed libraries were detected on your system."
1271
			ewarn "Old versions of installed libraries were detected on your system."
Lines 1297-1302 Link Here
1297
# Remember that this function isn't terribly intelligent so order of optional
1301
# Remember that this function isn't terribly intelligent so order of optional
1298
# flags matter.
1302
# flags matter.
1299
built_with_use() {
1303
built_with_use() {
1304
	has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
1300
	local hidden="no"
1305
	local hidden="no"
1301
	if [[ $1 == "--hidden" ]] ; then
1306
	if [[ $1 == "--hidden" ]] ; then
1302
		hidden="yes"
1307
		hidden="yes"
Lines 1320-1327 Link Here
1320
	[[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package"
1325
	[[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package"
1321
	shift
1326
	shift
1322
1327
1323
	local USEFILE=${ROOT}/var/db/pkg/${PKG}/USE
1328
	local USEFILE="${EROOT}"/var/db/pkg/${PKG}/USE
1324
	local IUSEFILE=${ROOT}/var/db/pkg/${PKG}/IUSE
1329
	local IUSEFILE="${EROOT}"/var/db/pkg/${PKG}/IUSE
1325
1330
1326
	# if the IUSE file doesn't exist, the read will error out, we need to handle
1331
	# if the IUSE file doesn't exist, the read will error out, we need to handle
1327
	# this gracefully
1332
	# this gracefully
Lines 1401-1406 Link Here
1401
# first optionally setting LD_LIBRARY_PATH to the colon-delimited
1406
# first optionally setting LD_LIBRARY_PATH to the colon-delimited
1402
# libpaths followed by optionally changing directory to chdir.
1407
# libpaths followed by optionally changing directory to chdir.
1403
make_wrapper() {
1408
make_wrapper() {
1409
	has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
1404
	local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5
1410
	local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5
1405
	local tmpwrapper=$(emktemp)
1411
	local tmpwrapper=$(emktemp)
1406
1412
Lines 1408-1424 Link Here
1408
	echo '#!/bin/sh'
1414
	echo '#!/bin/sh'
1409
	[[ -n ${chdir} ]] && printf 'cd "%s"\n' "${chdir}"
1415
	[[ -n ${chdir} ]] && printf 'cd "%s"\n' "${chdir}"
1410
	if [[ -n ${libdir} ]] ; then
1416
	if [[ -n ${libdir} ]] ; then
1417
		if [[ ${CHOST} == *-darwin* ]] ; then
1418
			var=DYLD_LIBRARY_PATH
1419
		else
1420
			var=LD_LIBRARY_PATH
1421
		fi
1411
		cat <<-EOF
1422
		cat <<-EOF
1412
			if [ "\${LD_LIBRARY_PATH+set}" = "set" ] ; then
1423
			if [ "\${${var}+set}" = "set" ] ; then
1413
				export LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:${libdir}"
1424
				export ${var}="\${${var}}:${EPREFIX}${libdir}"
1414
			else
1425
			else
1415
				export LD_LIBRARY_PATH="${libdir}"
1426
				export ${var}="${EPREFIX}${libdir}"
1416
			fi
1427
			fi
1417
		EOF
1428
		EOF
1418
	fi
1429
	fi
1419
	# We don't want to quote ${bin} so that people can pass complex
1430
	# We don't want to quote ${bin} so that people can pass complex
1420
	# things as ${bin} ... "./someprog --args"
1431
	# things as ${bin} ... "./someprog --args"
1421
	printf 'exec %s "$@"\n' "${bin}"
1432
	printf 'exec %s "$@"\n' "${bin/#\//${EPREFIX}\/}"
1422
	) > "${tmpwrapper}"
1433
	) > "${tmpwrapper}"
1423
	chmod go+rx "${tmpwrapper}"
1434
	chmod go+rx "${tmpwrapper}"
1424
1435
Lines 1529-1534 Link Here
1529
	debug-print-function ${FUNCNAME} "$@"
1540
	debug-print-function ${FUNCNAME} "$@"
1530
1541
1531
	local removing_all removing_modules opt
1542
	local removing_all removing_modules opt
1543
	has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
1532
	for opt; do
1544
	for opt; do
1533
		case "${opt}" in
1545
		case "${opt}" in
1534
			--all)
1546
			--all)
Lines 1638-1644 Link Here
1638
			einfo "Removing unnecessary ${f#${D%/}} (${reason})"
1650
			einfo "Removing unnecessary ${f#${D%/}} (${reason})"
1639
			queue+=( "${f}" )
1651
			queue+=( "${f}" )
1640
		fi
1652
		fi
1641
	done < <(find "${D}" -xtype f -name '*.la' -print0)
1653
	done < <(find "${ED}" -xtype f -name '*.la' -print0)
1642
1654
1643
	if [[ ${queue[@]} ]]; then
1655
	if [[ ${queue[@]} ]]; then
1644
		rm -f "${queue[@]}"
1656
		rm -f "${queue[@]}"

Return to bug 485438