aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-01 17:42:20 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-01 17:43:52 +0100
commitad761cd5e507e344ebc5f0c467b04f7d3dc729a3 (patch)
tree757c7ee5e72715d25d8127bc2b3369b2161fbe6d
parent4197530f623ce9c9653b724baeda36efb08c3e63 (diff)
downloadpaludis-ad761cd5e507e344ebc5f0c467b04f7d3dc729a3.tar.gz
paludis-ad761cd5e507e344ebc5f0c467b04f7d3dc729a3.tar.xz
updso_serialised
-rw-r--r--paludis/environments/paludis/paludis_environment.cc2
-rw-r--r--paludis/environments/paludis/world.cc12
-rw-r--r--paludis/environments/portage/portage_environment.cc8
-rw-r--r--paludis/repositories/e/e_repository_sets.cc3
-rw-r--r--paludis/set_file_TEST.cc12
-rw-r--r--paludis/user_dep_spec.cc23
-rw-r--r--paludis/user_dep_spec.hh7
-rw-r--r--paludis/user_dep_spec.se1
8 files changed, 50 insertions, 18 deletions
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index 25c4fed..f174ebd 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -518,7 +518,7 @@ namespace
value_for<n::file_name>(f),
value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec,
std::tr1::placeholders::_1, env, UserPackageDepSpecOptions() + updso_allow_wildcards,
- filter::All())),
+ filter::All(), make_null_shared_ptr())),
value_for<n::set_operator_mode>(mode),
value_for<n::tag>(tag),
value_for<n::type>(type)
diff --git a/paludis/environments/paludis/world.cc b/paludis/environments/paludis/world.cc
index f78daca..7bccd2a 100644
--- a/paludis/environments/paludis/world.cc
+++ b/paludis/environments/paludis/world.cc
@@ -118,7 +118,9 @@ World::_add_string_to_world(const std::string & n) const
SetFile world(make_named_values<SetFileParams>(
value_for<n::environment>(_imp->env),
value_for<n::file_name>(*_imp->maybe_world_file),
- value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, _imp->env, UserPackageDepSpecOptions() + updso_no_disambiguation + updso_throw_if_set, filter::All())),
+ value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, _imp->env,
+ UserPackageDepSpecOptions() + updso_no_disambiguation + updso_throw_if_set, filter::All(),
+ make_null_shared_ptr())),
value_for<n::set_operator_mode>(sfsmo_natural),
value_for<n::tag>(std::tr1::shared_ptr<DepTag>()),
value_for<n::type>(sft_simple)
@@ -148,7 +150,9 @@ World::_remove_string_from_world(const std::string & n) const
SetFile world(make_named_values<SetFileParams>(
value_for<n::environment>(_imp->env),
value_for<n::file_name>(*_imp->maybe_world_file),
- value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, _imp->env, UserPackageDepSpecOptions() + updso_no_disambiguation + updso_throw_if_set, filter::All())),
+ value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, _imp->env,
+ UserPackageDepSpecOptions() + updso_no_disambiguation + updso_throw_if_set, filter::All(),
+ make_null_shared_ptr())),
value_for<n::set_operator_mode>(sfsmo_natural),
value_for<n::tag>(std::tr1::shared_ptr<DepTag>()),
value_for<n::type>(sft_simple)
@@ -173,7 +177,9 @@ World::world_set() const
SetFile world(make_named_values<SetFileParams>(
value_for<n::environment>(_imp->env),
value_for<n::file_name>(*_imp->maybe_world_file),
- value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, _imp->env, UserPackageDepSpecOptions() + updso_no_disambiguation + updso_throw_if_set, filter::All())),
+ value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, _imp->env,
+ UserPackageDepSpecOptions() + updso_no_disambiguation + updso_throw_if_set, filter::All(),
+ make_null_shared_ptr())),
value_for<n::set_operator_mode>(sfsmo_natural),
value_for<n::tag>(tag),
value_for<n::type>(sft_simple)
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index 333db69..88963cb 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -920,7 +920,8 @@ PortageEnvironment::_add_string_to_world(const std::string & s) const
SetFile world(make_named_values<SetFileParams>(
value_for<n::environment>(this),
value_for<n::file_name>(_imp->world_file),
- value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, this, UserPackageDepSpecOptions() + updso_no_disambiguation, filter::All())),
+ value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, this,
+ UserPackageDepSpecOptions() + updso_no_disambiguation, filter::All(), make_null_shared_ptr())),
value_for<n::set_operator_mode>(sfsmo_natural),
value_for<n::tag>(std::tr1::shared_ptr<DepTag>()),
value_for<n::type>(sft_simple)
@@ -944,7 +945,7 @@ PortageEnvironment::_remove_string_from_world(const std::string & s) const
value_for<n::environment>(this),
value_for<n::file_name>(_imp->world_file),
value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, this,
- UserPackageDepSpecOptions() + updso_no_disambiguation, filter::All())),
+ UserPackageDepSpecOptions() + updso_no_disambiguation, filter::All(), make_null_shared_ptr())),
value_for<n::set_operator_mode>(sfsmo_natural),
value_for<n::tag>(std::tr1::shared_ptr<DepTag>()),
value_for<n::type>(sft_simple)
@@ -998,7 +999,8 @@ namespace
value_for<n::environment>(env),
value_for<n::file_name>(f),
value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, std::tr1::placeholders::_1,
- env, UserPackageDepSpecOptions() + updso_no_disambiguation, filter::All())),
+ env, UserPackageDepSpecOptions() + updso_no_disambiguation, filter::All(),
+ make_null_shared_ptr())),
value_for<n::set_operator_mode>(sfsmo_natural),
value_for<n::tag>(tag),
value_for<n::type>(sft_simple)
diff --git a/paludis/repositories/e/e_repository_sets.cc b/paludis/repositories/e/e_repository_sets.cc
index 689fa67..4234a81 100644
--- a/paludis/repositories/e/e_repository_sets.cc
+++ b/paludis/repositories/e/e_repository_sets.cc
@@ -121,7 +121,8 @@ ERepositorySets::package_set(const SetName & ss) const
SetFile f(make_named_values<SetFileParams>(
value_for<n::environment>(_imp->environment),
value_for<n::file_name>(ff),
- value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, _imp->environment, UserPackageDepSpecOptions() + updso_no_disambiguation + updso_throw_if_set, filter::All())),
+ value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, _imp->environment,
+ UserPackageDepSpecOptions() + updso_no_disambiguation + updso_throw_if_set, filter::All(), make_null_shared_ptr())),
value_for<n::set_operator_mode>(s.second),
value_for<n::tag>(tag),
value_for<n::type>(sft_paludis_conf)
diff --git a/paludis/set_file_TEST.cc b/paludis/set_file_TEST.cc
index dbc703f..3f78674 100644
--- a/paludis/set_file_TEST.cc
+++ b/paludis/set_file_TEST.cc
@@ -70,7 +70,8 @@ namespace test_cases
SetFile f(make_named_values<SetFileParams>(
value_for<n::environment>(static_cast<Environment *>(0)),
value_for<n::file_name>(FSEntry("set_file_TEST_dir/simple1")),
- value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, &env, UserPackageDepSpecOptions(), filter::All())),
+ value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, &env, UserPackageDepSpecOptions(), filter::All(),
+ make_null_shared_ptr())),
value_for<n::set_operator_mode>(sfsmo_natural),
value_for<n::tag>(std::tr1::shared_ptr<DepTag>()),
value_for<n::type>(sft_simple)
@@ -137,7 +138,8 @@ namespace test_cases
SetFile f(make_named_values<SetFileParams>(
value_for<n::environment>(static_cast<Environment *>(0)),
value_for<n::file_name>(FSEntry("set_file_TEST_dir/paludisconf1")),
- value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, &env, UserPackageDepSpecOptions(), filter::All())),
+ value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, &env, UserPackageDepSpecOptions(), filter::All(),
+ make_null_shared_ptr())),
value_for<n::set_operator_mode>(sfsmo_natural),
value_for<n::tag>(std::tr1::shared_ptr<DepTag>()),
value_for<n::type>(sft_paludis_conf)
@@ -207,7 +209,8 @@ namespace test_cases
SetFile f(make_named_values<SetFileParams>(
value_for<n::environment>(static_cast<Environment *>(0)),
value_for<n::file_name>(FSEntry("set_file_TEST_dir/override")),
- value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, &env, UserPackageDepSpecOptions(), filter::All())),
+ value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, &env, UserPackageDepSpecOptions(), filter::All(),
+ make_null_shared_ptr())),
value_for<n::set_operator_mode>(sfsmo_natural),
value_for<n::tag>(std::tr1::shared_ptr<DepTag>()),
value_for<n::type>(sft_paludis_conf)
@@ -222,7 +225,8 @@ namespace test_cases
SetFile fstar(make_named_values<SetFileParams>(
value_for<n::environment>(static_cast<Environment *>(0)),
value_for<n::file_name>(FSEntry("set_file_TEST_dir/override")),
- value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, &env, UserPackageDepSpecOptions(), filter::All())),
+ value_for<n::parser>(std::tr1::bind(&parse_user_package_dep_spec, _1, &env, UserPackageDepSpecOptions(), filter::All(),
+ make_null_shared_ptr())),
value_for<n::set_operator_mode>(sfsmo_star),
value_for<n::tag>(std::tr1::shared_ptr<DepTag>()),
value_for<n::type>(sft_paludis_conf)
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index bcc85e8..054f9dc 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -92,8 +92,11 @@ namespace
}
bool user_remove_trailing_square_bracket_if_exists(std::string & s, PartiallyMadePackageDepSpec & result,
- bool & had_bracket_version_requirements)
+ bool & had_bracket_version_requirements, const ELikeUseRequirementOptions & options,
+ const std::tr1::shared_ptr<const PackageID> & for_id)
{
+ Context context("When removing trailing square bracket parts:");
+
std::string::size_type use_group_p;
if (std::string::npos == ((use_group_p = s.rfind('['))))
return false;
@@ -186,7 +189,7 @@ namespace
default:
{
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req(parse_elike_use_requirement(flag,
- std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions()));
+ for_id, options));
result.additional_requirement(req);
}
break;
@@ -287,7 +290,8 @@ namespace
PackageDepSpec
paludis::parse_user_package_dep_spec(const std::string & ss, const Environment * const env,
- const UserPackageDepSpecOptions & options, const Filter & filter)
+ const UserPackageDepSpecOptions & options, const Filter & filter,
+ const std::tr1::shared_ptr<const PackageID> & for_id)
{
using namespace std::tr1::placeholders;
@@ -296,6 +300,15 @@ paludis::parse_user_package_dep_spec(const std::string & ss, const Environment *
bool had_bracket_version_requirements(false);
PartiallyMadePackageDepSpecOptions o;
+ ELikePackageDepSpecOptions eo(ELikePackageDepSpecOptions() + epdso_allow_tilde_greater_deps + epdso_nice_equal_star);
+ ELikeUseRequirementOptions uo;
+ if (options[updso_serialised])
+ {
+ eo = eo + epdso_allow_ranged_deps + epdso_allow_use_deps + epdso_allow_use_deps_portage + epdso_allow_use_dep_defaults
+ + epdso_allow_repository_deps + epdso_allow_slot_star_deps + epdso_allow_slot_equal_deps + epdso_allow_slot_deps;
+ uo = uo + euro_allow_self_deps + euro_both_syntaxes + euro_portage_syntax + euro_allow_default_values + euro_strict_parsing;
+ }
+
return partial_parse_generic_elike_package_dep_spec(ss, make_named_values<GenericELikePackageDepSpecParseFunctions>(
value_for<n::add_package_requirement>(std::tr1::bind(&user_add_package_requirement, _1, _2, env, options, filter)),
value_for<n::add_version_requirement>(std::tr1::bind(&elike_add_version_requirement, _1, _2, _3)),
@@ -305,12 +318,12 @@ paludis::parse_user_package_dep_spec(const std::string & ss, const Environment *
value_for<n::get_remove_version_operator>(std::tr1::bind(&elike_get_remove_version_operator, _1,
ELikePackageDepSpecOptions() + epdso_allow_tilde_greater_deps + epdso_nice_equal_star)),
value_for<n::has_version_operator>(std::tr1::bind(&elike_has_version_operator, _1,
- std::tr1::cref(had_bracket_version_requirements), ELikePackageDepSpecOptions())),
+ std::tr1::cref(had_bracket_version_requirements), eo)),
value_for<n::options_for_partially_made_package_dep_spec>(std::tr1::bind(&fixed_options_for_partially_made_package_dep_spec, o)),
value_for<n::remove_trailing_repo_if_exists>(std::tr1::bind(&user_remove_trailing_repo_if_exists, _1, _2)),
value_for<n::remove_trailing_slot_if_exists>(std::tr1::bind(&user_remove_trailing_slot_if_exists, _1, _2)),
value_for<n::remove_trailing_square_bracket_if_exists>(std::tr1::bind(&user_remove_trailing_square_bracket_if_exists,
- _1, _2, std::tr1::ref(had_bracket_version_requirements)))
+ _1, _2, std::tr1::ref(had_bracket_version_requirements), uo, for_id))
));
}
diff --git a/paludis/user_dep_spec.hh b/paludis/user_dep_spec.hh
index 4433a5f..3df3902 100644
--- a/paludis/user_dep_spec.hh
+++ b/paludis/user_dep_spec.hh
@@ -31,6 +31,9 @@ namespace paludis
/**
* Create a PackageDepSpec from user input.
*
+ * \param package_id should generally be null, unless updso_serialised and there
+ * might be [use=] deps. \since 0.40
+ *
* \ingroup g_dep_spec
* \since 0.28
*/
@@ -38,7 +41,9 @@ namespace paludis
const std::string &,
const Environment * const,
const UserPackageDepSpecOptions &,
- const Filter & = filter::All()) PALUDIS_VISIBLE;
+ const Filter & = filter::All(),
+ const std::tr1::shared_ptr<const PackageID> & = std::tr1::shared_ptr<const PackageID>()
+ ) PALUDIS_VISIBLE;
class PALUDIS_VISIBLE UserSlotExactRequirement :
public SlotExactRequirement
diff --git a/paludis/user_dep_spec.se b/paludis/user_dep_spec.se
index a48f5ba..ef6caf5 100644
--- a/paludis/user_dep_spec.se
+++ b/paludis/user_dep_spec.se
@@ -8,6 +8,7 @@ make_enum_UserPackageDepSpecOption()
key updso_allow_wildcards "Allow wildcards for category, package"
key updso_throw_if_set "Check if it's a set, and throw GotASetNotAPackageDepSpec if so. \since 0.28"
key updso_no_disambiguation "Require an explicit category. \since 0.28"
+ key updso_serialised "Allow things that wouldn't be allowed for users. \since 0.40"
doxygen_comment << "END"
/**