aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-07-10 16:29:45 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-07-11 01:08:45 +0100
commitc9ef0dbfabafa9e8f7fa26a393b356451744fd02 (patch)
tree50a93a0bc95a893c05cafa6801061c7e41d89d9e
parent816b3ad494e1aea8c6b7bd8c7ef40b6d89613270 (diff)
downloadpaludis-c9ef0dbfabafa9e8f7fa26a393b356451744fd02.tar.gz
paludis-c9ef0dbfabafa9e8f7fa26a393b356451744fd02.tar.xz
Annotate where deps, myoptions come from
Fixes: ticket:735
-rw-r--r--paludis/repositories/e/eapi.cc2
-rw-r--r--paludis/repositories/e/eapi.hh4
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf3
-rw-r--r--paludis/repositories/e/ebuild.cc4
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash7
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash7
-rwxr-xr-xpaludis/repositories/e/ebuild_flat_metadata_cache_TEST_setup.sh4
-rw-r--r--paludis/repositories/e/myoptions_requirements_verifier.cc3
8 files changed, 30 insertions, 4 deletions
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 35978b2..49f99ce 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -156,6 +156,8 @@ namespace
return make_shared_ptr(new EAPIEbuildOptions(make_named_values<EAPIEbuildOptions>(
value_for<n::binary_from_env_variables>(check_get(k, "binary_from_env_variables")),
value_for<n::bracket_merged_variables>(check_get(k, "bracket_merged_variables")),
+ value_for<n::bracket_merged_variables_annotatable>(check_get(k, "bracket_merged_variables_annotatable")),
+ value_for<n::bracket_merged_variables_annotation>(check_get(k, "bracket_merged_variables_annotation")),
value_for<n::directory_if_exists_variables>(check_get(k, "directory_if_exists_variables")),
value_for<n::directory_variables>(check_get(k, "directory_variables")),
value_for<n::ebuild_functions>(check_get(k, "ebuild_functions")),
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index 6eae724..7f127aa 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -40,6 +40,8 @@ namespace paludis
struct annotations;
struct binary_from_env_variables;
struct bracket_merged_variables;
+ struct bracket_merged_variables_annotatable;
+ struct bracket_merged_variables_annotation;
struct breaks_portage;
struct bugs_to;
struct build_depend;
@@ -352,6 +354,8 @@ namespace paludis
{
NamedValue<n::binary_from_env_variables, std::string> binary_from_env_variables;
NamedValue<n::bracket_merged_variables, std::string> bracket_merged_variables;
+ NamedValue<n::bracket_merged_variables_annotatable, std::string> bracket_merged_variables_annotatable;
+ NamedValue<n::bracket_merged_variables_annotation, std::string> bracket_merged_variables_annotation;
NamedValue<n::directory_if_exists_variables, std::string> directory_if_exists_variables;
NamedValue<n::directory_variables, std::string> directory_variables;
NamedValue<n::ebuild_functions, std::string> ebuild_functions;
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 19914ae..6968ed4 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -85,6 +85,9 @@ source_merged_variables =
bracket_merged_variables = \
DEPENDENCIES MYOPTIONS
+bracket_merged_variables_annotatable = ${bracket_merged_variables}
+bracket_merged_variables_annotation = defined-in
+
save_variables = \
OPTIONS SUBOPTIONS HIDDEN_SUBOPTIONS \$SUBOPTIONS
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index c52c8eb..695fa36 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -179,6 +179,10 @@ EbuildCommand::operator() ()
params.package_id()->eapi()->supported()->ebuild_options()->source_merged_variables())
.with_setenv("PALUDIS_BRACKET_MERGED_VARIABLES",
params.package_id()->eapi()->supported()->ebuild_options()->bracket_merged_variables())
+ .with_setenv("PALUDIS_BRACKET_MERGED_VARIABLES_ANNOTATABLE",
+ params.package_id()->eapi()->supported()->ebuild_options()->bracket_merged_variables_annotatable())
+ .with_setenv("PALUDIS_BRACKET_MERGED_VARIABLES_ANNOTATION",
+ 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_CHANGE_AFTER_SOURCE_VARIABLES",
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index 28d239a..6807154 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -338,7 +338,12 @@ ebuild_load_ebuild()
for paludis_v in ${PALUDIS_BRACKET_MERGED_VARIABLES} ; do
paludis_e_v=E_${paludis_v}
- eval ${paludis_v}='"( ${!paludis_v} ) ${!paludis_e_v}"'
+ if has "${paludis_v}" ${PALUDIS_BRACKET_MERGED_VARIABLES_ANNOTATABLE} ; then
+ eval ${paludis_v}='"( ${!paludis_v} ) [[ '\
+ ${PALUDIS_BRACKET_MERGED_VARIABLES_ANNOTATION}' = [ '${1##*/}' ] ]] ${!paludis_e_v}"'
+ else
+ eval ${paludis_v}='"( ${!paludis_v} ) ${!paludis_e_v}"'
+ fi
done
for paludis_v in ${PALUDIS_MUST_NOT_CHANGE_VARIABLES} ; do
diff --git a/paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash b/paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash
index fc690e3..2fdf9a0 100644
--- a/paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash
@@ -174,7 +174,12 @@ require()
for v in ${PALUDIS_BRACKET_MERGED_VARIABLES} ; do
local e_v="E_${v}"
- export -n ${e_v}="${!e_v} ( ${!v} )"
+ if has "${v}" ${PALUDIS_BRACKET_MERGED_VARIABLES_ANNOTATABLE} ; then
+ export -n ${e_v}="${!e_v} ( ${!v} ) [[ ${PALUDIS_BRACKET_MERGED_VARIABLES_ANNOTATION} =
+ [ ${CURRENT_EXLIB}.exlib ] ]]"
+ else
+ export -n ${e_v}="${!e_v} ( ${!v} )"
+ fi
done
for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ${PALUDIS_BRACKET_MERGED_VARIABLES} ; do
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST_setup.sh b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST_setup.sh
index 9f65cca..0f01971 100755
--- a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST_setup.sh
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST_setup.sh
@@ -1293,13 +1293,13 @@ cat <<END > cache/expected/cat/write-exlibs-1
_mtime_=60
_guessed_eapi_=exheres-0
_exlibs_=bar $(${PALUDIS_EBUILD_DIR}/utils/canonicalise repo/cat/exlibs) 180 foo $(${PALUDIS_EBUILD_DIR}/utils/canonicalise repo/exlibs) 180
-DEPENDENCIES=( build: cat/foo bar? ( cat/bar ) ) cat/baz
+DEPENDENCIES=( build: cat/foo bar? ( cat/bar ) ) [[ defined-in = [ write-exlibs-1.ebuild ] ]] ( cat/baz ) [[ defined-in = [ foo.exlib ] ]] ( ) [[ defined-in = [ bar.exlib ] ]]
SLOT=0
HOMEPAGE=http://example.com/
LICENCES=GPL-2
SUMMARY=A nice package
PLATFORMS=test
-MYOPTIONS=bar quux
+MYOPTIONS=( bar ) [[ defined-in = [ write-exlibs-1.ebuild ] ]] ( quux ) [[ defined-in = [ foo.exlib ] ]] ( ) [[ defined-in = [ bar.exlib ] ]]
EAPI=exheres-0
DEFINED_PHASES=-
END
diff --git a/paludis/repositories/e/myoptions_requirements_verifier.cc b/paludis/repositories/e/myoptions_requirements_verifier.cc
index fc85a08..929212b 100644
--- a/paludis/repositories/e/myoptions_requirements_verifier.cc
+++ b/paludis/repositories/e/myoptions_requirements_verifier.cc
@@ -152,6 +152,9 @@ MyOptionsRequirementsVerifier::verify_one(const ChoicePrefixName & spec_prefix,
else if (a_key == _imp->id->eapi()->supported()->annotations()->myoptions_number_selected())
{
}
+ else if (a_key == _imp->id->eapi()->supported()->ebuild_options()->bracket_merged_variables_annotation())
+ {
+ }
else if (a_key == _imp->id->eapi()->supported()->annotations()->myoptions_requires())
{
std::list<std::string> tokens;