All pastes #334683 Raw Edit

Untitled

public text v1 · immutable
#334683 ·published 2007-01-31 20:10 UTC
rendered paste body
--- eutils.eclass.bak   2007-01-31 19:27:10.000000000 +0100
+++ eutils.eclass       2007-01-31 21:02:16.000000000 +0100
@@ -1217,10 +1217,22 @@
 # - 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}"
+               # When in an overlay, but license not present there, check portage tree as well
+               elif [ $current_overlay != ${PORTDIR} -a -e "${PORTDIR}/licenses/${LICENSE}" ] ; then
+                       lic="${PORTDIR}/licenses/${LICENSE}"
+               else
+                       lic="${LICENSE}"
+               fi
        else
-               if [ -e "${PORTDIR}/licenses/${lic}" ] ; then
+               if [ -d $current_overlay -a  -e "${current_overlay}/licenses/${lic}" ] ; then
+                       lic="${current_overlay}/licenses/${lic}"
+               elif [ $current_overlay != ${PORTDIR} -a -e "${PORTDIR}/licenses/${lic}" ] ; then
                        lic="${PORTDIR}/licenses/${lic}"
                elif [ -e "${PWD}/${lic}" ] ; then
                        lic="${PWD}/${lic}"