aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-08-10 16:16:56 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2008-08-10 16:16:56 +0100
commit301564093f2dd20128be8f2033ec517412738b02 (patch)
tree92376111ced076b9243bf9b2e938c9ea36356072
parentbe03352b02c38243799df12153354d447ef3e3c7 (diff)
downloadpaludis-301564093f2dd20128be8f2033ec517412738b02.tar.gz
paludis-301564093f2dd20128be8f2033ec517412738b02.tar.xz
Allow EAPIs to specify which ebuild modules should be loaded.
-rw-r--r--paludis/repositories/e/eapi.cc1
-rw-r--r--paludis/repositories/e/eapi.hh2
-rw-r--r--paludis/repositories/e/eapis/0.conf4
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf4
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf4
-rw-r--r--paludis/repositories/e/ebuild.cc2
-rw-r--r--paludis/repositories/e/ebuild/0/Makefile.am2
-rw-r--r--paludis/repositories/e/ebuild/0/ever_functions.bash27
-rw-r--r--paludis/repositories/e/ebuild/0/exlib_functions.bash103
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash28
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/eclass_functions.bash106
-rwxr-xr-xpaludis/repositories/e/ebuild/run_test.bash1
13 files changed, 36 insertions, 249 deletions
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index d5e2cb2..70ef841 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -142,6 +142,7 @@ namespace
value_for<n::f_function_prefix>(check_get(k, "f_function_prefix")),
value_for<n::ignore_pivot_env_functions>(check_get(k, "ignore_pivot_env_functions")),
value_for<n::ignore_pivot_env_variables>(check_get(k, "ignore_pivot_env_variables")),
+ value_for<n::load_modules>(check_get(k, "load_modules")),
value_for<n::must_not_change_variables>(check_get(k, "must_not_change_variables")),
value_for<n::non_empty_variables>(check_get(k, "non_empty_variables")),
value_for<n::rdepend_defaults_to_depend>(destringify_key<bool>(k, "rdepend_defaults_to_depend")),
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index c0d0191..ed11863 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -90,6 +90,7 @@ namespace paludis
struct iuse_flag_parse_options;
struct keywords;
struct license;
+ struct load_modules;
struct long_description;
struct merger_options;
struct metadata_key;
@@ -278,6 +279,7 @@ namespace paludis
NamedValue<n::f_function_prefix, std::string> f_function_prefix;
NamedValue<n::ignore_pivot_env_functions, std::string> ignore_pivot_env_functions;
NamedValue<n::ignore_pivot_env_variables, std::string> ignore_pivot_env_variables;
+ NamedValue<n::load_modules, std::string> load_modules;
NamedValue<n::must_not_change_variables, std::string> must_not_change_variables;
NamedValue<n::non_empty_variables, std::string> non_empty_variables;
NamedValue<n::rdepend_defaults_to_depend, bool> rdepend_defaults_to_depend;
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index a1afd7a..32d2471 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -82,6 +82,10 @@ save_unmodifiable_variables = \
ECLASSDIR ECLASSDIRS EXLIBSDIRS PALUDIS_VARIABLE PALUDIS_PROFILE_DIR \
PALUDIS_PROFILE_DIRS PALUDIS_LOADSAVEENV_DIR PALUDIS_BRACKET_MERGED_VARIABLES
+load_modules = \
+ conditional_functions kernel_functions sandbox portage_stubs \
+ multilib_functions install_functions build_functions eclass_functions
+
ebuild_install = \
: killold ; \
userpriv sandbox : init saveenv ; \
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index aaa5641..c709d6b 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -88,6 +88,10 @@ save_unmodifiable_variables = \
ECLASSDIR ECLASSDIRS EXLIBSDIRS PALUDIS_VARIABLE PALUDIS_PROFILE_DIR \
PALUDIS_PROFILE_DIRS PALUDIS_LOADSAVEENV_DIR PALUDIS_BRACKET_MERGED_VARIABLES
+load_modules = \
+ conditional_functions kernel_functions sandbox portage_stubs ever_functions \
+ multilib_functions install_functions build_functions exlib_functions
+
ebuild_install = \
: killold ; \
userpriv sandbox : init saveenv ; \
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index 209dda9..82c3666 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -86,6 +86,10 @@ save_unmodifiable_variables = \
ECLASSDIR ECLASSDIRS EXLIBSDIRS PALUDIS_VARIABLE PALUDIS_PROFILE_DIR \
PALUDIS_PROFILE_DIRS PALUDIS_LOADSAVEENV_DIR PALUDIS_BRACKET_MERGED_VARIABLES
+load_modules = \
+ conditional_functions kernel_functions sandbox portage_stubs \
+ multilib_functions install_functions build_functions eclass_functions
+
ebuild_install = \
: killold ; \
userpriv sandbox : init saveenv ; \
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 37c01a1..020ce8f 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -172,6 +172,8 @@ EbuildCommand::operator() ()
params.package_id()->eapi()->supported()->ebuild_options()->ignore_pivot_env_functions())
.with_setenv("PALUDIS_IGNORE_PIVOT_ENV_VARIABLES",
params.package_id()->eapi()->supported()->ebuild_options()->ignore_pivot_env_variables())
+ .with_setenv("PALUDIS_LOAD_MODULES",
+ params.package_id()->eapi()->supported()->ebuild_options()->load_modules())
.with_setenv("PALUDIS_BINARY_DISTDIR_VARIABLE",
params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_distdir())
.with_setenv("PALUDIS_UNPACK_UNRECOGNISED_IS_FATAL",
diff --git a/paludis/repositories/e/ebuild/0/Makefile.am b/paludis/repositories/e/ebuild/0/Makefile.am
index 4c890d3..bf18b22 100644
--- a/paludis/repositories/e/ebuild/0/Makefile.am
+++ b/paludis/repositories/e/ebuild/0/Makefile.am
@@ -22,8 +22,6 @@ libexecprog0_SCRIPTS = \
builtin_variable.bash \
conditional_functions.bash \
eclass_functions.bash \
- ever_functions.bash \
- exlib_functions.bash \
list_functions.bash \
output_functions.bash \
pkg_config.bash \
diff --git a/paludis/repositories/e/ebuild/0/ever_functions.bash b/paludis/repositories/e/ebuild/0/ever_functions.bash
deleted file mode 100644
index 00f4d14..0000000
--- a/paludis/repositories/e/ebuild/0/ever_functions.bash
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env bash
-# vim: set sw=4 sts=4 et :
-
-# Copyright (c) 2008 Ciaran McCreesh
-#
-# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
-# Gentoo Foundation and distributed under the terms of the GNU General
-# Public License v2.
-#
-# This file is part of the Paludis package manager. Paludis is free software;
-# you can redistribute it and/or modify it under the terms of the GNU General
-# Public License, version 2, as published by the Free Software Foundation.
-#
-# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place, Suite 330, Boston, MA 02111-1307 USA
-
-ever()
-{
- die "Function 'ever' banned in this EAPI"
-}
-
diff --git a/paludis/repositories/e/ebuild/0/exlib_functions.bash b/paludis/repositories/e/ebuild/0/exlib_functions.bash
deleted file mode 100644
index aa0cbb8..0000000
--- a/paludis/repositories/e/ebuild/0/exlib_functions.bash
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env bash
-# vim: set sw=4 sts=4 et :
-
-# Copyright (c) 2007 Ciaran McCreesh
-#
-# This file is part of the Paludis package manager. Paludis is free software;
-# you can redistribute it and/or modify it under the terms of the GNU General
-# Public License, version 2, as published by the Free Software Foundation.
-#
-# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place, Suite 330, Boston, MA 02111-1307 USA
-
-export_exlib_phases()
-{
- [[ -z "${CURRENT_EXLIB}" ]] && die "export_exlib_phases called but ECLASS undefined"
-
- local e
- for e in "$@" ; do
- case "$e" in
- pkg_nofetch|pkg_setup|pkg_prerm|pkg_postrm|pkg_preinst|pkg_postinst|pkg_config|pkg_pretend)
- eval "${e}() { ${CURRENT_EXLIB}_${e} \"\$@\" ; }"
- ;;
-
- src_unpack|src_compile|src_install|src_test)
- eval "${e}() { ${CURRENT_EXLIB}_${e} \"\$@\" ; }"
- ;;
-
- *)
- eval "${e}() { ${CURRENT_EXLIB}_${e} \"\$@\" ; }"
- ebuild_notice "qa" "$e should not be in export_exlib_phases for ${CURRENT_EXLIB}"
- ;;
- esac
- done
-}
-
-require()
-{
- ebuild_notice "debug" "Command 'require ${@}', using EXLIBSDIRS '${EXLIBSDIRS}'"
- local e ee location= v v_qa
- for e in "$@" ; do
- for ee in ${EXLIBSDIRS} ; do
- [[ -f "${ee}/${e}.exlib" ]] && location="${ee}/${e}.exlib"
- done
- local old_CURRENT_EXLIB="${CURRENT_EXLIB}"
- export CURRENT_EXLIB="${e}"
-
- for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ${PALUDIS_BRACKET_MERGED_VARIABLES} ; do
- local c_v="current_${v}" u_v="unset_${v}"
- local ${c_v}="${!v}"
- local ${u_v}="${!v-unset}"
- unset ${v}
- done
-
- for v_qa in ${PALUDIS_ECLASS_MUST_NOT_SET_VARIABLES} ; do
- local v=${v_qa#qa:}
- local c_v="current_${v}" u_v="unset_${v}"
- export -n ${c_v}="${!v}"
- export -n ${u_v}="${!v-unset}"
- done
-
- [[ -z "${location}" ]] && die "Error finding exlib ${e} in ${EXLIBSDIRS}"
- source "${location}" || die "Error sourcing exlib ${e}"
- hasq "${CURRENT_EXLIB}" ${INHERITED} || export INHERITED="${INHERITED} ${CURRENT_EXLIB}"
-
- for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ; do
- local e_v="E_${v}"
- export -n ${e_v}="${!e_v} ${!v}"
- done
-
- for v in ${PALUDIS_BRACKET_MERGED_VARIABLES} ; do
- local e_v="E_${v}"
- export -n ${e_v}="${!e_v} ( ${!v} )"
- done
-
- for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ${PALUDIS_BRACKET_MERGED_VARIABLES} ; do
- local c_v="current_${v}" u_v="unset_${v}"
- [[ "unset" == ${!u_v} ]] && unset ${v} || export ${v}="${!c_v}"
- done
-
- for v_qa in ${PALUDIS_ECLASS_MUST_NOT_SET_VARIABLES} ; do
- local v=${v_qa#qa:}
- local c_v="current_${v}" u_v="unset_${v}"
- if [[ ${!c_v} != ${!v} || ${!u_v} != ${!v-unset} ]]; then
- if [[ ${v} == ${v_qa} ]] ; then
- die "Variable '${v}' illegally set by ${location}"
- else
- ebuild_notice "qa" "Variable '${v}' should not be set by ${location}"
- export -n ${c_v}="${!v}"
- export -n ${u_v}="${!v-unset}"
- fi
- fi
- done
-
- export CURRENT_EXLIB="${old_CURRENT_EXLIB}"
- done
-}
-
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index 60dffe4..d48d261 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -114,19 +114,27 @@ ebuild_load_module pipe_functions
ebuild_load_module die_functions
ebuild_load_module output_functions
ebuild_load_module echo_functions
-ebuild_load_module conditional_functions
-ebuild_load_module kernel_functions
-ebuild_load_module sandbox
-ebuild_load_module portage_stubs
-ebuild_load_module ever_functions
ebuild_load_module list_functions
-ebuild_load_module multilib_functions
-ebuild_load_module install_functions
-ebuild_load_module build_functions
-ebuild_load_module eclass_functions
-ebuild_load_module exlib_functions
ebuild_load_module source_functions
+if [[ -z ${PALUDIS_LOAD_MODULES} ]]; then
+ PALUDIS_LOAD_MODULES="
+ conditional_functions kernel_functions sandbox portage_stubs
+ multilib_functions install_functions build_functions"
+ for m in eclass_functions exlib_functions ever_functions; do
+ for d in ${EBUILD_MODULES_DIRS}; do
+ if [[ -f "${d}/${1}.bash" ]]; then
+ PALUDIS_LOAD_MODULES="${PALUDIS_LOAD_MODULES} ${m}"
+ break
+ fi
+ done
+ done
+fi
+
+for m in ${PALUDIS_LOAD_MODULES}; do
+ ebuild_load_module ${m}
+done
+
check_paludis_pipe_command()
{
[[ -n "${PALUDIS_SKIP_PIPE_COMMAND_CHECK}" ]] && return
diff --git a/paludis/repositories/e/ebuild/exheres-0/Makefile.am b/paludis/repositories/e/ebuild/exheres-0/Makefile.am
index e354d85..20ce5c1 100644
--- a/paludis/repositories/e/ebuild/exheres-0/Makefile.am
+++ b/paludis/repositories/e/ebuild/exheres-0/Makefile.am
@@ -21,7 +21,6 @@ libexecprogexheres_SCRIPTS = \
builtin_tidyupmisc.bash \
builtin_variable.bash \
conditional_functions.bash \
- eclass_functions.bash \
ever_functions.bash \
exlib_functions.bash \
list_functions.bash \
diff --git a/paludis/repositories/e/ebuild/exheres-0/eclass_functions.bash b/paludis/repositories/e/ebuild/exheres-0/eclass_functions.bash
deleted file mode 100644
index e355837..0000000
--- a/paludis/repositories/e/ebuild/exheres-0/eclass_functions.bash
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/env bash
-# vim: set sw=4 sts=4 et :
-
-# Copyright (c) 2006, 2007 Ciaran McCreesh
-#
-# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
-# Gentoo Foundation and distributed under the terms of the GNU General
-# Public License v2.
-#
-# This file is part of the Paludis package manager. Paludis is free software;
-# you can redistribute it and/or modify it under the terms of the GNU General
-# Public License, version 2, as published by the Free Software Foundation.
-#
-# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place, Suite 330, Boston, MA 02111-1307 USA
-
-EXPORT_FUNCTIONS()
-{
- [[ -z "${ECLASS}" ]] && die "EXPORT_FUNCTIONS called but ECLASS undefined"
-
- local e
- for e in "$@" ; do
- case "$e" in
- pkg_nofetch|pkg_setup|pkg_prerm|pkg_postrm|pkg_preinst|pkg_postinst|pkg_config|pkg_pretend|pkg_info)
- eval "${e}() { ${ECLASS}_${e} \"\$@\" ; }"
- ;;
-
- src_unpack|src_prepare|src_configure|src_compile|src_install|src_test)
- eval "${e}() { ${ECLASS}_${e} \"\$@\" ; }"
- ;;
-
- *)
- die "$e should not be in EXPORT_FUNCTIONS for ${ECLASS}"
- ;;
- esac
- done
-}
-
-inherit()
-{
- [[ -n "${PALUDIS_SKIP_INHERIT}" ]] && return
-
- local e ee location= v v_qa
- for e in "$@" ; do
- for ee in ${ECLASSDIRS:-${ECLASSDIR}} ; do
- [[ -f "${ee}/${e}.eclass" ]] && location="${ee}/${e}.eclass"
- done
- local old_ECLASS="${ECLASS}"
- export ECLASS="${e}"
-
- for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ${PALUDIS_BRACKET_MERGED_VARIABLES} ; do
- local c_v="current_${v}" u_v="unset_${v}"
- local ${c_v}="${!v}"
- local ${u_v}="${!v-unset}"
- unset ${v}
- done
-
- for v_qa in ${PALUDIS_ECLASS_MUST_NOT_SET_VARIABLES} ; do
- local v=${v_qa#qa:}
- local c_v="current_${v}" u_v="unset_${v}"
- export -n ${c_v}="${!v}"
- export -n ${u_v}="${!v-unset}"
- done
-
- [[ -z "${location}" ]] && die "Error finding eclass ${e}"
- source "${location}" || die "Error sourcing eclass ${e}"
- hasq "${ECLASS}" ${INHERITED} || export INHERITED="${INHERITED} ${ECLASS}"
-
- for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ; do
- local e_v="E_${v}"
- export -n ${e_v}="${!e_v} ${!v}"
- done
-
- for v in ${PALUDIS_BRACKET_MERGED_VARIABLES} ; do
- local e_v="E_${v}"
- export -n ${e_v}="${!e_v} ( ${!v} )"
- done
-
- for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ${PALUDIS_BRACKET_MERGED_VARIABLES} ; do
- local c_v="current_${v}" u_v="unset_${v}"
- [[ "unset" == ${!u_v} ]] && unset ${v} || export ${v}="${!c_v}"
- done
-
- for v_qa in ${PALUDIS_ECLASS_MUST_NOT_SET_VARIABLES} ; do
- local v=${v_qa#qa:}
- local c_v="current_${v}" u_v="unset_${v}"
- if [[ ${!c_v} != ${!v} || ${!u_v} != ${!v-unset} ]]; then
- if [[ ${v} == ${v_qa} ]] ; then
- die "Variable '${v}' illegally set by ${location}"
- else
- ebuild_notice "qa" "Variable '${v}' should not be set by ${location}"
- export -n ${c_v}="${!v}"
- export -n ${u_v}="${!v-unset}"
- fi
- fi
- done
-
- export ECLASS="${old_ECLASS}"
- done
-}
diff --git a/paludis/repositories/e/ebuild/run_test.bash b/paludis/repositories/e/ebuild/run_test.bash
index 2dfa3df..570a188 100755
--- a/paludis/repositories/e/ebuild/run_test.bash
+++ b/paludis/repositories/e/ebuild/run_test.bash
@@ -40,6 +40,7 @@ test_equality()
export PALUDIS_PIPE_COMMAND_WRITE_FD=
export PALUDIS_PIPE_COMMAND_READ_FD=
export PALUDIS_SKIP_PIPE_COMMAND_CHECK=yes
+export PALUDIS_LOAD_MODULES=
echo "Test program ${1}:"
source "${PALUDIS_EBUILD_DIR}/ebuild.bash" || exit 200