aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-14 03:04:54 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-14 03:13:56 +0100
commit9e23bcba99373e0a9ac543b3aa8b035b20adf62c (patch)
tree0e248eefca1acebf03a0bbe8b0cc30e7bda363d3
parent3b627dbc6471f30a359cad3817bc99090ca8a7ca (diff)
downloadpaludis-9e23bcba99373e0a9ac543b3aa8b035b20adf62c.tar.gz
paludis-9e23bcba99373e0a9ac543b3aa8b035b20adf62c.tar.xz
Update E for previous (continued)
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc40
-rw-r--r--paludis/repositories/e/e_installed_repository_id.hh3
-rw-r--r--paludis/repositories/e/ebuild_id.cc12
-rw-r--r--paludis/repositories/e/ebuild_id.hh3
4 files changed, 18 insertions, 40 deletions
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 1ac8d30..19beb9a 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -91,8 +91,7 @@ namespace paludis
std::tr1::shared_ptr<const MetadataValueKey<std::string> > short_description;
std::tr1::shared_ptr<const MetadataValueKey<std::tr1::shared_ptr<const Contents> > > contents;
std::tr1::shared_ptr<const MetadataTimeKey> installed_time;
- std::tr1::shared_ptr<const MetadataValueKey<std::string> > source_origin;
- std::tr1::shared_ptr<const MetadataValueKey<std::string> > binary_origin;
+ std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > from_repositories;
std::tr1::shared_ptr<const MetadataValueKey<std::string> > asflags;
std::tr1::shared_ptr<const MetadataValueKey<std::string> > cbuild;
@@ -301,24 +300,18 @@ EInstalledRepositoryID::need_keys_added() const
_imp->dir / contents_filename(), mkt_normal));
add_metadata_key(_imp->installed_time);
+ std::tr1::shared_ptr<Set<std::string> > from_repositories_value(new Set<std::string>);
if ((_imp->dir / "REPOSITORY").exists())
- {
- _imp->source_origin.reset(new LiteralMetadataValueKey<std::string> ("REPOSITORY", "Source repository",
- mkt_normal, file_contents(_imp->dir / "REPOSITORY")));
- add_metadata_key(_imp->source_origin);
- }
- else if ((_imp->dir / "repository").exists())
- {
- _imp->source_origin.reset(new LiteralMetadataValueKey<std::string> ("repository", "Source repository",
- mkt_normal, file_contents(_imp->dir / "repository")));
- add_metadata_key(_imp->source_origin);
- }
-
+ from_repositories_value->insert(file_contents(_imp->dir / "REPOSITORY"));
+ if ((_imp->dir / "repository").exists())
+ from_repositories_value->insert(file_contents(_imp->dir / "repository"));
if ((_imp->dir / "BINARY_REPOSITORY").exists())
+ from_repositories_value->insert(file_contents(_imp->dir / "BINARY_REPOSITORY"));
+ if (! from_repositories_value->empty())
{
- _imp->binary_origin.reset(new LiteralMetadataValueKey<std::string> ("BINARY_REPOSITORY", "Binary repository",
- mkt_normal, file_contents(_imp->dir / "BINARY_REPOSITORY")));
- add_metadata_key(_imp->binary_origin);
+ _imp->from_repositories.reset(new LiteralMetadataStringSetKey("REPOSITORIES",
+ "From repositories", mkt_normal, from_repositories_value));
+ add_metadata_key(_imp->from_repositories);
}
if ((_imp->dir / "ASFLAGS").exists())
@@ -604,18 +597,11 @@ EInstalledRepositoryID::installed_time_key() const
return _imp->installed_time;
}
-const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
-EInstalledRepositoryID::source_origin_key() const
-{
- need_keys_added();
- return _imp->source_origin;
-}
-
-const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
-EInstalledRepositoryID::binary_origin_key() const
+const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > >
+EInstalledRepositoryID::from_repositories_key() const
{
need_keys_added();
- return _imp->binary_origin;
+ return _imp->from_repositories;
}
const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> >
diff --git a/paludis/repositories/e/e_installed_repository_id.hh b/paludis/repositories/e/e_installed_repository_id.hh
index 1cbe5b7..d453368 100644
--- a/paludis/repositories/e/e_installed_repository_id.hh
+++ b/paludis/repositories/e/e_installed_repository_id.hh
@@ -73,11 +73,10 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > long_description_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::tr1::shared_ptr<const Contents> > > contents_key() const;
virtual const std::tr1::shared_ptr<const MetadataTimeKey> installed_time_key() const;
- virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > source_origin_key() const;
- virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > binary_origin_key() const;
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> > contains_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::tr1::shared_ptr<const PackageID> > > contained_in_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > from_repositories_key() const;
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameSet> > use_key() const;
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > inherited_key() const;
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 59bd36c..61067c3 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -584,16 +584,10 @@ EbuildID::installed_time_key() const
return std::tr1::shared_ptr<const MetadataTimeKey>();
}
-const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
-EbuildID::source_origin_key() const
-{
- return std::tr1::shared_ptr<const MetadataValueKey<std::string> >();
-}
-
-const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
-EbuildID::binary_origin_key() const
+const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > >
+EbuildID::from_repositories_key() const
{
- return std::tr1::shared_ptr<const MetadataValueKey<std::string> >();
+ return std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > >();
}
const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > >
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index d7b6680..97efef5 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -77,11 +77,10 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > long_description_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::tr1::shared_ptr<const Contents> > > contents_key() const;
virtual const std::tr1::shared_ptr<const MetadataTimeKey> installed_time_key() const;
- virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > source_origin_key() const;
- virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > binary_origin_key() const;
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> > contains_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::tr1::shared_ptr<const PackageID> > > contained_in_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > from_repositories_key() const;
const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > inherited_key() const;
const std::tr1::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> > license_key() const;