aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2012-09-14 17:40:39 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2012-09-14 18:06:37 +0100
commit7ce0a00a008983de8a8e61d33d41a4f41147db9b (patch)
treeba35068b18f5745145d0eefe02df85c0cd0aa5cc /src
parent2bff9772cc069fe98e281432bddd0b35c1e934e4 (diff)
downloadpaludis-7ce0a00a008983de8a8e61d33d41a4f41147db9b.tar.gz
paludis-7ce0a00a008983de8a8e61d33d41a4f41147db9b.tar.xz
Refactor to allow subslots
Diffstat (limited to 'src')
-rwxr-xr-xsrc/clients/cave/cmd_display_resolution.cc5
-rw-r--r--src/clients/cave/cmd_fix_linkage.cc3
-rw-r--r--src/clients/cave/cmd_generate_metadata.cc1
-rw-r--r--src/clients/cave/cmd_info.cc5
-rw-r--r--src/clients/cave/cmd_match.cc5
-rw-r--r--src/clients/cave/cmd_print_spec.cc2
-rw-r--r--src/clients/cave/cmd_show.cc7
-rw-r--r--src/clients/cave/cmd_uninstall.cc3
-rw-r--r--src/clients/cave/format_package_id.cc3
-rw-r--r--src/clients/cave/format_plain_metadata_key.cc5
10 files changed, 24 insertions, 15 deletions
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 465102779..49adda4d4 100755
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -84,6 +84,7 @@
#include <paludis/changed_choices.hh>
#include <paludis/mask_utils.hh>
#include <paludis/dep_spec_annotations.hh>
+#include <paludis/slot.hh>
#include <set>
#include <iterator>
@@ -956,9 +957,9 @@ namespace
cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.parse_value())));
}
- void visit(const MetadataValueKey<SlotName> & k)
+ void visit(const MetadataValueKey<Slot> & k)
{
- cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.parse_value())));
+ cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.parse_value().raw_value())));
}
void visit(const MetadataValueKey<long> & k)
diff --git a/src/clients/cave/cmd_fix_linkage.cc b/src/clients/cave/cmd_fix_linkage.cc
index 051e2fe02..01e94fb87 100644
--- a/src/clients/cave/cmd_fix_linkage.cc
+++ b/src/clients/cave/cmd_fix_linkage.cc
@@ -39,6 +39,7 @@
#include <paludis/version_operator.hh>
#include <paludis/version_requirements.hh>
#include <paludis/partially_made_package_dep_spec.hh>
+#include <paludis/slot.hh>
#include <iostream>
#include <set>
@@ -219,7 +220,7 @@ FixLinkageCommand::run(
PartiallyMadePackageDepSpec part_spec({ });
part_spec.package((*pkg_it)->name());
if ((*pkg_it)->slot_key())
- part_spec.slot_requirement(std::make_shared<UserSlotExactRequirement>((*pkg_it)->slot_key()->parse_value()));
+ part_spec.slot_requirement(std::make_shared<UserSlotExactPartialRequirement>((*pkg_it)->slot_key()->parse_value().parallel_value()));
if (cmdline.a_exact.specified())
part_spec.version_requirement(make_named_values<VersionRequirement>(
diff --git a/src/clients/cave/cmd_generate_metadata.cc b/src/clients/cave/cmd_generate_metadata.cc
index 0925071ab..20551f46b 100644
--- a/src/clients/cave/cmd_generate_metadata.cc
+++ b/src/clients/cave/cmd_generate_metadata.cc
@@ -43,6 +43,7 @@
#include <paludis/mask.hh>
#include <paludis/metadata_key.hh>
#include <paludis/notifier_callback.hh>
+#include <paludis/slot.hh>
#include <sys/sysinfo.h>
#include <cstdlib>
#include <iostream>
diff --git a/src/clients/cave/cmd_info.cc b/src/clients/cave/cmd_info.cc
index 075727f05..62ae30db4 100644
--- a/src/clients/cave/cmd_info.cc
+++ b/src/clients/cave/cmd_info.cc
@@ -37,6 +37,7 @@
#include <paludis/selection.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
+#include <paludis/slot.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/visitor_cast.hh>
@@ -246,10 +247,10 @@ namespace
cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(k.parse_value())));
}
- void visit(const MetadataValueKey<SlotName> & k)
+ void visit(const MetadataValueKey<Slot> & k)
{
ColourPrettyPrinter printer(env, make_null_shared_ptr(), indent);
- cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(k.parse_value())));
+ cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(k.parse_value().raw_value())));
}
void visit(const MetadataValueKey<long> & k)
diff --git a/src/clients/cave/cmd_match.cc b/src/clients/cave/cmd_match.cc
index f422ae639..e6e6e55a5 100644
--- a/src/clients/cave/cmd_match.cc
+++ b/src/clients/cave/cmd_match.cc
@@ -45,6 +45,7 @@
#include <paludis/metadata_key.hh>
#include <paludis/choice.hh>
#include <paludis/about.hh>
+#include <paludis/slot.hh>
#include <cstdlib>
#include <iostream>
#include <algorithm>
@@ -264,9 +265,9 @@ namespace
texts.push_back(stringify(k.parse_value()));
}
- void visit(const MetadataValueKey<SlotName> & k)
+ void visit(const MetadataValueKey<Slot> & k)
{
- texts.push_back(stringify(k.parse_value()));
+ texts.push_back(stringify(k.parse_value().raw_value()));
}
void visit(const MetadataValueKey<long> & k)
diff --git a/src/clients/cave/cmd_print_spec.cc b/src/clients/cave/cmd_print_spec.cc
index 00124bda7..11b7824d1 100644
--- a/src/clients/cave/cmd_print_spec.cc
+++ b/src/clients/cave/cmd_print_spec.cc
@@ -133,7 +133,7 @@ namespace
if (cmdline.a_slot_requirement.argument().empty())
s.clear_slot_requirement();
else
- s.slot_requirement(std::make_shared<UserSlotExactRequirement>(SlotName(cmdline.a_slot_requirement.argument())));
+ s.slot_requirement(std::make_shared<UserSlotExactPartialRequirement>(SlotName(cmdline.a_slot_requirement.argument())));
}
if (cmdline.a_in_repository.specified())
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index b519c0f08..6ad9d35e5 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -57,6 +57,7 @@
#include <paludis/dep_spec_data.hh>
#include <paludis/dep_spec_annotations.hh>
#include <paludis/match_package.hh>
+#include <paludis/slot.hh>
#include <cstdlib>
#include <iostream>
#include <algorithm>
@@ -164,7 +165,7 @@ namespace
std::string slot_as_string(const std::shared_ptr<const PackageID> & id)
{
if (id->slot_key())
- return stringify(id->slot_key()->parse_value());
+ return stringify(id->slot_key()->parse_value().raw_value());
else
return "";
}
@@ -698,12 +699,12 @@ namespace
);
}
- void visit(const MetadataValueKey<SlotName> & k)
+ void visit(const MetadataValueKey<Slot> & k)
{
out << fuc(
(cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
fv<'s'>(cmdline.a_raw_names.specified() ? k.raw_name() : k.human_name()),
- fv<'v'>(stringify(k.parse_value())),
+ fv<'v'>(stringify(k.parse_value().raw_value())),
fv<'i'>(std::string(indent, ' ')),
fv<'b'>(important ? "true" : ""),
fv<'p'>("")
diff --git a/src/clients/cave/cmd_uninstall.cc b/src/clients/cave/cmd_uninstall.cc
index 9d28f27f4..5f839012f 100644
--- a/src/clients/cave/cmd_uninstall.cc
+++ b/src/clients/cave/cmd_uninstall.cc
@@ -35,6 +35,7 @@
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
+#include <paludis/slot.hh>
#include <algorithm>
#include <iostream>
@@ -150,7 +151,7 @@ UninstallCommand::run(
qpns_being_changed.insert((*i)->name());
std::string target("!" + stringify((*i)->name()));
if ((*i)->slot_key())
- target.append(":" + stringify((*i)->slot_key()->parse_value()));
+ target.append(":" + stringify((*i)->slot_key()->parse_value().raw_value()));
targets->push_back(std::make_pair(target, ""));
}
diff --git a/src/clients/cave/format_package_id.cc b/src/clients/cave/format_package_id.cc
index f6a00583a..d48288b6b 100644
--- a/src/clients/cave/format_package_id.cc
+++ b/src/clients/cave/format_package_id.cc
@@ -30,6 +30,7 @@
#include <paludis/package_id.hh>
#include <paludis/version_spec.hh>
#include <paludis/dep_spec.hh>
+#include <paludis/slot.hh>
#include <string>
using namespace paludis;
@@ -44,7 +45,7 @@ paludis::cave::format_package_id(
m->insert('c', stringify(id->name().category()));
m->insert('p', stringify(id->name().package()));
m->insert('v', stringify(id->version()));
- m->insert('s', id->slot_key() ? stringify(id->slot_key()->parse_value()) : "");
+ m->insert('s', id->slot_key() ? stringify(id->slot_key()->parse_value().raw_value()) : "");
m->insert(':', id->slot_key() ? ":" : "");
m->insert('r', stringify(id->repository_name()));
m->insert('F', id->canonical_form(idcf_full));
diff --git a/src/clients/cave/format_plain_metadata_key.cc b/src/clients/cave/format_plain_metadata_key.cc
index 8587a1cef..846f9a73b 100644
--- a/src/clients/cave/format_plain_metadata_key.cc
+++ b/src/clients/cave/format_plain_metadata_key.cc
@@ -29,6 +29,7 @@
#include <paludis/mask.hh>
#include <paludis/unformatted_pretty_printer.hh>
#include <paludis/name.hh>
+#include <paludis/slot.hh>
#include <sstream>
using namespace paludis;
@@ -75,9 +76,9 @@ namespace
s << k.parse_value();
}
- void visit(const MetadataValueKey<SlotName> & k)
+ void visit(const MetadataValueKey<Slot> & k)
{
- s << k.parse_value();
+ s << k.parse_value().raw_value();
}
void visit(const MetadataSpecTreeKey<DependencySpecTree> & k)