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 1236-1248
Link Here
|
1236 |
# let portage worry about it |
1238 |
# let portage worry about it |
1237 |
has preserve-libs ${FEATURES} && return 0 |
1239 |
has preserve-libs ${FEATURES} && return 0 |
1238 |
|
1240 |
|
|
|
1241 |
# cannot preserve-libs on aix yet. |
1242 |
[[ ${CHOST} == *-aix* ]] && { |
1243 |
einfo "Not preserving libs on AIX (yet), not implemented." |
1244 |
return 0 |
1245 |
} |
1246 |
|
1239 |
local lib dir |
1247 |
local lib dir |
1240 |
for lib in "$@" ; do |
1248 |
for lib in "$@" ; do |
1241 |
[[ -e ${ROOT}/${lib} ]] || continue |
1249 |
[[ -e ${EROOT}/${lib} ]] || continue |
1242 |
dir=${lib%/*} |
1250 |
dir=${lib%/*} |
1243 |
dodir ${dir} || die "dodir ${dir} failed" |
1251 |
dodir ${dir} || die "dodir ${dir} failed" |
1244 |
cp "${ROOT}"/${lib} "${D}"/${lib} || die "cp ${lib} failed" |
1252 |
cp "${EROOT}"/${lib} "${ED}"/${lib} || die "cp ${lib} failed" |
1245 |
touch "${D}"/${lib} |
1253 |
touch "${ED}"/${lib} |
1246 |
done |
1254 |
done |
1247 |
} |
1255 |
} |
1248 |
|
1256 |
|
Lines 1259-1267
Link Here
|
1259 |
# let portage worry about it |
1267 |
# let portage worry about it |
1260 |
has preserve-libs ${FEATURES} && return 0 |
1268 |
has preserve-libs ${FEATURES} && return 0 |
1261 |
|
1269 |
|
|
|
1270 |
has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}" |
1271 |
|
1262 |
local lib notice=0 |
1272 |
local lib notice=0 |
1263 |
for lib in "$@" ; do |
1273 |
for lib in "$@" ; do |
1264 |
[[ -e ${ROOT}/${lib} ]] || continue |
1274 |
[[ -e ${EROOT}/${lib} ]] || continue |
1265 |
if [[ ${notice} -eq 0 ]] ; then |
1275 |
if [[ ${notice} -eq 0 ]] ; then |
1266 |
notice=1 |
1276 |
notice=1 |
1267 |
ewarn "Old versions of installed libraries were detected on your system." |
1277 |
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 |
1307 |
# Remember that this function isn't terribly intelligent so order of optional |
1298 |
# flags matter. |
1308 |
# flags matter. |
1299 |
built_with_use() { |
1309 |
built_with_use() { |
|
|
1310 |
has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}" |
1300 |
local hidden="no" |
1311 |
local hidden="no" |
1301 |
if [[ $1 == "--hidden" ]] ; then |
1312 |
if [[ $1 == "--hidden" ]] ; then |
1302 |
hidden="yes" |
1313 |
hidden="yes" |
Lines 1320-1327
Link Here
|
1320 |
[[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package" |
1331 |
[[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package" |
1321 |
shift |
1332 |
shift |
1322 |
|
1333 |
|
1323 |
local USEFILE=${ROOT}/var/db/pkg/${PKG}/USE |
1334 |
local USEFILE="${EROOT}"/var/db/pkg/${PKG}/USE |
1324 |
local IUSEFILE=${ROOT}/var/db/pkg/${PKG}/IUSE |
1335 |
local IUSEFILE="${EROOT}"/var/db/pkg/${PKG}/IUSE |
1325 |
|
1336 |
|
1326 |
# if the IUSE file doesn't exist, the read will error out, we need to handle |
1337 |
# if the IUSE file doesn't exist, the read will error out, we need to handle |
1327 |
# this gracefully |
1338 |
# this gracefully |
Lines 1401-1406
Link Here
|
1401 |
# first optionally setting LD_LIBRARY_PATH to the colon-delimited |
1412 |
# first optionally setting LD_LIBRARY_PATH to the colon-delimited |
1402 |
# libpaths followed by optionally changing directory to chdir. |
1413 |
# libpaths followed by optionally changing directory to chdir. |
1403 |
make_wrapper() { |
1414 |
make_wrapper() { |
|
|
1415 |
has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= |
1404 |
local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5 |
1416 |
local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5 |
1405 |
local tmpwrapper=$(emktemp) |
1417 |
local tmpwrapper=$(emktemp) |
1406 |
|
1418 |
|
Lines 1408-1424
Link Here
|
1408 |
echo '#!/bin/sh' |
1420 |
echo '#!/bin/sh' |
1409 |
[[ -n ${chdir} ]] && printf 'cd "%s"\n' "${chdir}" |
1421 |
[[ -n ${chdir} ]] && printf 'cd "%s"\n' "${chdir}" |
1410 |
if [[ -n ${libdir} ]] ; then |
1422 |
if [[ -n ${libdir} ]] ; then |
|
|
1423 |
if [[ ${CHOST} == *-darwin* ]] ; then |
1424 |
var=DYLD_LIBRARY_PATH |
1425 |
else |
1426 |
var=LD_LIBRARY_PATH |
1427 |
fi |
1411 |
cat <<-EOF |
1428 |
cat <<-EOF |
1412 |
if [ "\${LD_LIBRARY_PATH+set}" = "set" ] ; then |
1429 |
if [ "\${${var}+set}" = "set" ] ; then |
1413 |
export LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:${libdir}" |
1430 |
export ${var}="\${${var}}:${EPREFIX}${libdir}" |
1414 |
else |
1431 |
else |
1415 |
export LD_LIBRARY_PATH="${libdir}" |
1432 |
export ${var}="${EPREFIX}${libdir}" |
1416 |
fi |
1433 |
fi |
1417 |
EOF |
1434 |
EOF |
1418 |
fi |
1435 |
fi |
1419 |
# We don't want to quote ${bin} so that people can pass complex |
1436 |
# We don't want to quote ${bin} so that people can pass complex |
1420 |
# things as ${bin} ... "./someprog --args" |
1437 |
# things as ${bin} ... "./someprog --args" |
1421 |
printf 'exec %s "$@"\n' "${bin}" |
1438 |
printf 'exec %s "$@"\n' "${bin/#\//${EPREFIX}\/}" |
1422 |
) > "${tmpwrapper}" |
1439 |
) > "${tmpwrapper}" |
1423 |
chmod go+rx "${tmpwrapper}" |
1440 |
chmod go+rx "${tmpwrapper}" |
1424 |
|
1441 |
|
Lines 1529-1534
Link Here
|
1529 |
debug-print-function ${FUNCNAME} "$@" |
1546 |
debug-print-function ${FUNCNAME} "$@" |
1530 |
|
1547 |
|
1531 |
local removing_all removing_modules opt |
1548 |
local removing_all removing_modules opt |
|
|
1549 |
has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}" |
1532 |
for opt; do |
1550 |
for opt; do |
1533 |
case "${opt}" in |
1551 |
case "${opt}" in |
1534 |
--all) |
1552 |
--all) |
Lines 1638-1644
Link Here
|
1638 |
einfo "Removing unnecessary ${f#${D%/}} (${reason})" |
1656 |
einfo "Removing unnecessary ${f#${D%/}} (${reason})" |
1639 |
queue+=( "${f}" ) |
1657 |
queue+=( "${f}" ) |
1640 |
fi |
1658 |
fi |
1641 |
done < <(find "${D}" -xtype f -name '*.la' -print0) |
1659 |
done < <(find "${ED}" -xtype f -name '*.la' -print0) |
1642 |
|
1660 |
|
1643 |
if [[ ${queue[@]} ]]; then |
1661 |
if [[ ${queue[@]} ]]; then |
1644 |
rm -f "${queue[@]}" |
1662 |
rm -f "${queue[@]}" |