aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Dimitry Ishenko <dimitry.ishenko@gmail.com> 2012-11-14 13:08:20 -0500
committerAvatar David Leverton <levertond@googlemail.com> 2012-11-14 19:21:58 +0000
commit7990944d141ad88cb6d73a3511d0a164477482a3 (patch)
treeb771b24cdf33d23386c516b3f3d656e3669e849a
parent700427e4cfbb9ed6758202f1d71e5f171e75107b (diff)
downloadpaludis-7990944d141ad88cb6d73a3511d0a164477482a3.tar.gz
paludis-7990944d141ad88cb6d73a3511d0a164477482a3.tar.xz
Properly handle subslots in ::unavailable
-rw-r--r--paludis/repositories/unavailable/unavailable_package_id.cc5
-rw-r--r--paludis/repositories/unavailable/unavailable_package_id.hh2
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_file-fwd.hh4
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_file.cc20
4 files changed, 20 insertions, 11 deletions
diff --git a/paludis/repositories/unavailable/unavailable_package_id.cc b/paludis/repositories/unavailable/unavailable_package_id.cc
index a7e6e43..0108f23 100644
--- a/paludis/repositories/unavailable/unavailable_package_id.cc
+++ b/paludis/repositories/unavailable/unavailable_package_id.cc
@@ -64,10 +64,7 @@ namespace paludis
name(e.name()),
version(e.version()),
repository_name(e.repository()),
- slot_key(std::make_shared<LiteralMetadataValueKey<Slot> >("SLOT", "Slot", mkt_internal, make_named_values<Slot>(
- n::match_values() = std::make_pair(e.slot(), e.slot()),
- n::parallel_value() = e.slot(),
- n::raw_value() = stringify(e.slot())))),
+ slot_key(std::make_shared<LiteralMetadataValueKey<Slot> >("SLOT", "Slot", mkt_internal, e.slot())),
description_key(e.description()),
repository_homepage_key(e.repository_homepage()),
repository_description_key(e.repository_description()),
diff --git a/paludis/repositories/unavailable/unavailable_package_id.hh b/paludis/repositories/unavailable/unavailable_package_id.hh
index 5da7326..edafb57 100644
--- a/paludis/repositories/unavailable/unavailable_package_id.hh
+++ b/paludis/repositories/unavailable/unavailable_package_id.hh
@@ -53,7 +53,7 @@ namespace paludis
NamedValue<n::repository, RepositoryName> repository;
NamedValue<n::repository_description, std::shared_ptr<const MetadataValueKey<std::string> > > repository_description;
NamedValue<n::repository_homepage, std::shared_ptr<const MetadataValueKey<std::string> > > repository_homepage;
- NamedValue<n::slot, SlotName> slot;
+ NamedValue<n::slot, Slot> slot;
NamedValue<n::version, VersionSpec> version;
};
diff --git a/paludis/repositories/unavailable/unavailable_repository_file-fwd.hh b/paludis/repositories/unavailable/unavailable_repository_file-fwd.hh
index c266895..2f817a0 100644
--- a/paludis/repositories/unavailable/unavailable_repository_file-fwd.hh
+++ b/paludis/repositories/unavailable/unavailable_repository_file-fwd.hh
@@ -22,7 +22,7 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/named_value.hh>
-#include <paludis/name.hh>
+#include <paludis/slot.hh>
#include <paludis/version_spec.hh>
#include <paludis/metadata_key-fwd.hh>
#include <memory>
@@ -45,7 +45,7 @@ namespace paludis
{
NamedValue<n::description, std::shared_ptr<const MetadataValueKey<std::string> > > description;
NamedValue<n::name, QualifiedPackageName> name;
- NamedValue<n::slot, SlotName> slot;
+ NamedValue<n::slot, Slot> slot;
NamedValue<n::version, VersionSpec> version;
};
}
diff --git a/paludis/repositories/unavailable/unavailable_repository_file.cc b/paludis/repositories/unavailable/unavailable_repository_file.cc
index fc43885..6480771 100644
--- a/paludis/repositories/unavailable/unavailable_repository_file.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_file.cc
@@ -138,7 +138,7 @@ UnavailableRepositoryFile::_load(const FSPath & f)
CategoryNamePart category("x");
PackageNamePart package("x");
- SlotName slot("x");
+ SlotName slot("x"), subslot("x");
while (std::getline(file, line))
{
SimpleParser line_parser(line);
@@ -157,7 +157,7 @@ UnavailableRepositoryFile::_load(const FSPath & f)
}
else if (line_parser.consume(
(+simple_parser::any_of(" \t")) &
- (+simple_parser::any_except(" \t/") >> token) &
+ (+simple_parser::any_except(" \t/:") >> token) &
(simple_parser::exact("/"))
))
{
@@ -174,7 +174,16 @@ UnavailableRepositoryFile::_load(const FSPath & f)
(+simple_parser::any_of(" \t"))
))
{
- slot = SlotName(token);
+ std::string ss(token);
+
+ auto p(ss.find('/'));
+ if (std::string::npos != p)
+ {
+ slot = SlotName(ss.substr(0, p));
+ subslot = SlotName(ss.substr(p + 1));
+ }
+ else
+ subslot = slot = SlotName(ss);
std::list<VersionSpec> versions;
while (true)
@@ -217,7 +226,10 @@ UnavailableRepositoryFile::_load(const FSPath & f)
_imp->entries.push_back(make_named_values<UnavailableRepositoryFileEntry>(
n::description() = desc,
n::name() = category + package,
- n::slot() = slot,
+ n::slot() = make_named_values<Slot>(
+ n::match_values() = std::make_pair(slot, subslot),
+ n::parallel_value() = slot,
+ n::raw_value() = ss),
n::version() = *v
));
}