aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-06-10 15:14:07 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-06-10 15:14:07 +0000
commit97a2f024cee04b28694739c276492c5fdf15d456 (patch)
tree73aa3018484d431da3a3fe7df988d43bca44633c
parentbff468799b90d6e474a61c76f6828aa8c2a47fff (diff)
downloadpaludis-97a2f024cee04b28694739c276492c5fdf15d456.tar.gz
paludis-97a2f024cee04b28694739c276492c5fdf15d456.tar.xz
Allow repository files for UnavailableRepository to specify a repository homepage and description.
-rw-r--r--paludis/repositories/unavailable/unavailable_id.cc8
-rw-r--r--paludis/repositories/unavailable/unavailable_id.hh2
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_file.cc18
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_file.hh2
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_store.cc10
-rw-r--r--paludis/util/keys.hh2
6 files changed, 40 insertions, 2 deletions
diff --git a/paludis/repositories/unavailable/unavailable_id.cc b/paludis/repositories/unavailable/unavailable_id.cc
index 47fb60c..e2a5e7e 100644
--- a/paludis/repositories/unavailable/unavailable_id.cc
+++ b/paludis/repositories/unavailable/unavailable_id.cc
@@ -46,7 +46,7 @@ namespace paludis
const UnavailableRepository * const repo;
const std::tr1::shared_ptr<const MetadataKey> description_key;
- const std::tr1::shared_ptr<const MetadataValueKey<std::string> > owning_repository_key;
+ const std::tr1::shared_ptr<const MetadataValueKey<std::string> > owning_repository_key, repository_homepage_key, repository_description_key;
const std::tr1::shared_ptr<const Mask> mask;
Implementation(
@@ -57,6 +57,8 @@ namespace paludis
repo(e[k::repository()]),
description_key(e[k::description()]),
owning_repository_key(e[k::owning_repository()]),
+ repository_homepage_key(e[k::repository_homepage()]),
+ repository_description_key(e[k::repository_description()]),
mask(e[k::mask()])
{
}
@@ -69,6 +71,10 @@ UnavailableID::UnavailableID(const UnavailableIDParams & entry) :
{
add_metadata_key(_imp->description_key);
add_metadata_key(_imp->owning_repository_key);
+ if (_imp->repository_homepage_key)
+ add_metadata_key(_imp->repository_homepage_key);
+ if (_imp->repository_description_key)
+ add_metadata_key(_imp->repository_description_key);
add_mask(_imp->mask);
}
diff --git a/paludis/repositories/unavailable/unavailable_id.hh b/paludis/repositories/unavailable/unavailable_id.hh
index 001e01a..aec2ea1 100644
--- a/paludis/repositories/unavailable/unavailable_id.hh
+++ b/paludis/repositories/unavailable/unavailable_id.hh
@@ -34,6 +34,8 @@ namespace paludis
kc::Field<k::slot, SlotName>,
kc::Field<k::repository, const UnavailableRepository *>,
kc::Field<k::owning_repository, std::tr1::shared_ptr<const MetadataValueKey<std::string> > >,
+ kc::Field<k::repository_homepage, std::tr1::shared_ptr<const MetadataValueKey<std::string> > >,
+ kc::Field<k::repository_description, std::tr1::shared_ptr<const MetadataValueKey<std::string> > >,
kc::Field<k::description, std::tr1::shared_ptr<const MetadataValueKey<std::string> > >,
kc::Field<k::mask, std::tr1::shared_ptr<const Mask> >
> UnavailableIDParams;
diff --git a/paludis/repositories/unavailable/unavailable_repository_file.cc b/paludis/repositories/unavailable/unavailable_repository_file.cc
index d6103c9..886823e 100644
--- a/paludis/repositories/unavailable/unavailable_repository_file.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_file.cc
@@ -39,7 +39,7 @@ namespace paludis
template <>
struct Implementation<UnavailableRepositoryFile>
{
- std::string repo_name;
+ std::string repo_name, homepage, description;
std::list<UnavailableRepositoryFileEntry> entries;
};
}
@@ -97,6 +97,10 @@ UnavailableRepositoryFile::_load(const FSEntry & f)
}
else if (key == "repo_name")
_imp->repo_name = value;
+ else if (key == "homepage")
+ _imp->homepage = value;
+ else if (key == "description")
+ _imp->description = value;
else
Log::get_instance()->message("unavailable_repository.file.unknown_key", ll_warning, lc_context)
<< "Ignoring unknown key '" << key << "' with value '" << value << "'";
@@ -203,6 +207,18 @@ UnavailableRepositoryFile::repo_name() const
return _imp->repo_name;
}
+std::string
+UnavailableRepositoryFile::homepage() const
+{
+ return _imp->homepage;
+}
+
+std::string
+UnavailableRepositoryFile::description() const
+{
+ return _imp->description;
+}
+
template class PrivateImplementationPattern<UnavailableRepositoryFile>;
template class WrappedForwardIterator<UnavailableRepositoryFile::ConstIteratorTag,
const UnavailableRepositoryFileEntry>;
diff --git a/paludis/repositories/unavailable/unavailable_repository_file.hh b/paludis/repositories/unavailable/unavailable_repository_file.hh
index 331b72a..5163e0e 100644
--- a/paludis/repositories/unavailable/unavailable_repository_file.hh
+++ b/paludis/repositories/unavailable/unavailable_repository_file.hh
@@ -45,6 +45,8 @@ namespace paludis
ConstIterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
std::string repo_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ std::string homepage() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ std::string description() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/repositories/unavailable/unavailable_repository_store.cc b/paludis/repositories/unavailable/unavailable_repository_store.cc
index 6795a17..2349cbc 100644
--- a/paludis/repositories/unavailable/unavailable_repository_store.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_store.cc
@@ -125,6 +125,14 @@ UnavailableRepositoryStore::_populate_one(const Environment * const env, const F
new LiteralMetadataValueKey<std::string>("OWNING_REPOSITORY", "Owning repository",
mkt_significant, file.repo_name()));
+ std::tr1::shared_ptr<MetadataValueKey<std::string> > repository_homepage, repository_description;
+ if (! file.homepage().empty())
+ repository_homepage.reset(new LiteralMetadataValueKey<std::string>(
+ "REPOSITORY_HOMEPAGE", "Repository homepage", mkt_normal, file.homepage()));
+ if (! file.description().empty())
+ repository_description.reset(new LiteralMetadataValueKey<std::string>(
+ "REPOSITORY_DESCRIPTION", "Repository description", mkt_normal, file.description()));
+
QualifiedPackageName old_name("x/x");
std::tr1::shared_ptr<QualifiedPackageNameSet> pkgs;
std::tr1::shared_ptr<PackageIDSequence> ids;
@@ -159,6 +167,8 @@ UnavailableRepositoryStore::_populate_one(const Environment * const env, const F
(k::slot(), (*i)[k::slot()])
(k::description(), (*i)[k::description()])
(k::owning_repository(), owning_repository)
+ (k::repository_homepage(), repository_homepage)
+ (k::repository_description(), repository_description)
(k::mask(), mask)
)));
diff --git a/paludis/util/keys.hh b/paludis/util/keys.hh
index 9b77d2e..ef81f5b 100644
--- a/paludis/util/keys.hh
+++ b/paludis/util/keys.hh
@@ -181,6 +181,8 @@ namespace paludis
typedef kc::Key<152> owning_repository;
typedef kc::Key<153> mask;
typedef kc::Key<154> repository;
+ typedef kc::Key<155> repository_homepage;
+ typedef kc::Key<156> repository_description;
}
}