aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Stephen P. Bennett <spb@exherbo.org> 2007-06-15 22:41:09 +0000
committerAvatar Stephen P. Bennett <spb@exherbo.org> 2007-06-15 22:41:09 +0000
commit9db228c4166d128b9bacfddd48ff1316e0ccd663 (patch)
treef463dff6c2505cf507de6a153555ee267d48c74a
parent9508e36cdf9c9471af93566b0806607ddd21c1ec (diff)
downloadpaludis-9db228c4166d128b9bacfddd48ff1316e0ccd663.tar.gz
paludis-9db228c4166d128b9bacfddd48ff1316e0ccd663.tar.xz
Allow EAPI configs to specify additional ebuild module directories
-rw-r--r--paludis/eapi.cc1
-rw-r--r--paludis/eapi.sr1
-rw-r--r--paludis/eapis/0.conf1
-rw-r--r--paludis/eapis/exheres-0.conf1
-rw-r--r--paludis/eapis/paludis-1.conf2
-rw-r--r--paludis/repositories/gentoo/ebuild.cc1
-rwxr-xr-xpaludis/repositories/gentoo/ebuild/ebuild.bash23
7 files changed, 25 insertions, 5 deletions
diff --git a/paludis/eapi.cc b/paludis/eapi.cc
index 60d0c2a..a574a57 100644
--- a/paludis/eapi.cc
+++ b/paludis/eapi.cc
@@ -98,6 +98,7 @@ namespace paludis
.support_eclasses(destringify<bool>(k.get("support_eclasses")))
.support_exlibs(destringify<bool>(k.get("support_exlibs")))
.utility_path_suffixes(k.get("utility_path_suffixes"))
+ .ebuild_module_suffixes(k.get("ebuild_module_suffixes"))
)))
.ebuild_phases(make_shared_ptr(new EAPIEbuildPhases(
diff --git a/paludis/eapi.sr b/paludis/eapi.sr
index 3778063..6d9def7 100644
--- a/paludis/eapi.sr
+++ b/paludis/eapi.sr
@@ -75,6 +75,7 @@ make_class_EAPIEbuildOptions()
key support_exlibs bool
key utility_path_suffixes std::string
+ key ebuild_module_suffixes std::string
key non_empty_variables std::string
key directory_variables std::string
diff --git a/paludis/eapis/0.conf b/paludis/eapis/0.conf
index cc04867..a19ca3e 100644
--- a/paludis/eapis/0.conf
+++ b/paludis/eapis/0.conf
@@ -18,6 +18,7 @@ require_use_expand_in_iuse = false
support_eclasses = true
support_exlibs = false
utility_path_suffixes =
+ebuild_module_suffixes =
non_empty_variables = \
P PV PR PN PVR PF CATEGORY FILESDIR ECLASSDIR PORTDIR \
diff --git a/paludis/eapis/exheres-0.conf b/paludis/eapis/exheres-0.conf
index 1f5be04..db0ffa6 100644
--- a/paludis/eapis/exheres-0.conf
+++ b/paludis/eapis/exheres-0.conf
@@ -16,6 +16,7 @@ rdepend_defaults_to_depend = false
support_eclasses = false
support_exlibs = true
utility_path_suffixes = exheres-0
+ebuild_module_suffixes =
non_empty_variables = \
P PV PR PN PVR PF CATEGORY FILESDIR EXLIBSDIRS PORTDIR \
diff --git a/paludis/eapis/paludis-1.conf b/paludis/eapis/paludis-1.conf
index 6617db7..e091d0a 100644
--- a/paludis/eapis/paludis-1.conf
+++ b/paludis/eapis/paludis-1.conf
@@ -17,6 +17,8 @@ require_use_expand_in_iuse = false
support_eclasses = true
support_exlibs = false
utility_path_suffixes =
+ebuild_module_suffixes =
+
non_empty_variables = \
P PV PR PN PVR PF CATEGORY FILESDIR ECLASSDIR PORTDIR \
DISTDIR PALUDIS_TMPDIR PALUDIS_EBUILD_LOG_LEVEL PALUDIS_EBUILD_DIR \
diff --git a/paludis/repositories/gentoo/ebuild.cc b/paludis/repositories/gentoo/ebuild.cc
index ef28c00..e779ba1 100644
--- a/paludis/repositories/gentoo/ebuild.cc
+++ b/paludis/repositories/gentoo/ebuild.cc
@@ -116,6 +116,7 @@ EbuildCommand::operator() ()
.with_setenv("PALUDIS_EBUILD_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
.with_setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
.with_setenv("PALUDIS_UTILITY_PATH_SUFFIXES", params.eapi->supported->ebuild_options->utility_path_suffixes)
+ .with_setenv("PALUDIS_EBUILD_MODULE_SUFFIXES", params.eapi->supported->ebuild_options->ebuild_module_suffixes)
.with_setenv("PALUDIS_NON_EMPTY_VARIABLES", params.eapi->supported->ebuild_options->non_empty_variables)
.with_setenv("PALUDIS_DIRECTORY_VARIABLES", params.eapi->supported->ebuild_options->directory_variables)
.with_setenv("PALUDIS_EBUILD_MUST_NOT_SET_VARIABLES", params.eapi->supported->ebuild_options->ebuild_must_not_set_variables)
diff --git a/paludis/repositories/gentoo/ebuild/ebuild.bash b/paludis/repositories/gentoo/ebuild/ebuild.bash
index 723740e..4b724cb 100755
--- a/paludis/repositories/gentoo/ebuild/ebuild.bash
+++ b/paludis/repositories/gentoo/ebuild/ebuild.bash
@@ -66,13 +66,26 @@ if ! [[ -d ${EBUILD_MODULES_DIR} ]] ; then
fi
export PALUDIS_EBUILD_MODULES_DIR="${EBUILD_MODULES_DIR}"
+for p in ${PALUDIS_EBUILD_MODULE_SUFFIXES}; do
+ EBUILD_MODULES_DIRS="${EBUILD_MODULES_DIRS} ${EBUILD_MODULES_DIR}/${p}"
+done
+EBUILD_MODULES_DIRS="${EBUILD_MODULES_DIRS} ${EBUILD_MODULES_DIR}"
+
ebuild_load_module()
{
- if ! source "${EBUILD_MODULES_DIR}/${1}.bash" ; then
- type die &>/dev/null && die "Error loading module ${1}"
- echo "Error loading module ${1}" 1>&2
- exit 123
- fi
+ for d in ${EBUILD_MODULES_DIRS}; do
+ if [[ -f "${d}/${1}.bash" ]]; then
+ if ! source "${d}/${1}.bash"; then
+ type die &>/dev/null && die "Error loading module ${1}"
+ echo "Error loading module ${1}" 1>&2
+ exit 123
+ fi
+ return
+ fi
+ done
+ type die &>/dev/null && die "Couldn't find module ${1}"
+ echo "Couldn't find module ${1}" 1>&2
+ exit 123
}
ebuild_load_module die_functions