aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Bo ├śrsted Andresen <bo.andresen@zlin.dk> 2009-10-30 00:32:13 +0000
committerAvatar Bo ├śrsted Andresen <bo.andresen@zlin.dk> 2009-10-30 01:58:19 +0000
commit222d0d458ab5e0379e3c6d34c06336ef94418323 (patch)
tree19f580ecad9bff1e01f788ec9f60b24c70c00e16
parent18eb76bad51823b14bf70d69fe679995ff69b10b (diff)
downloadpaludis-222d0d458ab5e0379e3c6d34c06336ef94418323.tar.gz
paludis-222d0d458ab5e0379e3c6d34c06336ef94418323.tar.xz
Bail on variables starting with DEFAULT_{PKG,SRC}_ which aren't known special variables.
-rw-r--r--paludis/repositories/e/eapi.cc1
-rw-r--r--paludis/repositories/e/eapi.hh2
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf2
-rw-r--r--paludis/repositories/e/ebuild.cc2
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash8
5 files changed, 15 insertions, 0 deletions
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 49326e1..95f81ea 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -169,6 +169,7 @@ namespace
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_set_vars_starting_with>(check_get(k, "must_not_set_vars_starting_with")),
value_for<n::must_not_change_after_source_variables>(check_get(k, "must_not_change_after_source_variables")),
value_for<n::must_not_change_variables>(check_get(k, "must_not_change_variables")),
value_for<n::no_s_workdir_fallback>(destringify_key<bool>(k, "no_s_workdir_fallback")),
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index 2d7ee58..522de75 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -135,6 +135,7 @@ namespace paludis
struct myoptions_number_selected_at_most_one;
struct myoptions_number_selected_exactly_one;
struct myoptions_requires;
+ struct must_not_set_vars_starting_with;
struct must_not_change_after_source_variables;
struct must_not_change_variables;
struct name;
@@ -369,6 +370,7 @@ namespace paludis
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_set_vars_starting_with, std::string> must_not_set_vars_starting_with;
NamedValue<n::must_not_change_after_source_variables, std::string> must_not_change_after_source_variables;
NamedValue<n::must_not_change_variables, std::string> must_not_change_variables;
NamedValue<n::no_s_workdir_fallback, bool> no_s_workdir_fallback;
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 95f0d0e..ad4c272 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -67,6 +67,8 @@ directory_if_exists_variables = \
ebuild_must_not_set_variables = \
DEPEND RDEPEND PDEPEND PROVIDE USE IUSE KEYWORDS LICENSE LICENSES LICENCE SRC_URI
+must_not_set_vars_starting_with = DEFAULT_PKG_ DEFAULT_SRC_
+
must_not_change_after_source_variables = \
DEFAULT_SRC_COMPILE_PARAMS \
DEFAULT_SRC_CONFIGURE_PARAMS \
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index dca5d50..041450a 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -210,6 +210,8 @@ EbuildCommand::operator() ()
params.package_id()->eapi()->supported()->ebuild_options()->bracket_merged_variables_annotation())
.with_setenv("PALUDIS_MUST_NOT_CHANGE_VARIABLES",
params.package_id()->eapi()->supported()->ebuild_options()->must_not_change_variables())
+ .with_setenv("PALUDIS_MUST_NOT_SET_VARS_STARTING_WITH",
+ params.package_id()->eapi()->supported()->ebuild_options()->must_not_set_vars_starting_with())
.with_setenv("PALUDIS_MUST_NOT_CHANGE_AFTER_SOURCE_VARIABLES",
params.package_id()->eapi()->supported()->ebuild_options()->must_not_change_after_source_variables())
.with_setenv("PALUDIS_RDEPEND_DEFAULTS_TO_DEPEND",
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index 346fec4..a8ddb5c 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -377,6 +377,14 @@ ebuild_load_ebuild()
export ${paludis_s_v}="$(declare -p ${paludis_v} 2>/dev/null)"
done
+ local paludis_p
+ for paludis_p in ${PALUDIS_MUST_NOT_SET_VARS_STARTING_WITH} ; do
+ for paludis_v in $(eval echo \${!${paludis_p}*}) ; do
+ has ${paludis_v} ${PALUDIS_MUST_NOT_CHANGE_AFTER_SOURCE_VARIABLES} ||
+ die "${paludis_v} starts with ${paludis_p} but isn't a known variable name"
+ done
+ done
+
PALUDIS_DECLARED_FUNCTIONS=$(declare -F | while read paludis_v ; do
echo -n ${paludis_v#declare -f } " "
done )