--- eutils.eclass.bak 2007-01-31 19:27:10.000000000 +0100
+++ eutils.eclass 2007-01-31 20:47:20.000000000 +0100
@@ -1217,11 +1217,18 @@
# - If the file is not specified then ${LICENSE} is used.
check_license() {
local lic=$1
+ local current_overlay="${O%/*-*/*}"
if [ -z "${lic}" ] ; then
- lic="${PORTDIR}/licenses/${LICENSE}"
+ # Favor current overlay license over any other
+ # If not from an overlay, this checks the ordinary portage tree
+ if [ -d $current_overlay -a -e "${current_overlay}/licenses/${LICENSE}" ] ; then
+ lic="${current_overlay}/licenses/${LICENSE}"
+ else
+ lic="${LICENSE}"
+ fi
else
- if [ -e "${PORTDIR}/licenses/${lic}" ] ; then
- lic="${PORTDIR}/licenses/${lic}"
+ if [ -d $current_overlay -a -e "${current_overlay}/licenses/${LICENSE}" ] ; then
+ lic="${current_overlay}/licenses/${LICENSE}"
elif [ -e "${PWD}/${lic}" ] ; then
lic="${PWD}/${lic}"
elif [ -e "${lic}" ] ; then