aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-12-02 00:45:40 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-12-02 00:45:40 +0000
commit1c22d3e80fc3c4cd50e163fc2ae9f0f75de6db1a (patch)
tree306f97b9a1d8e7f5d24e674bb1e1ff623bd52402 /src
parentcfde917750de96cf0c5d660f87e0e8e514b20cc0 (diff)
downloadpaludis-1c22d3e80fc3c4cd50e163fc2ae9f0f75de6db1a.tar.gz
paludis-1c22d3e80fc3c4cd50e163fc2ae9f0f75de6db1a.tar.xz
Abstractify PackageDepSpec, to allow repositories to display deps in their native formats. Fixes: ticket:333
Diffstat (limited to 'src')
-rw-r--r--src/clients/adjutrix/downgrade_check.cc10
-rw-r--r--src/clients/adjutrix/find_reverse_deps.cc10
-rw-r--r--src/clients/adjutrix/keywords_graph.cc11
-rw-r--r--src/clients/adjutrix/what_needs_keywording.cc7
-rw-r--r--src/clients/contrarius/stage.cc51
-rw-r--r--src/clients/gtkpaludis/libgtkpaludis/packages_list_model.cc38
-rw-r--r--src/clients/inquisitio/do_search.cc2
-rw-r--r--src/clients/paludis/applets.cc8
-rw-r--r--src/clients/paludis/do_config.cc8
-rw-r--r--src/clients/paludis/do_contents.cc6
-rw-r--r--src/clients/paludis/info.cc6
-rw-r--r--src/clients/paludis/query.cc6
-rw-r--r--src/clients/reconcilio/fix_linkage.cc20
-rw-r--r--src/output/console_install_task.cc22
14 files changed, 86 insertions, 119 deletions
diff --git a/src/clients/adjutrix/downgrade_check.cc b/src/clients/adjutrix/downgrade_check.cc
index 56a354038..2e60580ef 100644
--- a/src/clients/adjutrix/downgrade_check.cc
+++ b/src/clients/adjutrix/downgrade_check.cc
@@ -136,13 +136,9 @@ namespace
std::map<QPNS, VersionSpec>::const_iterator a(after.find(b->first));
if (after.end() == a)
{
- if (! env.package_database()->query(query::Matches(PackageDepSpec(
- tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(b->first.name)),
- tr1::shared_ptr<CategoryNamePart>(),
- tr1::shared_ptr<PackageNamePart>(),
- tr1::shared_ptr<VersionRequirements>(),
- vr_and,
- tr1::shared_ptr<SlotName>(new SlotName(b->first.slot)))),
+ if (! env.package_database()->query(query::Matches(make_package_dep_spec()
+ .package(b->first.name)
+ .slot(b->first.slot)),
qo_whatever)->empty())
{
results.insert(std::make_pair(b->first, stringify(b->second) + " -> nothing on " + desc));
diff --git a/src/clients/adjutrix/find_reverse_deps.cc b/src/clients/adjutrix/find_reverse_deps.cc
index afa058907..91b53ee58 100644
--- a/src/clients/adjutrix/find_reverse_deps.cc
+++ b/src/clients/adjutrix/find_reverse_deps.cc
@@ -26,6 +26,7 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/options.hh>
#include <paludis/query.hh>
#include <paludis/dep_spec.hh>
#include <paludis/package_id.hh>
@@ -259,13 +260,12 @@ int do_find_reverse_deps(NoConfigEnvironment & env)
{
if (std::string::npos == CommandLine::get_instance()->begin_parameters()->find('/'))
{
- spec.reset(new PackageDepSpec(
- tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(
- env.package_database()->fetch_unique_qualified_package_name(
- PackageNamePart(*CommandLine::get_instance()->begin_parameters()))))));
+ spec.reset(new PackageDepSpec(make_package_dep_spec().package(env.package_database()->fetch_unique_qualified_package_name(
+ PackageNamePart(*CommandLine::get_instance()->begin_parameters())))));
}
else
- spec.reset(new PackageDepSpec(*CommandLine::get_instance()->begin_parameters(), pds_pm_permissive));
+ spec.reset(new PackageDepSpec(parse_user_package_dep_spec(*CommandLine::get_instance()->begin_parameters(),
+ UserPackageDepSpecOptions())));
}
catch (const AmbiguousPackageNameError & e)
{
diff --git a/src/clients/adjutrix/keywords_graph.cc b/src/clients/adjutrix/keywords_graph.cc
index ac4cdc4e0..466f6f708 100644
--- a/src/clients/adjutrix/keywords_graph.cc
+++ b/src/clients/adjutrix/keywords_graph.cc
@@ -71,14 +71,9 @@ namespace
FindUnusedPackagesTask task(&e, &repo);
tr1::shared_ptr<const PackageIDSequence> packages(e.package_database()->query(
- query::Matches(PackageDepSpec(
- tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(package)),
- tr1::shared_ptr<CategoryNamePart>(),
- tr1::shared_ptr<PackageNamePart>(),
- tr1::shared_ptr<VersionRequirements>(),
- vr_and,
- tr1::shared_ptr<SlotName>(),
- tr1::shared_ptr<RepositoryName>(new RepositoryName(repo.name())))),
+ query::Matches(make_package_dep_spec()
+ .package(package)
+ .repository(repo.name())),
qo_group_by_slot));
tr1::shared_ptr<const PackageIDSequence> unused(task.execute(package));
diff --git a/src/clients/adjutrix/what_needs_keywording.cc b/src/clients/adjutrix/what_needs_keywording.cc
index e00f00ad8..0fe4e4fa5 100644
--- a/src/clients/adjutrix/what_needs_keywording.cc
+++ b/src/clients/adjutrix/what_needs_keywording.cc
@@ -88,12 +88,11 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
try
{
if (std::string::npos == p->find('/'))
- d.add(PackageDepSpec(
- tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(
- env.package_database()->fetch_unique_qualified_package_name(PackageNamePart(*p))))),
+ d.add(make_package_dep_spec().package(env.package_database()->fetch_unique_qualified_package_name(
+ PackageNamePart(*CommandLine::get_instance()->begin_parameters()))),
env.default_destinations());
else
- d.add(PackageDepSpec(*p, pds_pm_permissive), env.default_destinations());
+ d.add(parse_user_package_dep_spec(*p, UserPackageDepSpecOptions()), env.default_destinations());
}
catch (const NoSuchPackageError & e)
{
diff --git a/src/clients/contrarius/stage.cc b/src/clients/contrarius/stage.cc
index 5467ea96f..9b34e313b 100644
--- a/src/clients/contrarius/stage.cc
+++ b/src/clients/contrarius/stage.cc
@@ -21,6 +21,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/config_file.hh>
+#include <paludis/util/options.hh>
#include <paludis/package_database.hh>
#include <paludis/environments/adapted/adapted_environment.hh>
#include <paludis/query.hh>
@@ -50,8 +51,8 @@ AuxiliaryStage::is_rebuild() const
for (std::list<std::string>::const_iterator p(packages.begin()), p_end(packages.end()) ;
p != p_end ; ++p)
if ( _env->package_database()->query(
- query::Matches(PackageDepSpec(*p, pds_pm_permissive)) &
- query::InstalledAtRoot(_env->root()),
+ query::Matches(parse_user_package_dep_spec(*p, UserPackageDepSpecOptions())) &
+ query::InstalledAtRoot(_env->root()),
qo_whatever)->empty())
return false;
@@ -63,8 +64,8 @@ BinutilsStage::build(const StageOptions &) const
{
Context context("When building BinutilsStage:");
- tr1::shared_ptr<PackageDepSpec> binutils(new PackageDepSpec(TargetConfig::get_instance()->binutils(),
- pds_pm_permissive));
+ tr1::shared_ptr<PackageDepSpec> binutils(new PackageDepSpec(
+ parse_user_package_dep_spec(TargetConfig::get_instance()->binutils(), UserPackageDepSpecOptions())));
_env->clear_adaptions();
@@ -75,7 +76,7 @@ bool
BinutilsStage::is_rebuild() const
{
return (! _env->package_database()->query(
- query::Matches(PackageDepSpec(TargetConfig::get_instance()->binutils(), pds_pm_permissive)) &
+ query::Matches(parse_user_package_dep_spec(TargetConfig::get_instance()->binutils(), UserPackageDepSpecOptions())) &
query::InstalledAtRoot(_env->root()),
qo_whatever)->empty());
}
@@ -85,8 +86,8 @@ KernelHeadersStage::build(const StageOptions &) const
{
Context context("When building KernelHeadersStage:");
- tr1::shared_ptr<PackageDepSpec> headers(new PackageDepSpec(TargetConfig::get_instance()->headers(),
- pds_pm_permissive));
+ tr1::shared_ptr<PackageDepSpec> headers(new PackageDepSpec(
+ parse_user_package_dep_spec(TargetConfig::get_instance()->headers(), UserPackageDepSpecOptions())));
_env->clear_adaptions();
@@ -99,8 +100,8 @@ bool
KernelHeadersStage::is_rebuild() const
{
return (! _env->package_database()->query(
- query::Matches(PackageDepSpec(TargetConfig::get_instance()->headers(), pds_pm_permissive)) &
- query::InstalledAtRoot(_env->root()),
+ query::Matches(parse_user_package_dep_spec(TargetConfig::get_instance()->headers(), UserPackageDepSpecOptions())) &
+ query::InstalledAtRoot(_env->root()),
qo_whatever)->empty());
}
@@ -109,8 +110,8 @@ MinimalStage::build(const StageOptions &) const
{
Context context("When executing MinimalStage:");
- tr1::shared_ptr<PackageDepSpec> gcc(new PackageDepSpec(TargetConfig::get_instance()->gcc(),
- pds_pm_permissive));
+ tr1::shared_ptr<PackageDepSpec> gcc(new PackageDepSpec(parse_user_package_dep_spec(TargetConfig::get_instance()->gcc(),
+ UserPackageDepSpecOptions())));
_env->clear_adaptions();
@@ -131,9 +132,9 @@ bool
MinimalStage::is_rebuild() const
{
return (! _env->package_database()->query(
- query::Matches(PackageDepSpec(TargetConfig::get_instance()->gcc(), pds_pm_permissive)) &
- query::InstalledAtRoot(_env->root()),
- qo_whatever)->empty());
+ query::Matches(parse_user_package_dep_spec(TargetConfig::get_instance()->gcc(), UserPackageDepSpecOptions())) &
+ query::InstalledAtRoot(_env->root()),
+ qo_whatever)->empty());
}
int
@@ -141,8 +142,8 @@ LibCHeadersStage::build(const StageOptions &) const
{
Context context("When building LIbCHeaderStage:");
- tr1::shared_ptr<PackageDepSpec> libc(new PackageDepSpec(TargetConfig::get_instance()->libc(),
- pds_pm_unspecific));
+ tr1::shared_ptr<PackageDepSpec> libc(new PackageDepSpec(parse_user_package_dep_spec(TargetConfig::get_instance()->libc(),
+ UserPackageDepSpecOptions())));
_env->clear_adaptions();
@@ -155,7 +156,7 @@ bool
LibCHeadersStage::is_rebuild() const
{
return (! tr1::shared_ptr<const PackageIDSequence>(_env->package_database()->query(
- query::Matches(PackageDepSpec(TargetConfig::get_instance()->libc(), pds_pm_unspecific)) &
+ query::Matches(parse_user_package_dep_spec(TargetConfig::get_instance()->libc(), UserPackageDepSpecOptions())) &
query::InstalledAtRoot(_env->root()),
qo_whatever))->empty());
}
@@ -165,8 +166,8 @@ LibCStage::build(const StageOptions &) const
{
Context context("When building LibCStage:");
- tr1::shared_ptr<PackageDepSpec> libc(new PackageDepSpec(TargetConfig::get_instance()->libc(),
- pds_pm_permissive));
+ tr1::shared_ptr<PackageDepSpec> libc(new PackageDepSpec(parse_user_package_dep_spec(TargetConfig::get_instance()->libc(),
+ UserPackageDepSpecOptions())));
_env->clear_adaptions();
@@ -177,8 +178,8 @@ bool
LibCStage::is_rebuild() const
{
tr1::shared_ptr<const PackageIDSequence> c(_env->package_database()->query(
- query::Matches(PackageDepSpec(TargetConfig::get_instance()->libc(), pds_pm_permissive)) &
- query::InstalledAtRoot(_env->root()),
+ query::Matches(parse_user_package_dep_spec(TargetConfig::get_instance()->libc(), UserPackageDepSpecOptions())) &
+ query::InstalledAtRoot(_env->root()),
qo_whatever));
if (c->empty())
@@ -192,8 +193,8 @@ FullStage::build(const StageOptions &) const
{
Context context("When building FullStage:");
- tr1::shared_ptr<PackageDepSpec> gcc(new PackageDepSpec(TargetConfig::get_instance()->gcc(),
- pds_pm_permissive));
+ tr1::shared_ptr<PackageDepSpec> gcc(new PackageDepSpec(parse_user_package_dep_spec(TargetConfig::get_instance()->gcc(),
+ UserPackageDepSpecOptions())));
_env->clear_adaptions();
@@ -211,8 +212,8 @@ bool
FullStage::is_rebuild() const
{
tr1::shared_ptr<const PackageIDSequence> c(_env->package_database()->query(
- query::Matches(PackageDepSpec(TargetConfig::get_instance()->gcc(), pds_pm_permissive)) &
- query::InstalledAtRoot(_env->root()),
+ query::Matches(parse_user_package_dep_spec(TargetConfig::get_instance()->gcc(), UserPackageDepSpecOptions())) &
+ query::InstalledAtRoot(_env->root()),
qo_whatever));
if (c->empty())
diff --git a/src/clients/gtkpaludis/libgtkpaludis/packages_list_model.cc b/src/clients/gtkpaludis/libgtkpaludis/packages_list_model.cc
index 7364185cc..23e19686e 100644
--- a/src/clients/gtkpaludis/libgtkpaludis/packages_list_model.cc
+++ b/src/clients/gtkpaludis/libgtkpaludis/packages_list_model.cc
@@ -15,6 +15,7 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/options.hh>
#include <list>
#include <algorithm>
#include <set>
@@ -136,26 +137,18 @@ namespace
environment->package_database()->query(
query::InstalledAtRoot(environment->root()) &
query::Matches(pds) &
- query::Matches(PackageDepSpec(
- paludis::tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(id->name())),
- paludis::tr1::shared_ptr<CategoryNamePart>(),
- paludis::tr1::shared_ptr<PackageNamePart>(),
- paludis::tr1::shared_ptr<VersionRequirements>(),
- vr_and,
- paludis::tr1::shared_ptr<SlotName>(new SlotName(id->slot())))),
+ query::Matches(make_package_dep_spec()
+ .package(id->name())
+ .slot(id->slot())),
qo_order_by_version));
paludis::tr1::shared_ptr<const PackageIDSequence> av(
environment->package_database()->query(
query::SupportsAction<InstallAction>() &
query::Matches(pds) &
- query::Matches(PackageDepSpec(
- paludis::tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(id->name())),
- paludis::tr1::shared_ptr<CategoryNamePart>(),
- paludis::tr1::shared_ptr<PackageNamePart>(),
- paludis::tr1::shared_ptr<VersionRequirements>(),
- vr_and,
- paludis::tr1::shared_ptr<SlotName>(new SlotName(id->slot())))) &
+ query::Matches(make_package_dep_spec()
+ .package(id->name())
+ .slot(id->slot())) &
query::NotMasked(),
qo_order_by_version));
@@ -183,13 +176,9 @@ namespace
paludis::tr1::shared_ptr<const PackageIDSequence> av(
environment->package_database()->query(
query::Matches(pds) &
- query::Matches(PackageDepSpec(
- paludis::tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(id->name())),
- paludis::tr1::shared_ptr<CategoryNamePart>(),
- paludis::tr1::shared_ptr<PackageNamePart>(),
- paludis::tr1::shared_ptr<VersionRequirements>(),
- vr_and,
- paludis::tr1::shared_ptr<SlotName>(new SlotName(id->slot())))) &
+ query::Matches(make_package_dep_spec()
+ .package(id->name())
+ .slot(id->slot())) &
query::SupportsAction<InstallAction>() &
query::NotMasked(),
qo_order_by_version));
@@ -238,15 +227,14 @@ PackagesListModel::populate_in_paludis_thread()
if (old_qpn != (*p)->name())
{
data->items.push_front(PopulateItem(stringify((*p)->name().package)));
- data->items.begin()->children.push_front(make_item(
- PackageDepSpec(make_shared_ptr(new QualifiedPackageName((*p)->name()))),
+ data->items.begin()->children.push_front(make_item(make_package_dep_spec().package((*p)->name()),
*p, _imp->main_window->environment()));
data->items.begin()->qpn = data->items.begin()->children.begin()->qpn;
old_qpn = (*p)->name();
}
else
data->items.begin()->children.push_front(make_item(
- PackageDepSpec(make_shared_ptr(new QualifiedPackageName((*p)->name()))),
+ PackageDepSpec(make_package_dep_spec().package((*p)->name())),
*p, _imp->main_window->environment()));
}
}
@@ -263,7 +251,7 @@ PackagesListModel::populate_in_paludis_thread()
{
std::list<PopulateItem>::iterator atom_iter(data->items.insert(data->items.end(), PopulateItem(*i)));
atom_iter->merge_if_one_child = false;
- PackageDepSpec ds(*i, pds_pm_unspecific);
+ PackageDepSpec ds(parse_user_package_dep_spec(*i, UserPackageDepSpecOptions() + updso_allow_wildcards));
if (ds.package_ptr())
{
paludis::tr1::shared_ptr<const PackageIDSequence> c(
diff --git a/src/clients/inquisitio/do_search.cc b/src/clients/inquisitio/do_search.cc
index aac97c7c0..cd502f1de 100644
--- a/src/clients/inquisitio/do_search.cc
+++ b/src/clients/inquisitio/do_search.cc
@@ -287,7 +287,7 @@ do_search(const Environment & env)
i(ids.begin()), i_end(ids.end()) ; i != i_end ; ++i)
if (i->second)
{
- task.show(PackageDepSpec(make_shared_ptr(new QualifiedPackageName(i->first))), i->second);
+ task.show(make_package_dep_spec().package(i->first), i->second);
any = true;
}
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index 43dcadb87..5c32a1a88 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.cc
@@ -171,7 +171,7 @@ int do_has_version(tr1::shared_ptr<Environment> env)
Context context("When performing has-version action from command line:");
std::string query(*CommandLine::get_instance()->begin_parameters());
- tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(query, pds_pm_permissive));
+ tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(parse_user_package_dep_spec(query, UserPackageDepSpecOptions())));
tr1::shared_ptr<const PackageIDSequence> entries(env->package_database()->query(
query::Matches(*spec) & query::InstalledAtRoot(env->root()), qo_whatever));
@@ -188,7 +188,7 @@ int do_best_version(tr1::shared_ptr<Environment> env)
Context context("When performing best-version action from command line:");
std::string query(*CommandLine::get_instance()->begin_parameters());
- tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(query, pds_pm_permissive));
+ tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(parse_user_package_dep_spec(query, UserPackageDepSpecOptions())));
tr1::shared_ptr<const PackageIDSequence> entries(env->package_database()->query(
query::Matches(*spec) & query::InstalledAtRoot(env->root()), qo_order_by_version));
@@ -228,7 +228,7 @@ int do_match(tr1::shared_ptr<Environment> env)
Context context("When performing match action from command line:");
std::string query(*CommandLine::get_instance()->begin_parameters());
- tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(query, pds_pm_permissive));
+ tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(parse_user_package_dep_spec(query, UserPackageDepSpecOptions())));
tr1::shared_ptr<const PackageIDSequence> entries(env->package_database()->query(
query::Matches(*spec) & query::InstalledAtRoot(env->root()), qo_order_by_version));
@@ -271,7 +271,7 @@ int do_environment_variable(tr1::shared_ptr<Environment> env)
std::string spec_str(*CommandLine::get_instance()->begin_parameters());
std::string var_str(* next(CommandLine::get_instance()->begin_parameters()));
- tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(spec_str, pds_pm_permissive));
+ tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(parse_user_package_dep_spec(spec_str, UserPackageDepSpecOptions())));
tr1::shared_ptr<const PackageIDSequence> entries(env->package_database()->query(
query::Matches(*spec) & query::InstalledAtRoot(env->root()), qo_order_by_version));
diff --git a/src/clients/paludis/do_config.cc b/src/clients/paludis/do_config.cc
index caa92a1c2..c6eff75db 100644
--- a/src/clients/paludis/do_config.cc
+++ b/src/clients/paludis/do_config.cc
@@ -73,10 +73,10 @@ namespace
/* we might have a dep spec, but we might just have a simple package name
* without a category. either should work. */
tr1::shared_ptr<PackageDepSpec> spec(std::string::npos == target.find('/') ?
- new PackageDepSpec(tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(
- env->package_database()->fetch_unique_qualified_package_name(
- PackageNamePart(target), query::InstalledAtRoot(env->root()))))) :
- new PackageDepSpec(target, pds_pm_permissive));
+ new PackageDepSpec(make_package_dep_spec().package(
+ env->package_database()->fetch_unique_qualified_package_name(
+ PackageNamePart(target), query::InstalledAtRoot(env->root())))) :
+ new PackageDepSpec(parse_user_package_dep_spec(target, UserPackageDepSpecOptions())));
tr1::shared_ptr<const PackageIDSequence>
entries(env->package_database()->query(query::Matches(*spec) & query::InstalledAtRoot(env->root()), qo_order_by_version));
diff --git a/src/clients/paludis/do_contents.cc b/src/clients/paludis/do_contents.cc
index e8e73504f..a49fd6a5c 100644
--- a/src/clients/paludis/do_contents.cc
+++ b/src/clients/paludis/do_contents.cc
@@ -97,9 +97,9 @@ do_one_contents(
/* we might have a dep spec, but we might just have a simple package name
* without a category. either should work. */
tr1::shared_ptr<PackageDepSpec> spec(std::string::npos == q.find('/') ?
- new PackageDepSpec(tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(
- env->package_database()->fetch_unique_qualified_package_name(PackageNamePart(q))))) :
- new PackageDepSpec(q, pds_pm_permissive));
+ new PackageDepSpec(make_package_dep_spec().package(
+ env->package_database()->fetch_unique_qualified_package_name(PackageNamePart(q)))) :
+ new PackageDepSpec(parse_user_package_dep_spec(q, UserPackageDepSpecOptions())));
tr1::shared_ptr<const PackageIDSequence>
entries(env->package_database()->query(query::Matches(*spec) & query::InstalledAtRoot(
diff --git a/src/clients/paludis/info.cc b/src/clients/paludis/info.cc
index d9fb0dede..3ae98fb47 100644
--- a/src/clients/paludis/info.cc
+++ b/src/clients/paludis/info.cc
@@ -194,10 +194,10 @@ int do_one_info(
tr1::shared_ptr<PackageDepSpec> spec;
if (std::string::npos != q.find('/'))
- spec.reset(new PackageDepSpec(q, pds_pm_permissive));
+ spec.reset(new PackageDepSpec(parse_user_package_dep_spec(q, UserPackageDepSpecOptions())));
else
- spec.reset(new PackageDepSpec(tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(
- env->package_database()->fetch_unique_qualified_package_name(PackageNamePart(q))))));
+ spec.reset(new PackageDepSpec(make_package_dep_spec().package(
+ env->package_database()->fetch_unique_qualified_package_name(PackageNamePart(q)))));
tr1::shared_ptr<const PackageIDSequence>
entries(env->package_database()->query(query::Matches(*spec), qo_order_by_version)),
diff --git a/src/clients/paludis/query.cc b/src/clients/paludis/query.cc
index 980a48de4..34480624b 100644
--- a/src/clients/paludis/query.cc
+++ b/src/clients/paludis/query.cc
@@ -141,11 +141,11 @@ void do_one_query(
{
}
if (0 == set)
- spec.reset(new PackageDepSpec(tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(
- env->package_database()->fetch_unique_qualified_package_name(PackageNamePart(q))))));
+ spec.reset(new PackageDepSpec(make_package_dep_spec().package(
+ env->package_database()->fetch_unique_qualified_package_name(PackageNamePart(q)))));
}
else
- spec.reset(new PackageDepSpec(q, pds_pm_permissive));
+ spec.reset(new PackageDepSpec(parse_user_package_dep_spec(q, UserPackageDepSpecOptions())));
if (spec)
do_one_package_query(env, masks_to_explain, spec);
diff --git a/src/clients/reconcilio/fix_linkage.cc b/src/clients/reconcilio/fix_linkage.cc
index c973baf48..5bc6f7168 100644
--- a/src/clients/reconcilio/fix_linkage.cc
+++ b/src/clients/reconcilio/fix_linkage.cc
@@ -100,17 +100,15 @@ do_fix_linkage(const tr1::shared_ptr<Environment> & env)
std::cout << std::endl;
}
- targets->push_back(
- stringify(
- PackageDepSpec(
- make_shared_ptr(new QualifiedPackageName((*pkg_it)->name())),
- tr1::shared_ptr<CategoryNamePart>(),
- tr1::shared_ptr<PackageNamePart>(),
- CommandLine::get_instance()->a_exact.specified()
- ? make_equal_to_version_requirements((*pkg_it)->version())
- : tr1::shared_ptr<VersionRequirements>(),
- vr_and,
- make_shared_ptr(new SlotName((*pkg_it)->slot())))));
+ if (CommandLine::get_instance()->a_exact.specified())
+ targets->push_back(stringify(make_package_dep_spec()
+ .package((*pkg_it)->name())
+ .version_requirement(VersionRequirement(vo_equal, (*pkg_it)->version()))
+ .slot((*pkg_it)->slot())));
+ else
+ targets->push_back(stringify(make_package_dep_spec()
+ .package((*pkg_it)->name())
+ .slot((*pkg_it)->slot())));
}
tr1::shared_ptr<const PackageID> orphans;
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index bd19fcf7e..03100bb78 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -343,25 +343,15 @@ ConsoleInstallTask::on_display_merge_list_entry(const DepListEntry & d)
repo.reset(new RepositoryName(d.destination->name()));
tr1::shared_ptr<const PackageIDSequence> existing_repo(environment()->package_database()->
- query(query::Matches(PackageDepSpec(
- tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(d.package_id->name())),
- tr1::shared_ptr<CategoryNamePart>(),
- tr1::shared_ptr<PackageNamePart>(),
- tr1::shared_ptr<VersionRequirements>(),
- vr_and,
- tr1::shared_ptr<SlotName>(),
- repo)),
+ query(query::Matches(repo ?
+ make_package_dep_spec().package(d.package_id->name()).repository(*repo) :
+ make_package_dep_spec().package(d.package_id->name())),
qo_order_by_version));
tr1::shared_ptr<const PackageIDSequence> existing_slot_repo(environment()->package_database()->
- query(query::Matches(PackageDepSpec(
- tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(d.package_id->name())),
- tr1::shared_ptr<CategoryNamePart>(),
- tr1::shared_ptr<PackageNamePart>(),
- tr1::shared_ptr<VersionRequirements>(),
- vr_and,
- tr1::shared_ptr<SlotName>(new SlotName(d.package_id->slot())),
- repo)),
+ query(query::Matches(repo ?
+ make_package_dep_spec().package(d.package_id->name()).slot(d.package_id->slot()).repository(*repo) :
+ make_package_dep_spec().package(d.package_id->name()).slot(d.package_id->slot())),
qo_order_by_version));
display_merge_list_entry_start(d, m);