aboutsummaryrefslogtreecommitdiff
path: root/paludis
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-30 11:37:31 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-04 08:32:59 +0100
commit28626b8aa3b39d400f8f9eb3a0730ac101b2e53a (patch)
treec60cfb02dcee2efcf7045ccfd53316e5a8fe94a8 /paludis
parenta004eeed5dda3432dcb1a4c0a865ae24daae4fd3 (diff)
downloadpaludis-28626b8aa3b39d400f8f9eb3a0730ac101b2e53a.tar.gz
paludis-28626b8aa3b39d400f8f9eb3a0730ac101b2e53a.tar.xz
slot to requirements
Diffstat (limited to 'paludis')
-rw-r--r--paludis/common_sets.cc6
-rw-r--r--paludis/dep_spec.cc12
-rw-r--r--paludis/dep_spec.hh16
-rw-r--r--paludis/dep_spec_data.hh16
-rw-r--r--paludis/elike_package_dep_spec.cc9
-rw-r--r--paludis/elike_slot_requirement-fwd.hh30
-rw-r--r--paludis/elike_slot_requirement.cc54
-rw-r--r--paludis/elike_slot_requirement.hh58
-rw-r--r--paludis/files.m42
-rw-r--r--paludis/generator.cc3
-rw-r--r--paludis/match_package.cc42
-rw-r--r--paludis/package_dep_spec_constraint-fwd.hh6
-rw-r--r--paludis/package_dep_spec_constraint.cc41
-rw-r--r--paludis/package_dep_spec_constraint.hh46
-rw-r--r--paludis/package_dep_spec_properties.cc3
-rw-r--r--paludis/package_dep_spec_properties.hh8
-rw-r--r--paludis/paludislike_options_conf.cc3
-rw-r--r--paludis/partially_made_package_dep_spec.cc59
-rw-r--r--paludis/partially_made_package_dep_spec.hh28
-rw-r--r--paludis/repositories/e/e_repository_sets.cc1
-rw-r--r--paludis/repositories/e/fix_locked_dependencies.cc13
-rw-r--r--paludis/repositories/virtuals/package_id.cc3
-rw-r--r--paludis/resolver/collect_depped_upon.cc7
-rw-r--r--paludis/resolver/decider.cc37
-rw-r--r--paludis/resolver/find_replacing_helper.cc1
-rw-r--r--paludis/resolver/get_constraints_for_dependent_helper.cc3
-rw-r--r--paludis/resolver/get_constraints_for_purge_helper.cc3
-rw-r--r--paludis/resolver/get_destination_types_for_blocker_helper.cc1
-rw-r--r--paludis/resolver/get_destination_types_for_error_helper.cc1
-rw-r--r--paludis/resolver/match_qpns.cc3
-rw-r--r--paludis/resolver/resolver_test.cc1
-rw-r--r--paludis/resolver/sanitised_dependencies.cc1
-rw-r--r--paludis/set_file.cc17
-rw-r--r--paludis/slot_requirement-fwd.hh36
-rw-r--r--paludis/slot_requirement.cc31
-rw-r--r--paludis/slot_requirement.hh59
-rw-r--r--paludis/user_dep_spec-fwd.hh4
-rw-r--r--paludis/user_dep_spec.cc18
-rw-r--r--paludis/user_dep_spec.hh19
-rw-r--r--paludis/user_dep_spec_TEST.cc6
40 files changed, 257 insertions, 450 deletions
diff --git a/paludis/common_sets.cc b/paludis/common_sets.cc
index 183c2a4f0..308e3b868 100644
--- a/paludis/common_sets.cc
+++ b/paludis/common_sets.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 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
@@ -27,7 +27,6 @@
#include <paludis/filtered_generator.hh>
#include <paludis/metadata_key.hh>
#include <paludis/package_id.hh>
-#include <paludis/elike_slot_requirement.hh>
#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -59,8 +58,7 @@ namespace
result->top()->append(std::make_shared<PackageDepSpec>(
make_package_dep_spec({ })
.package((*i)->name())
- .slot_requirement(std::make_shared<ELikeSlotExactRequirement>(
- (*i)->slot_key()->value(), false))
+ .exact_slot_constraint((*i)->slot_key()->value(), false)
));
else
result->top()->append(std::make_shared<PackageDepSpec>(
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 4b5fe744b..432f0fbf6 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -572,10 +572,16 @@ PackageDepSpec::version_requirements_mode() const
return _imp->data->version_requirements_mode();
}
-std::shared_ptr<const SlotRequirement>
-PackageDepSpec::slot_requirement_ptr() const
+const std::shared_ptr<const AnySlotConstraint>
+PackageDepSpec::any_slot_constraint() const
{
- return _imp->data->slot_requirement_ptr();
+ return _imp->data->any_slot_constraint();
+}
+
+const std::shared_ptr<const ExactSlotConstraint>
+PackageDepSpec::exact_slot_constraint() const
+{
+ return _imp->data->exact_slot_constraint();
}
const std::shared_ptr<const InRepositoryConstraint>
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index d99e9f154..9c6bb9ae2 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -34,7 +34,6 @@
#include <paludis/version_operator-fwd.hh>
#include <paludis/version_requirements-fwd.hh>
#include <paludis/version_spec-fwd.hh>
-#include <paludis/slot_requirement-fwd.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/environment-fwd.hh>
#include <paludis/additional_package_dep_spec_requirement-fwd.hh>
@@ -351,9 +350,20 @@ namespace paludis
VersionRequirementsMode version_requirements_mode() const;
/**
- * Fetch the slot requirement (may be a zero pointer).
+ * Fetch the single ExactSlotConstraint, if we have one, or
+ * a null pointer otherwise.
+ *
+ * \since 0.61
+ */
+ const std::shared_ptr<const ExactSlotConstraint> exact_slot_constraint() const;
+
+ /**
+ * Fetch the single AnySlotConstraint, if we have one, or
+ * a null pointer otherwise.
+ *
+ * \since 0.61
*/
- std::shared_ptr<const SlotRequirement> slot_requirement_ptr() const;
+ const std::shared_ptr<const AnySlotConstraint> any_slot_constraint() const;
/**
* Fetch the single InRepositoryConstraint, if we have one, or
diff --git a/paludis/dep_spec_data.hh b/paludis/dep_spec_data.hh
index 4652caf2f..6f4dc6458 100644
--- a/paludis/dep_spec_data.hh
+++ b/paludis/dep_spec_data.hh
@@ -27,7 +27,6 @@
#include <paludis/name-fwd.hh>
#include <paludis/version_operator-fwd.hh>
#include <paludis/version_requirements-fwd.hh>
-#include <paludis/slot_requirement-fwd.hh>
#include <paludis/additional_package_dep_spec_requirement-fwd.hh>
#include <paludis/dep_spec-fwd.hh>
#include <paludis/partially_made_package_dep_spec-fwd.hh>
@@ -148,9 +147,20 @@ namespace paludis
virtual VersionRequirementsMode version_requirements_mode() const = 0;
/**
- * Fetch the slot name (may be a zero pointer).
+ * Fetch the single ExactSlotConstraint, if we have one, or
+ * a null pointer otherwise.
+ *
+ * \since 0.61
+ */
+ virtual const std::shared_ptr<const ExactSlotConstraint> exact_slot_constraint() const = 0;
+
+ /**
+ * Fetch the single AnySlotConstraint, if we have one, or
+ * a null pointer otherwise.
+ *
+ * \since 0.61
*/
- virtual std::shared_ptr<const SlotRequirement> slot_requirement_ptr() const = 0;
+ virtual const std::shared_ptr<const AnySlotConstraint> any_slot_constraint() const = 0;
/**
* Fetch the single InRepositoryConstraint, if we have one, or
diff --git a/paludis/elike_package_dep_spec.cc b/paludis/elike_package_dep_spec.cc
index 91433ef17..1c70cdb3b 100644
--- a/paludis/elike_package_dep_spec.cc
+++ b/paludis/elike_package_dep_spec.cc
@@ -19,7 +19,6 @@
#include <paludis/elike_package_dep_spec.hh>
#include <paludis/elike_use_requirement.hh>
-#include <paludis/elike_slot_requirement.hh>
#include <paludis/util/options.hh>
#include <paludis/util/log.hh>
#include <paludis/util/make_named_values.hh>
@@ -292,7 +291,7 @@ paludis::elike_remove_trailing_slot_if_exists(std::string & s, PartiallyMadePack
Log::get_instance()->message("e.package_dep_spec.slot_star_not_allowed", ll_warning, lc_context)
<< "Slot '*' dependencies not safe for use here";
}
- result.slot_requirement(std::make_shared<ELikeSlotAnyUnlockedRequirement>());
+ result.any_slot_constraint(false);
}
else if ('=' == match.at(0))
{
@@ -306,9 +305,9 @@ paludis::elike_remove_trailing_slot_if_exists(std::string & s, PartiallyMadePack
}
if (1 == match.length())
- result.slot_requirement(std::make_shared<ELikeSlotAnyLockedRequirement>());
+ result.any_slot_constraint(true);
else
- result.slot_requirement(std::make_shared<ELikeSlotExactRequirement>(SlotName(s.substr(slot_p + 2)), true));
+ result.exact_slot_constraint(SlotName(s.substr(slot_p + 2)), true);
}
else
{
@@ -320,7 +319,7 @@ paludis::elike_remove_trailing_slot_if_exists(std::string & s, PartiallyMadePack
Log::get_instance()->message("e.package_dep_spec.slot_not_allowed", ll_warning, lc_context)
<< "Slot dependencies not safe for use here";
}
- result.slot_requirement(std::make_shared<ELikeSlotExactRequirement>(SlotName(s.substr(slot_p + 1)), false));
+ result.exact_slot_constraint(SlotName(s.substr(slot_p + 1)), false);
}
s.erase(slot_p);
}
diff --git a/paludis/elike_slot_requirement-fwd.hh b/paludis/elike_slot_requirement-fwd.hh
deleted file mode 100644
index 9ec151304..000000000
--- a/paludis/elike_slot_requirement-fwd.hh
+++ /dev/null
@@ -1,30 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2008 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
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_ELIKE_SLOT_REQUIREMENT_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_ELIKE_SLOT_REQUIREMENT_FWD_HH 1
-
-namespace paludis
-{
- class ELikeSlotExactRequirement;
- class ELikeSlotAnyLockedRequirement;
- class ELikeSlotAnyUnlockedRequirement;
-}
-
-#endif
diff --git a/paludis/elike_slot_requirement.cc b/paludis/elike_slot_requirement.cc
deleted file mode 100644
index ea52fe434..000000000
--- a/paludis/elike_slot_requirement.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2008 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
- */
-
-#include <paludis/elike_slot_requirement.hh>
-#include <paludis/util/stringify.hh>
-
-using namespace paludis;
-
-ELikeSlotExactRequirement::ELikeSlotExactRequirement(const SlotName & s, const bool e) :
- _s(s),
- _e(e)
-{
-}
-
-const std::string
-ELikeSlotExactRequirement::as_string() const
-{
- return ":" + std::string(_e ? "=" : "") + stringify(_s);
-}
-
-const SlotName
-ELikeSlotExactRequirement::slot() const
-{
- return _s;
-}
-
-const std::string
-ELikeSlotAnyUnlockedRequirement::as_string() const
-{
- return ":*";
-}
-
-const std::string
-ELikeSlotAnyLockedRequirement::as_string() const
-{
- return ":=";
-}
-
diff --git a/paludis/elike_slot_requirement.hh b/paludis/elike_slot_requirement.hh
deleted file mode 100644
index ad33609ef..000000000
--- a/paludis/elike_slot_requirement.hh
+++ /dev/null
@@ -1,58 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2008 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
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_ELIKE_SLOT_REQUIREMENT_HH
-#define PALUDIS_GUARD_PALUDIS_ELIKE_SLOT_REQUIREMENT_HH 1
-
-#include <paludis/elike_slot_requirement-fwd.hh>
-#include <paludis/slot_requirement.hh>
-#include <paludis/name.hh>
-
-namespace paludis
-{
- class PALUDIS_VISIBLE ELikeSlotExactRequirement :
- public SlotExactRequirement
- {
- private:
- const SlotName _s;
- const bool _e;
-
- public:
- ELikeSlotExactRequirement(const SlotName &, const bool equals);
-
- virtual const std::string as_string() const PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const SlotName slot() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE ELikeSlotAnyUnlockedRequirement :
- public SlotAnyUnlockedRequirement
- {
- public:
- virtual const std::string as_string() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE ELikeSlotAnyLockedRequirement :
- public SlotAnyLockedRequirement
- {
- public:
- virtual const std::string as_string() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-}
-
-#endif
diff --git a/paludis/files.m4 b/paludis/files.m4
index abc367b12..7b69c2d81 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -38,7 +38,6 @@ add(`elike_choices', `hh', `cc', `fwd', `se')
add(`elike_dep_parser', `hh', `cc', `fwd', `gtest', `se')
add(`elike_conditional_dep_spec', `hh', `cc', `fwd')
add(`elike_package_dep_spec', `hh', `cc', `fwd', `se')
-add(`elike_slot_requirement', `hh', `cc', `fwd')
add(`elike_use_requirement', `hh', `cc', `fwd', `se', `gtest')
add(`environment', `hh', `fwd', `cc')
add(`environment_factory', `hh', `fwd', `cc')
@@ -93,7 +92,6 @@ add(`selection_cache', `hh', `cc', `fwd')
add(`selection_handler', `hh', `cc', `fwd')
add(`serialise', `hh', `cc', `fwd', `impl')
add(`set_file', `hh', `cc', `se', `gtest', `testscript')
-add(`slot_requirement', `hh', `fwd', `cc')
add(`spec_tree', `hh', `fwd', `cc')
add(`standard_output_manager', `hh', `cc', `fwd')
add(`stripper', `hh', `cc', `fwd', `gtest', `testscript')
diff --git a/paludis/generator.cc b/paludis/generator.cc
index 1484bbb29..bc5dcdae8 100644
--- a/paludis/generator.cc
+++ b/paludis/generator.cc
@@ -306,7 +306,9 @@ namespace
{
if (package_dep_spec_has_properties(spec, make_named_values<PackageDepSpecProperties>(
n::has_additional_requirements() = indeterminate,
+ n::has_any_slot_requirement() = indeterminate,
n::has_category_name_part() = indeterminate,
+ n::has_exact_slot_requirement() = indeterminate,
n::has_from_repository() = indeterminate,
n::has_in_repository() = false,
n::has_installable_to_path() = indeterminate,
@@ -314,7 +316,6 @@ namespace
n::has_installed_at_path() = false,
n::has_package() = indeterminate,
n::has_package_name_part() = indeterminate,
- n::has_slot_requirement() = indeterminate,
n::has_tag() = indeterminate,
n::has_version_requirements() = indeterminate
)))
diff --git a/paludis/match_package.cc b/paludis/match_package.cc
index 9995bf35f..424628f3b 100644
--- a/paludis/match_package.cc
+++ b/paludis/match_package.cc
@@ -23,7 +23,6 @@
#include <paludis/environment.hh>
#include <paludis/version_requirements.hh>
#include <paludis/package_id.hh>
-#include <paludis/slot_requirement.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
#include <paludis/repository.hh>
@@ -47,36 +46,6 @@ using namespace paludis;
#include <paludis/match_package-se.cc>
-namespace
-{
- struct SlotRequirementChecker
- {
- const std::shared_ptr<const PackageID> id;
- bool result;
-
- SlotRequirementChecker(const std::shared_ptr<const PackageID> & i) :
- id(i),
- result(true)
- {
- }
-
- void visit(const SlotExactRequirement & s)
- {
- result = id->slot_key() && id->slot_key()->value() == s.slot();
- }
-
- void visit(const SlotAnyLockedRequirement &)
- {
- result = true;
- }
-
- void visit(const SlotAnyUnlockedRequirement &)
- {
- result = true;
- }
- };
-}
-
bool
paludis::match_package_with_maybe_changes(
const Environment & env,
@@ -194,14 +163,17 @@ paludis::match_package_with_maybe_changes(
return false;
}
- if (spec.slot_requirement_ptr())
+ if (spec.exact_slot_constraint())
{
- SlotRequirementChecker v(id);
- spec.slot_requirement_ptr()->accept(v);
- if (! v.result)
+ if ((! id->slot_key()) || (id->slot_key()->value() != spec.exact_slot_constraint()->name()))
return false;
}
+ if (spec.any_slot_constraint())
+ {
+ /* don't care */
+ }
+
if (! options[mpo_ignore_additional_requirements])
{
if (spec.additional_requirements_ptr())
diff --git a/paludis/package_dep_spec_constraint-fwd.hh b/paludis/package_dep_spec_constraint-fwd.hh
index b949a2b7f..b8c43a693 100644
--- a/paludis/package_dep_spec_constraint-fwd.hh
+++ b/paludis/package_dep_spec_constraint-fwd.hh
@@ -49,6 +49,12 @@ namespace paludis
class InstallableToRepositoryConstraint;
typedef Pool<InstallableToRepositoryConstraint> InstallableToRepositoryConstraintPool;
+
+ class ExactSlotConstraint;
+ typedef Pool<ExactSlotConstraint> ExactSlotConstraintPool;
+
+ class AnySlotConstraint;
+ typedef Pool<AnySlotConstraint> AnySlotConstraintPool;
}
#endif
diff --git a/paludis/package_dep_spec_constraint.cc b/paludis/package_dep_spec_constraint.cc
index dc1f4ad65..b1e6b96c9 100644
--- a/paludis/package_dep_spec_constraint.cc
+++ b/paludis/package_dep_spec_constraint.cc
@@ -184,3 +184,44 @@ template class Singleton<Pool<InstallableToRepositoryConstraint> >;
template const std::shared_ptr<const InstallableToRepositoryConstraint> Pool<InstallableToRepositoryConstraint>::create(
const RepositoryName &, const bool & ...) const;
+ExactSlotConstraint::ExactSlotConstraint(const SlotName & n, const bool i) :
+ _name(n),
+ _locked(i)
+{
+}
+
+ExactSlotConstraint::~ExactSlotConstraint() = default;
+
+const SlotName
+ExactSlotConstraint::name() const
+{
+ return _name;
+}
+
+bool
+ExactSlotConstraint::locked() const
+{
+ return _locked;
+}
+
+template class Pool<ExactSlotConstraint>;
+template class Singleton<Pool<ExactSlotConstraint> >;
+template const std::shared_ptr<const ExactSlotConstraint> Pool<ExactSlotConstraint>::create(const SlotName &, const bool & ...) const;
+
+AnySlotConstraint::AnySlotConstraint(const bool i) :
+ _locking(i)
+{
+}
+
+AnySlotConstraint::~AnySlotConstraint() = default;
+
+bool
+AnySlotConstraint::locking() const
+{
+ return _locking;
+}
+
+template class Pool<AnySlotConstraint>;
+template class Singleton<Pool<AnySlotConstraint> >;
+template const std::shared_ptr<const AnySlotConstraint> Pool<AnySlotConstraint>::create(const bool &) const;
+
diff --git a/paludis/package_dep_spec_constraint.hh b/paludis/package_dep_spec_constraint.hh
index 7e71bd646..f23ba66e6 100644
--- a/paludis/package_dep_spec_constraint.hh
+++ b/paludis/package_dep_spec_constraint.hh
@@ -40,7 +40,9 @@ namespace paludis
FromRepositoryConstraint,
InstalledAtPathConstraint,
InstallableToPathConstraint,
- InstallableToRepositoryConstraint
+ InstallableToRepositoryConstraint,
+ AnySlotConstraint,
+ ExactSlotConstraint
>::Type>
{
public:
@@ -203,6 +205,46 @@ namespace paludis
bool include_masked() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
+ class PALUDIS_VISIBLE ExactSlotConstraint :
+ public PackageDepSpecConstraint,
+ public ImplementAcceptMethods<PackageDepSpecConstraint, ExactSlotConstraint>
+ {
+ friend class Pool<ExactSlotConstraint>;
+
+ private:
+ SlotName _name;
+ bool _locked;
+
+ ExactSlotConstraint(const SlotName &, const bool);
+
+ ExactSlotConstraint(const ExactSlotConstraint &) = delete;
+
+ public:
+ ~ExactSlotConstraint();
+
+ const SlotName name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ bool locked() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+ class PALUDIS_VISIBLE AnySlotConstraint :
+ public PackageDepSpecConstraint,
+ public ImplementAcceptMethods<PackageDepSpecConstraint, AnySlotConstraint>
+ {
+ friend class Pool<AnySlotConstraint>;
+
+ private:
+ bool _locking;
+
+ AnySlotConstraint(const bool);
+
+ AnySlotConstraint(const AnySlotConstraint &) = delete;
+
+ public:
+ ~AnySlotConstraint();
+
+ bool locking() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
extern template class Pool<NameConstraint>;
extern template class Pool<PackageNamePartConstraint>;
extern template class Pool<CategoryNamePartConstraint>;
@@ -211,6 +253,8 @@ namespace paludis
extern template class Pool<InstalledAtPathConstraint>;
extern template class Pool<InstallableToPathConstraint>;
extern template class Pool<InstallableToRepositoryConstraint>;
+ extern template class Pool<ExactSlotConstraint>;
+ extern template class Pool<AnySlotConstraint>;
}
#endif
diff --git a/paludis/package_dep_spec_properties.cc b/paludis/package_dep_spec_properties.cc
index dbb057fad..000b20c07 100644
--- a/paludis/package_dep_spec_properties.cc
+++ b/paludis/package_dep_spec_properties.cc
@@ -50,7 +50,8 @@ paludis::package_dep_spec_has_properties(const PackageDepSpec & spec, const Pack
result = result && check(bool(spec.installed_at_path_constraint()), properties.has_installed_at_path());
result = result && check(bool(spec.package_name_constraint()), properties.has_package());
result = result && check(bool(spec.package_name_part_constraint()), properties.has_package_name_part());
- result = result && check(bool(spec.slot_requirement_ptr()), properties.has_slot_requirement());
+ result = result && check(bool(spec.exact_slot_constraint()), properties.has_exact_slot_requirement());
+ result = result && check(bool(spec.any_slot_constraint()), properties.has_any_slot_requirement());
result = result && check(spec.version_requirements_ptr() && ! spec.version_requirements_ptr()->empty(), properties.has_version_requirements());
return result;
diff --git a/paludis/package_dep_spec_properties.hh b/paludis/package_dep_spec_properties.hh
index 45ed0fac6..e9eff067c 100644
--- a/paludis/package_dep_spec_properties.hh
+++ b/paludis/package_dep_spec_properties.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 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
@@ -29,7 +29,9 @@ namespace paludis
namespace n
{
typedef Name<struct name_has_additional_requirements> has_additional_requirements;
+ typedef Name<struct name_has_any_slot_requirement> has_any_slot_requirement;
typedef Name<struct name_has_category_name_part> has_category_name_part;
+ typedef Name<struct name_has_exact_slot_requirement> has_exact_slot_requirement;
typedef Name<struct name_has_from_repository> has_from_repository;
typedef Name<struct name_has_in_repository> has_in_repository;
typedef Name<struct name_has_installable_to_path> has_installable_to_path;
@@ -37,7 +39,6 @@ namespace paludis
typedef Name<struct name_has_installed_at_path> has_installed_at_path;
typedef Name<struct name_has_package> has_package;
typedef Name<struct name_has_package_name_part> has_package_name_part;
- typedef Name<struct name_has_slot_requirement> has_slot_requirement;
typedef Name<struct name_has_tag> has_tag;
typedef Name<struct name_has_version_requirements> has_version_requirements;
}
@@ -51,7 +52,9 @@ namespace paludis
struct PackageDepSpecProperties
{
NamedValue<n::has_additional_requirements, Tribool> has_additional_requirements;
+ NamedValue<n::has_any_slot_requirement, Tribool> has_any_slot_requirement;
NamedValue<n::has_category_name_part, Tribool> has_category_name_part;
+ NamedValue<n::has_exact_slot_requirement, Tribool> has_exact_slot_requirement;
NamedValue<n::has_from_repository, Tribool> has_from_repository;
NamedValue<n::has_in_repository, Tribool> has_in_repository;
NamedValue<n::has_installable_to_path, Tribool> has_installable_to_path;
@@ -59,7 +62,6 @@ namespace paludis
NamedValue<n::has_installed_at_path, Tribool> has_installed_at_path;
NamedValue<n::has_package, Tribool> has_package;
NamedValue<n::has_package_name_part, Tribool> has_package_name_part;
- NamedValue<n::has_slot_requirement, Tribool> has_slot_requirement;
NamedValue<n::has_tag, Tribool> has_tag;
NamedValue<n::has_version_requirements, Tribool> has_version_requirements;
};
diff --git a/paludis/paludislike_options_conf.cc b/paludis/paludislike_options_conf.cc
index 471f437f8..8af91db93 100644
--- a/paludis/paludislike_options_conf.cc
+++ b/paludis/paludislike_options_conf.cc
@@ -342,7 +342,9 @@ namespace
{
return package_dep_spec_has_properties(spec, make_named_values<PackageDepSpecProperties>(
n::has_additional_requirements() = false,
+ n::has_any_slot_requirement() = indeterminate,
n::has_category_name_part() = false,
+ n::has_exact_slot_requirement() = false,
n::has_from_repository() = false,
n::has_in_repository() = false,
n::has_installable_to_path() = false,
@@ -350,7 +352,6 @@ namespace
n::has_installed_at_path() = false,
n::has_package() = false,
n::has_package_name_part() = false,
- n::has_slot_requirement() = false,
n::has_tag() = false,
n::has_version_requirements() = false
));
diff --git a/paludis/partially_made_package_dep_spec.cc b/paludis/partially_made_package_dep_spec.cc
index 5de8177f4..b070d0c06 100644
--- a/paludis/partially_made_package_dep_spec.cc
+++ b/paludis/partially_made_package_dep_spec.cc
@@ -53,7 +53,8 @@ namespace
std::shared_ptr<const CategoryNamePartConstraint> category_name_part;
std::shared_ptr<VersionRequirements> version_requirements;
VersionRequirementsMode version_requirements_mode_v;
- std::shared_ptr<const SlotRequirement> slot;
+ std::shared_ptr<const AnySlotConstraint> any_slot;
+ std::shared_ptr<const ExactSlotConstraint> exact_slot;
std::shared_ptr<const InRepositoryConstraint> in_repository;
std::shared_ptr<const FromRepositoryConstraint> from_repository;
std::shared_ptr<const InstallableToRepositoryConstraint> installable_to_repository;
@@ -76,7 +77,8 @@ namespace
category_name_part(other.category_name_part_constraint()),
version_requirements(other.version_requirements_ptr() ? new VersionRequirements : 0),
version_requirements_mode_v(other.version_requirements_mode()),
- slot(other.slot_requirement_ptr()),
+ any_slot(other.any_slot_constraint()),
+ exact_slot(other.exact_slot_constraint()),
in_repository(other.in_repository_constraint()),
from_repository(other.from_repository_constraint()),
installable_to_repository(other.installable_to_repository_constraint()),
@@ -101,7 +103,8 @@ namespace
category_name_part(other.category_name_part),
version_requirements(other.version_requirements),
version_requirements_mode_v(other.version_requirements_mode_v),
- slot(other.slot),
+ any_slot(other.any_slot),
+ exact_slot(other.exact_slot),
in_repository(other.in_repository),
from_repository(other.from_repository),
installable_to_repository(other.installable_to_repository),
@@ -162,8 +165,23 @@ namespace
}
}
- if (slot_requirement_ptr())
- s << stringify(*slot_requirement_ptr());
+ if (exact_slot_constraint())
+ {
+ if (exact_slot_constraint()->locked())
+ s << ":=";
+ else
+ s << ":";
+
+ s << stringify(exact_slot_constraint()->name());
+ }
+
+ if (any_slot_constraint())
+ {
+ if (any_slot_constraint()->locking())
+ s << ":=";
+ else
+ s << ":*";
+ }
std::string left, right;
bool need_arrow(false);
@@ -303,9 +321,14 @@ namespace
return version_requirements_mode_v;
}
- virtual std::shared_ptr<const SlotRequirement> slot_requirement_ptr() const
+ virtual const std::shared_ptr<const ExactSlotConstraint> exact_slot_constraint() const
+ {
+ return exact_slot;
+ }
+
+ virtual const std::shared_ptr<const AnySlotConstraint> any_slot_constraint() const
{
- return slot;
+ return any_slot;
}
virtual const std::shared_ptr<const InRepositoryConstraint> in_repository_constraint() const
@@ -403,16 +426,30 @@ PartiallyMadePackageDepSpec::clear_package()
}
PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::slot_requirement(const std::shared_ptr<const SlotRequirement> & s)
+PartiallyMadePackageDepSpec::any_slot_constraint(const bool s)
+{
+ _imp->data->any_slot = AnySlotConstraintPool::get_instance()->create(s);
+ return *this;
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::exact_slot_constraint(const SlotName & n, const bool s)
+{
+ _imp->data->exact_slot = ExactSlotConstraintPool::get_instance()->create(n, s);
+ return *this;
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::clear_exact_slot()
{
- _imp->data->slot = s;
+ _imp->data->exact_slot.reset();
return *this;
}
PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::clear_slot_requirement()
+PartiallyMadePackageDepSpec::clear_any_slot()
{
- _imp->data->slot.reset();
+ _imp->data->any_slot.reset();
return *this;
}
diff --git a/paludis/partially_made_package_dep_spec.hh b/paludis/partially_made_package_dep_spec.hh
index 6eb9d5ff7..78f7d16ee 100644
--- a/paludis/partially_made_package_dep_spec.hh
+++ b/paludis/partially_made_package_dep_spec.hh
@@ -63,16 +63,34 @@ namespace paludis
PartiallyMadePackageDepSpec & clear_package();
/**
- * Set our slot requirements, return ourself.
+ * Set our exact slot requirements, return ourself.
+ *
+ * \since 0.61
*/
- PartiallyMadePackageDepSpec & slot_requirement(const std::shared_ptr<const SlotRequirement> &);
+ PartiallyMadePackageDepSpec & exact_slot_constraint(
+ const SlotName &, const bool);
/**
- * Clear our slot requirements, return ourself.
+ * Set our locked slot requirements, return ourself.
*
- * \since 0.55
+ * \since 0.61
+ */
+ PartiallyMadePackageDepSpec & any_slot_constraint(
+ const bool);
+
+ /**
+ * Clear our exact slot requirements, return ourself.
+ *
+ * \since 0.61
+ */
+ PartiallyMadePackageDepSpec & clear_exact_slot();
+
+ /**
+ * Clear our any slot requirements, return ourself.
+ *
+ * \since 0.61
*/
- PartiallyMadePackageDepSpec & clear_slot_requirement();
+ PartiallyMadePackageDepSpec & clear_any_slot();
/**
* Set our in-repository requirement, return ourself.
diff --git a/paludis/repositories/e/e_repository_sets.cc b/paludis/repositories/e/e_repository_sets.cc
index 186b28b61..d9f15fe01 100644
--- a/paludis/repositories/e/e_repository_sets.cc
+++ b/paludis/repositories/e/e_repository_sets.cc
@@ -26,7 +26,6 @@
#include <paludis/action-fwd.hh>
#include <paludis/dep_spec.hh>
-#include <paludis/elike_slot_requirement.hh>
#include <paludis/environment.hh>
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
diff --git a/paludis/repositories/e/fix_locked_dependencies.cc b/paludis/repositories/e/fix_locked_dependencies.cc
index bb613609b..1f952e271 100644
--- a/paludis/repositories/e/fix_locked_dependencies.cc
+++ b/paludis/repositories/e/fix_locked_dependencies.cc
@@ -28,13 +28,13 @@
#include <paludis/dep_spec.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
-#include <paludis/elike_slot_requirement.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/metadata_key.hh>
#include <paludis/partially_made_package_dep_spec.hh>
+#include <paludis/package_dep_spec_constraint.hh>
#include <functional>
#include <algorithm>
#include <list>
@@ -99,11 +99,7 @@ namespace
do
{
- if (! node.spec()->slot_requirement_ptr())
- break;
-
- const SlotAnyLockedRequirement * const r(visitor_cast<const SlotAnyLockedRequirement>(*node.spec()->slot_requirement_ptr()));
- if (! r)
+ if ((! node.spec()->any_slot_constraint()) || (! node.spec()->any_slot_constraint()->locking()))
break;
std::shared_ptr<const PackageIDSequence> matches((*env)[selection::AllVersionsSorted(
@@ -113,8 +109,9 @@ namespace
if ((*matches->last())->slot_key())
{
- PackageDepSpec new_s(PartiallyMadePackageDepSpec(*node.spec()).slot_requirement(
- std::make_shared<ELikeSlotExactRequirement>((*matches->last())->slot_key()->value(), true)));
+ PackageDepSpec new_s(PartiallyMadePackageDepSpec(*node.spec())
+ .clear_any_slot()
+ .exact_slot_constraint((*matches->last())->slot_key()->value(), true));
c = std::make_shared<PackageDepSpec>(new_s);
}
} while (false);
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index a2231e576..f4f48a42f 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -75,8 +75,7 @@ namespace paludis
.version_requirement(make_named_values<VersionRequirement>(
n::version_operator() = vo_equal,
n::version_spec() = v->version()))
- .slot_requirement(std::make_shared<UserSlotExactRequirement>(
- v->slot_key() ? v->slot_key()->value() : SlotName("UNKNOWN")))
+ .exact_slot_constraint(v->slot_key() ? v->slot_key()->value() : SlotName("UNKNOWN"), false)
.in_repository(v->repository_name()))
:
std::make_shared<PackageDepSpec>(
diff --git a/paludis/resolver/collect_depped_upon.cc b/paludis/resolver/collect_depped_upon.cc
index 46bfa86b3..257aae510 100644
--- a/paludis/resolver/collect_depped_upon.cc
+++ b/paludis/resolver/collect_depped_upon.cc
@@ -29,10 +29,10 @@
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
#include <paludis/partially_made_package_dep_spec.hh>
-#include <paludis/elike_slot_requirement.hh>
#include <paludis/metadata_key.hh>
#include <paludis/match_package.hh>
#include <paludis/version_spec.hh>
+#include <paludis/package_dep_spec_constraint.hh>
#include <algorithm>
using namespace paludis;
@@ -108,8 +108,7 @@ namespace
{
auto spec(s.spec());
- if (s.spec()->slot_requirement_ptr() && visitor_cast<const SlotAnyUnlockedRequirement>(
- *s.spec()->slot_requirement_ptr()))
+ if (s.spec()->any_slot_constraint() && ! s.spec()->any_slot_constraint()->locking())
{
auto best_eventual_id(best_eventual(env, *s.spec(), id_for_specs, newly_available));
if (! best_eventual_id)
@@ -117,7 +116,7 @@ namespace
if (best_eventual_id && best_eventual_id->slot_key())
{
PartiallyMadePackageDepSpec part_spec(*s.spec());
- part_spec.slot_requirement(std::make_shared<ELikeSlotExactRequirement>(best_eventual_id->slot_key()->value(), false));
+ part_spec.exact_slot_constraint(best_eventual_id->slot_key()->value(), false);
spec = std::make_shared<PackageDepSpec>(part_spec);
}
}
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index b0e0dbd1b..3af2dc5cd 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -65,10 +65,8 @@
#include <paludis/filter.hh>
#include <paludis/match_package.hh>
#include <paludis/version_requirements.hh>
-#include <paludis/slot_requirement.hh>
#include <paludis/choice.hh>
#include <paludis/action.hh>
-#include <paludis/elike_slot_requirement.hh>
#include <paludis/package_id.hh>
#include <paludis/changed_choices.hh>
#include <paludis/additional_package_dep_spec_requirement.hh>
@@ -1434,27 +1432,6 @@ Decider::find_any_score(
return std::make_pair(acs_not_installable, operator_bias);
}
-namespace
-{
- struct SlotNameFinder
- {
- std::shared_ptr<SlotName> visit(const SlotExactRequirement & s)
- {
- return std::make_shared<SlotName>(s.slot());
- }
-
- std::shared_ptr<SlotName> visit(const SlotAnyUnlockedRequirement &)
- {
- return make_null_shared_ptr();
- }
-
- std::shared_ptr<SlotName> visit(const SlotAnyLockedRequirement &)
- {
- return make_null_shared_ptr();
- }
- };
-}
-
const std::shared_ptr<const Resolvents>
Decider::_get_resolvents_for_blocker(const BlockDepSpec & spec,
const std::shared_ptr<const Reason> & reason) const
@@ -1462,11 +1439,8 @@ Decider::_get_resolvents_for_blocker(const BlockDepSpec & spec,
Context context("When finding slots for '" + stringify(spec) + "':");
std::shared_ptr<SlotName> exact_slot;
- if (spec.blocking().slot_requirement_ptr())
- {
- SlotNameFinder f;
- exact_slot = spec.blocking().slot_requirement_ptr()->accept_returning<std::shared_ptr<SlotName> >(f);
- }
+ if (spec.blocking().exact_slot_constraint())
+ exact_slot = make_shared_copy(spec.blocking().exact_slot_constraint()->name());
DestinationTypes destination_types(_get_destination_types_for_blocker(spec, reason));
std::shared_ptr<Resolvents> result(std::make_shared<Resolvents>());
@@ -1507,11 +1481,8 @@ Decider::_get_resolvents_for(
std::shared_ptr<SlotName> exact_slot;
- if (spec.slot_requirement_ptr())
- {
- SlotNameFinder f;
- exact_slot = spec.slot_requirement_ptr()->accept_returning<std::shared_ptr<SlotName> >(f);
- }
+ if (spec.exact_slot_constraint())
+ exact_slot = make_shared_copy(spec.exact_slot_constraint()->name());
return _imp->fns.get_resolvents_for_fn()(spec, maybe_from_package_id_from_reason(reason), exact_slot, reason);
}
diff --git a/paludis/resolver/find_replacing_helper.cc b/paludis/resolver/find_replacing_helper.cc
index 88e315501..42906b6ec 100644
--- a/paludis/resolver/find_replacing_helper.cc
+++ b/paludis/resolver/find_replacing_helper.cc
@@ -25,7 +25,6 @@
#include <paludis/util/stringify.hh>
#include <paludis/package_id.hh>
#include <paludis/partially_made_package_dep_spec.hh>
-#include <paludis/elike_slot_requirement.hh>
#include <paludis/metadata_key.hh>
#include <paludis/repository.hh>
#include <paludis/environment.hh>
diff --git a/paludis/resolver/get_constraints_for_dependent_helper.cc b/paludis/resolver/get_constraints_for_dependent_helper.cc
index 89ea8b9f6..b725c5885 100644
--- a/paludis/resolver/get_constraints_for_dependent_helper.cc
+++ b/paludis/resolver/get_constraints_for_dependent_helper.cc
@@ -34,7 +34,6 @@
#include <paludis/package_id.hh>
#include <paludis/package_dep_spec_collection.hh>
#include <paludis/partially_made_package_dep_spec.hh>
-#include <paludis/elike_slot_requirement.hh>
#include <paludis/metadata_key.hh>
using namespace paludis;
@@ -85,7 +84,7 @@ GetConstraintsForDependentHelper::operator() (
PartiallyMadePackageDepSpec partial_spec({ });
partial_spec.package(id->name());
if (id->slot_key())
- partial_spec.slot_requirement(std::make_shared<ELikeSlotExactRequirement>(id->slot_key()->value(), false));
+ partial_spec.exact_slot_constraint(id->slot_key()->value(), false);
spec = std::make_shared<PackageDepSpec>(partial_spec);
}
diff --git a/paludis/resolver/get_constraints_for_purge_helper.cc b/paludis/resolver/get_constraints_for_purge_helper.cc
index c410c78f7..eef5082ab 100644
--- a/paludis/resolver/get_constraints_for_purge_helper.cc
+++ b/paludis/resolver/get_constraints_for_purge_helper.cc
@@ -34,7 +34,6 @@
#include <paludis/package_id.hh>
#include <paludis/package_dep_spec_collection.hh>
#include <paludis/partially_made_package_dep_spec.hh>
-#include <paludis/elike_slot_requirement.hh>
#include <paludis/metadata_key.hh>
using namespace paludis;
@@ -80,7 +79,7 @@ GetConstraintsForPurgeHelper::operator() (
PartiallyMadePackageDepSpec partial_spec({ });
partial_spec.package(id->name());
if (id->slot_key())
- partial_spec.slot_requirement(std::make_shared<ELikeSlotExactRequirement>(id->slot_key()->value(), false));
+ partial_spec.exact_slot_constraint(id->slot_key()->value(), false);
PackageDepSpec spec(partial_spec);
const std::shared_ptr<WasUsedByReason> reason(std::make_shared<WasUsedByReason>(was_used_by_ids));
diff --git a/paludis/resolver/get_destination_types_for_blocker_helper.cc b/paludis/resolver/get_destination_types_for_blocker_helper.cc
index 6a8c80ded..6dc2c30b9 100644
--- a/paludis/resolver/get_destination_types_for_blocker_helper.cc
+++ b/paludis/resolver/get_destination_types_for_blocker_helper.cc
@@ -32,7 +32,6 @@
#include <paludis/package_id.hh>
#include <paludis/package_dep_spec_collection.hh>
#include <paludis/partially_made_package_dep_spec.hh>
-#include <paludis/elike_slot_requirement.hh>
#include <paludis/metadata_key.hh>
using namespace paludis;
diff --git a/paludis/resolver/get_destination_types_for_error_helper.cc b/paludis/resolver/get_destination_types_for_error_helper.cc
index efd29b159..a80aefa62 100644
--- a/paludis/resolver/get_destination_types_for_error_helper.cc
+++ b/paludis/resolver/get_destination_types_for_error_helper.cc
@@ -32,7 +32,6 @@
#include <paludis/package_id.hh>
#include <paludis/package_dep_spec_collection.hh>
#include <paludis/partially_made_package_dep_spec.hh>
-#include <paludis/elike_slot_requirement.hh>
#include <paludis/metadata_key.hh>
using namespace paludis;
diff --git a/paludis/resolver/match_qpns.cc b/paludis/resolver/match_qpns.cc
index 366429cc5..2af1ee3d3 100644
--- a/paludis/resolver/match_qpns.cc
+++ b/paludis/resolver/match_qpns.cc
@@ -42,7 +42,9 @@ paludis::resolver::match_qpns(
* but we're lazy) */
if (! package_dep_spec_has_properties(spec, make_named_values<PackageDepSpecProperties>(
n::has_additional_requirements() = false,
+ n::has_any_slot_requirement() = false,
n::has_category_name_part() = indeterminate,
+ n::has_exact_slot_requirement() = false,
n::has_from_repository() = false,
n::has_in_repository() = false,
n::has_installable_to_path() = false,
@@ -50,7 +52,6 @@ paludis::resolver::match_qpns(
n::has_installed_at_path() = false,
n::has_package() = indeterminate,
n::has_package_name_part() = indeterminate,
- n::has_slot_requirement() = false,
n::has_tag() = false,
n::has_version_requirements() = false
)))
diff --git a/paludis/resolver/resolver_test.cc b/paludis/resolver/resolver_test.cc
index 284ac1dbe..820f0f7d6 100644
--- a/paludis/resolver/resolver_test.cc
+++ b/paludis/resolver/resolver_test.cc
@@ -52,7 +52,6 @@
#include <paludis/filtered_generator.hh>
#include <paludis/generator.hh>
#include <paludis/selection.hh>
-#include <paludis/elike_slot_requirement.hh>
#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
diff --git a/paludis/resolver/sanitised_dependencies.cc b/paludis/resolver/sanitised_dependencies.cc
index ac0921fd9..d283ab577 100644
--- a/paludis/resolver/sanitised_dependencies.cc
+++ b/paludis/resolver/sanitised_dependencies.cc
@@ -36,7 +36,6 @@
#include <paludis/util/map.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/spec_tree.hh>
-#include <paludis/slot_requirement.hh>
#include <paludis/metadata_key.hh>
#include <paludis/package_id.hh>
#include <paludis/elike_package_dep_spec.hh>
diff --git a/paludis/set_file.cc b/paludis/set_file.cc
index 6d1c767b9..c5dc4c8ef 100644
--- a/paludis/set_file.cc
+++ b/paludis/set_file.cc
@@ -169,6 +169,18 @@ namespace
}
};
+ PackageDepSpec name_and_slot(const PackageDepSpec & spec)
+ {
+ if (spec.exact_slot_constraint())
+ return make_package_dep_spec({ })
+ .package(spec.package_name_constraint()->name())
+ .exact_slot_constraint(spec.exact_slot_constraint()->name(), spec.exact_slot_constraint()->locked())
+ ;
+ else
+ return make_package_dep_spec({ })
+ .package(spec.package_name_constraint()->name());
+ }
+
void
do_one_conf_line(const std::string & line, std::shared_ptr<SetSpecTree> result,
const SetFileParams & params)
@@ -269,10 +281,7 @@ namespace
Log::get_instance()->message("set_file.bad_operator", ll_warning, lc_context)
<< "Line '" << line << "' uses ?: operator but no environment is available";
else if (! (*params.environment())[selection::SomeArbitraryVersion(generator::Matches(
- make_package_dep_spec({ })
- .package(spec->package_name_constraint()->name())
- .slot_requirement(spec->slot_requirement_ptr()),
- make_null_shared_ptr(), { }) |
+ name_and_slot(*spec), make_null_shared_ptr(), { }) |
filter::InstalledAtRoot(params.environment()->preferred_root_key()->value()))]->empty())
result->top()->append(spec);
}
diff --git a/paludis/slot_requirement-fwd.hh b/paludis/slot_requirement-fwd.hh
deleted file mode 100644
index 09852be46..000000000
--- a/paludis/slot_requirement-fwd.hh
+++ /dev/null
@@ -1,36 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2008 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
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_SLOT_REQUIREMENT_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_SLOT_REQUIREMENT_FWD_HH 1
-
-#include <iosfwd>
-#include <paludis/util/attributes.hh>
-
-namespace paludis
-{
- struct SlotRequirement;
- struct SlotExactRequirement;
- struct SlotAnyLockedRequirement;
- struct SlotAnyUnlockedRequirement;
-
- std::ostream & operator<< (std::ostream &, const SlotRequirement &) PALUDIS_VISIBLE;
-}
-
-#endif
diff --git a/paludis/slot_requirement.cc b/paludis/slot_requirement.cc
deleted file mode 100644
index 97690e7e8..000000000
--- a/paludis/slot_requirement.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2008 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
- */
-
-#include <paludis/slot_requirement.hh>
-#include <ostream>
-
-using namespace paludis;
-
-std::ostream &
-paludis::operator<< (std::ostream & s, const SlotRequirement & r)
-{
- s << r.as_string();
- return s;
-}
-
diff --git a/paludis/slot_requirement.hh b/paludis/slot_requirement.hh
deleted file mode 100644
index d1c329338..000000000
--- a/paludis/slot_requirement.hh
+++ /dev/null
@@ -1,59 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2008, 2011 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
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_SLOT_REQUIREMENT_HH
-#define PALUDIS_GUARD_PALUDIS_SLOT_REQUIREMENT_HH 1
-
-#include <paludis/slot_requirement-fwd.hh>
-#include <paludis/name-fwd.hh>
-#include <paludis/util/visitor.hh>
-#include <paludis/util/type_list.hh>
-
-namespace paludis
-{
- class PALUDIS_VISIBLE SlotRequirement :
- public virtual DeclareAbstractAcceptMethods<SlotRequirement, MakeTypeList<
- SlotExactRequirement, SlotAnyLockedRequirement, SlotAnyUnlockedRequirement>::Type>
- {
- public:
- virtual const std::string as_string() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- };
-
- class PALUDIS_VISIBLE SlotExactRequirement :
- public SlotRequirement,
- public ImplementAcceptMethods<SlotRequirement, SlotExactRequirement>
- {
- public:
- virtual const SlotName slot() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- };
-
- class PALUDIS_VISIBLE SlotAnyLockedRequirement :
- public SlotRequirement,
- public ImplementAcceptMethods<SlotRequirement, SlotAnyLockedRequirement>
- {
- };
-
- class PALUDIS_VISIBLE SlotAnyUnlockedRequirement :
- public SlotRequirement,
- public ImplementAcceptMethods<SlotRequirement, SlotAnyUnlockedRequirement>
- {
- };
-}
-
-#endif
diff --git a/paludis/user_dep_spec-fwd.hh b/paludis/user_dep_spec-fwd.hh
index 4a8a66d5c..c31ce0883 100644
--- a/paludis/user_dep_spec-fwd.hh
+++ b/paludis/user_dep_spec-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2011 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
@@ -63,8 +63,6 @@ namespace paludis
///\}
};
- struct UserSlotExactRequirement;
-
struct UserKeyRequirement;
/**
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index f2590cd8a..c2de82816 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -245,7 +245,7 @@ namespace
std::string::size_type slot_p(s.rfind(':'));
if (std::string::npos != slot_p)
{
- result.slot_requirement(std::make_shared<UserSlotExactRequirement>(SlotName(s.substr(slot_p + 1))));
+ result.exact_slot_constraint(SlotName(s.substr(slot_p + 1)), false);
s.erase(slot_p);
}
}
@@ -376,22 +376,6 @@ paludis::envless_parse_package_dep_spec_for_tests(const std::string & ss)
));
}
-UserSlotExactRequirement::UserSlotExactRequirement(const SlotName & s) :
- _s(s)
-{
-}
-const SlotName
-UserSlotExactRequirement::slot() const
-{
- return _s;
-}
-
-const std::string
-UserSlotExactRequirement::as_string() const
-{
- return ":" + stringify(_s);
-}
-
GotASetNotAPackageDepSpec::GotASetNotAPackageDepSpec(const std::string & s) throw () :
Exception("'" + s + "' is a set, not a package")
{
diff --git a/paludis/user_dep_spec.hh b/paludis/user_dep_spec.hh
index d42684504..656791100 100644
--- a/paludis/user_dep_spec.hh
+++ b/paludis/user_dep_spec.hh
@@ -22,7 +22,6 @@
#include <paludis/user_dep_spec-fwd.hh>
#include <paludis/dep_spec.hh>
-#include <paludis/slot_requirement.hh>
#include <paludis/filter.hh>
#include <paludis/additional_package_dep_spec_requirement.hh>
#include <paludis/util/pimp.hh>
@@ -53,24 +52,6 @@ namespace paludis
PackageDepSpec envless_parse_package_dep_spec_for_tests(
const std::string &) PALUDIS_VISIBLE;
- class PALUDIS_VISIBLE UserSlotExactRequirement :
- public SlotExactRequirement
- {
- private:
- const SlotName _s;
-
- public:
- ///\name Basic operations
- ///\{
-
- UserSlotExactRequirement(const SlotName &);
-
- ///\}
-
- virtual const SlotName slot() const PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const std::string as_string() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
/**
* A key requirement for a user PackageDepSpec.
*
diff --git a/paludis/user_dep_spec_TEST.cc b/paludis/user_dep_spec_TEST.cc
index b8a69c35f..d266be6a0 100644
--- a/paludis/user_dep_spec_TEST.cc
+++ b/paludis/user_dep_spec_TEST.cc
@@ -127,11 +127,11 @@ UserDepSpecTest::check_spec(
}
if (slot_requirement.empty())
- EXPECT_TRUE(! spec.slot_requirement_ptr());
+ EXPECT_TRUE(! spec.exact_slot_constraint());
else
{
- EXPECT_TRUE(bool(spec.slot_requirement_ptr()));
- EXPECT_EQ(slot_requirement, stringify(*spec.slot_requirement_ptr()));
+ EXPECT_TRUE(bool(spec.exact_slot_constraint()));
+ EXPECT_EQ(slot_requirement, ":" + stringify(spec.exact_slot_constraint()->name()));
}
if (from_repository.empty())