aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Stephen P. Bennett <spb@exherbo.org> 2006-04-16 20:51:12 +0000
committerAvatar Stephen P. Bennett <spb@exherbo.org> 2006-04-16 20:51:12 +0000
commit1eb7da9cd09c43114581ea57ac9ca4f5c4beb4a6 (patch)
tree1f20f1a454843796c6d5347bc4d4ff3294378db7
parenteaa8266c2f938712b8c01ddbbb40387069da19df (diff)
downloadpaludis-1eb7da9cd09c43114581ea57ac9ca4f5c4beb4a6.tar.gz
paludis-1eb7da9cd09c43114581ea57ac9ca4f5c4beb4a6.tar.xz
Multiple inheritance for profiles.
-rwxr-xr-xebuild/ebuild.bash10
-rw-r--r--paludis/portage_repository.cc12
2 files changed, 15 insertions, 7 deletions
diff --git a/ebuild/ebuild.bash b/ebuild/ebuild.bash
index a71a848..bd0e53b 100755
--- a/ebuild/ebuild.bash
+++ b/ebuild/ebuild.bash
@@ -68,6 +68,12 @@ ebuild_load_module eclass_functions
ebuild_source_profile()
{
+ if [[ -f ${1}/parent ]] ; then
+ while read line; do
+ ebuild_source_profile $(readlink -f ${1}/${line} )
+ done <${1}/parent
+ fi
+
if [[ -f ${1}/make.defaults ]] ; then
source ${1}/make.defaults || die "Couldn't source ${1}/make.defaults"
fi
@@ -75,10 +81,6 @@ ebuild_source_profile()
if [[ -f ${1}/bashrc ]] ; then
source ${1}/bashrc || die "Couldn't source ${1}/bashrc"
fi
-
- if [[ -f ${1}/parent ]] ; then
- ebuild_source_profile $(readlink -f ${1}/$(< ${1}/parent) )
- fi
}
save_vars="USE USE_EXPAND"
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index 8bb2f95..04cbe99 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -273,14 +273,20 @@ Implementation<PortageRepository>::add_profile_r(const FSEntry & f) const
Context context_local("When reading parent file:");
LineConfigFile parent(f / "parent");
- if (parent.begin() != parent.end())
- add_profile_r((f / *parent.begin()).realpath());
- else
+ LineConfigFile::Iterator it = parent.begin(), it_end = parent.end();
+
+ if (it == it_end)
{
Log::get_instance()->message(ll_warning, "Profile parent file in '" +
stringify(f) + "' cannot be read");
return;
}
+
+ for ( ; it != it_end; ++it)
+ {
+ add_profile_r((f / (*it)).realpath());
+ }
+
}
if ((f / "make.defaults").exists())