--- trunk/mage/usr/lib/mage/mage4.functions.sh 2005/09/27 14:38:01 248 +++ trunk/mage/usr/lib/mage/mage4.functions.sh 2005/10/02 12:20:13 249 @@ -1,6 +1,6 @@ #!/bin/bash # Magellan Linux Installer Functions (mage.functions.sh) -# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.functions.sh,v 1.4 2005-09-27 14:38:01 niro Exp $ +# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.functions.sh,v 1.5 2005-10-02 12:20:13 niro Exp $ mage_setup() { @@ -2520,3 +2520,25 @@ unset ipbuild done } + +export_inherits() +{ + local include="$1" + shift + + while [ "$1" ] + do + local functions="$1" + + # sanity checks + [ -z "${include}" ] && die "export_inherits(): \$include not given." + [ -z "${functions}" ] && die "export_inherits(): \$functions not given." + + eval "${functions}() { ${include}_${functions} ; }" + + # debug + [[ ${MAGEDEBUG} = on ]] && typeset -f "${functions}" + + shift + done +}