aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-18 13:16:37 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-18 13:16:37 +0000
commit323de8bbeb0cd5b792b18842a32d833c2761caa4 (patch)
treefdbc8ed91a2c416e2e56925aa44bcc431ac4a7e7
parentb73479ebccd7e4bc0d2a0f4b60ba08d0b97fc637 (diff)
downloadpaludis-323de8bbeb0cd5b792b18842a32d833c2761caa4.tar.gz
paludis-323de8bbeb0cd5b792b18842a32d833c2761caa4.tar.xz
Cleaner inherit vars
-rwxr-xr-xebuild/ebuild.bash4
-rw-r--r--ebuild/eclass_functions.bash20
2 files changed, 14 insertions, 10 deletions
diff --git a/ebuild/ebuild.bash b/ebuild/ebuild.bash
index 634c757..8d77787 100755
--- a/ebuild/ebuild.bash
+++ b/ebuild/ebuild.bash
@@ -1,7 +1,7 @@
#!/bin/bash
# vim: set sw=4 sts=4 et :
-# Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
@@ -227,6 +227,8 @@ ebuild_load_ebuild()
fi
export EBUILD="${1}"
+ unset IUSE DEPEND RDEPEND PDEPEND KEYWORDS
+
if [[ "${CATEGORY}" == "virtual" ]] ; then
if [[ -f "${1}" ]] ; then
source ${1} || die "Error sourcing ebuild '${1}'"
diff --git a/ebuild/eclass_functions.bash b/ebuild/eclass_functions.bash
index 2220c34..6ae802a 100644
--- a/ebuild/eclass_functions.bash
+++ b/ebuild/eclass_functions.bash
@@ -1,7 +1,7 @@
#!/bin/bash
# vim: set sw=4 sts=4 et :
-# Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
@@ -55,9 +55,11 @@ inherit()
local old_ECLASS="${ECLASS}"
export ECLASS="${e}"
- local current_IUSE="${IUSE}" current_DEPEND="${DEPEND}"
- local current_RDEPEND="${RDEPEND}" current_PDEPEND="${PDEPEND}"
- local current_KEYWORDS="${KEYWORDS}"
+ local current_IUSE="${IUSE}" unset_IUSE="${IUSE-unset}"
+ local current_DEPEND="${DEPEND}" unset_DEPEND="${DEPEND-unset}"
+ local current_RDEPEND="${RDEPEND}" unset_RDEPEND="${RDEPEND-unset}"
+ local current_PDEPEND="${PDEPEND}" unset_PDEPEND="${PDEPEND-unset}"
+ local current_KEYWORDS="${KEYWORDS}" unset_KEYWORDS="${KEYWORDS-unset}"
unset IUSE DEPEND RDEPEND PDEPEND KEYWORDS
@@ -71,11 +73,11 @@ inherit()
E_DEPEND="${E_DEPEND} ${DEPEND}"
E_KEYWORDS="${KEYWORDS:+${KEYWORDS} }${E_KEYWORDS}"
- IUSE="${current_IUSE}"
- DEPEND="${current_DEPEND}"
- RDEPEND="${current_RDEPEND}"
- PDEPEND="${current_PDEPEND}"
- KEYWORDS="${current_KEYWORDS}"
+ [[ "unset" == "${unset_IUSE}" ]] && unset IUSE || IUSE="${current_IUSE}"
+ [[ "unset" == "${unset_DEPEND}" ]] && unset DEPEND || DEPEND="${current_DEPEND}"
+ [[ "unset" == "${unset_RDEPEND}" ]] && unset RDEPEND || RDEPEND="${current_RDEPEND}"
+ [[ "unset" == "${unset_PDEPEND}" ]] && unset PDEPEND || PDEPEND="${current_PDEPEND}"
+ [[ "unset" == "${unset_KEYWORDS}" ]] && unset KEYWORDS || KEYWORDS="${current_KEYWORDS}"
export ECLASS="${old_ECLASS}"
done