aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-05-13 19:50:54 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-05-14 17:59:12 +0100
commit2fec84edf07c6863d66730460f67409b5f831de0 (patch)
treea448ce8f2cc56afc9633ee64d25578e692d95558
parentf90702f73199af1923cc35905d593ab0e4936cab (diff)
downloadpaludis-2fec84edf07c6863d66730460f67409b5f831de0.tar.gz
paludis-2fec84edf07c6863d66730460f67409b5f831de0.tar.xz
More repository id metadata
-rw-r--r--paludis/repositories/unavailable/unavailable_mask.cc20
-rw-r--r--paludis/repositories/unavailable/unavailable_mask.hh11
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_file.cc20
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_file.hh4
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_id.cc17
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_id.hh2
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_store.cc30
7 files changed, 87 insertions, 17 deletions
diff --git a/paludis/repositories/unavailable/unavailable_mask.cc b/paludis/repositories/unavailable/unavailable_mask.cc
index 0f84e7c..0f44578 100644
--- a/paludis/repositories/unavailable/unavailable_mask.cc
+++ b/paludis/repositories/unavailable/unavailable_mask.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -40,3 +40,21 @@ UnavailableMask::explanation() const
return "In a repository which is unavailable";
}
+char
+NoConfigurationInformationMask::key() const
+{
+ return 'C';
+}
+
+const std::string
+NoConfigurationInformationMask::description() const
+{
+ return "no configuration information";
+}
+
+const std::string
+NoConfigurationInformationMask::explanation() const
+{
+ return "Not enough information is available to configure this repository automatically";
+}
+
diff --git a/paludis/repositories/unavailable/unavailable_mask.hh b/paludis/repositories/unavailable/unavailable_mask.hh
index 6e3f194..30aa3bf 100644
--- a/paludis/repositories/unavailable/unavailable_mask.hh
+++ b/paludis/repositories/unavailable/unavailable_mask.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -34,6 +34,15 @@ namespace paludis
virtual char key() const;
virtual const std::string description() const;
};
+
+ class NoConfigurationInformationMask :
+ public UnsupportedMask
+ {
+ public:
+ virtual const std::string explanation() const;
+ virtual char key() const;
+ virtual const std::string description() const;
+ };
}
}
diff --git a/paludis/repositories/unavailable/unavailable_repository_file.cc b/paludis/repositories/unavailable/unavailable_repository_file.cc
index 6f1290a..968073e 100644
--- a/paludis/repositories/unavailable/unavailable_repository_file.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_file.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -42,7 +42,7 @@ namespace paludis
template <>
struct Implementation<UnavailableRepositoryFile>
{
- std::string repo_name, homepage, description;
+ std::string repo_name, homepage, description, sync, repo_format;
Entries entries;
};
@@ -108,6 +108,10 @@ UnavailableRepositoryFile::_load(const FSEntry & f)
_imp->homepage = value;
else if (key == "description")
_imp->description = value;
+ else if (key == "sync")
+ _imp->sync = value;
+ else if (key == "repo_format")
+ _imp->repo_format = value;
else
Log::get_instance()->message("unavailable_repository.file.unknown_key", ll_warning, lc_context)
<< "Ignoring unknown key '" << key << "' with value '" << value << "'";
@@ -226,6 +230,18 @@ UnavailableRepositoryFile::description() const
return _imp->description;
}
+std::string
+UnavailableRepositoryFile::sync() const
+{
+ return _imp->sync;
+}
+
+std::string
+UnavailableRepositoryFile::repo_format() const
+{
+ return _imp->repo_format;
+}
+
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 5163e0e..21036ca 100644
--- a/paludis/repositories/unavailable/unavailable_repository_file.hh
+++ b/paludis/repositories/unavailable/unavailable_repository_file.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -47,6 +47,8 @@ namespace paludis
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));
+ std::string sync() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ std::string repo_format() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/repositories/unavailable/unavailable_repository_id.cc b/paludis/repositories/unavailable/unavailable_repository_id.cc
index df29e74..03508f6 100644
--- a/paludis/repositories/unavailable/unavailable_repository_id.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_id.cc
@@ -49,6 +49,9 @@ namespace paludis
const std::tr1::shared_ptr<const MetadataValueKey<std::string> > description_key;
const std::tr1::shared_ptr<const MetadataValueKey<std::string> > homepage_key;
+ const std::tr1::shared_ptr<const MetadataValueKey<std::string> > sync_key;
+ const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
+ const std::tr1::shared_ptr<const Mask> mask;
Implementation(
const UnavailableRepositoryIDParams & e) :
@@ -57,7 +60,10 @@ namespace paludis
version("0", VersionSpecOptions()),
repo(e.repository()),
description_key(e.description()),
- homepage_key(e.homepage())
+ homepage_key(e.homepage()),
+ sync_key(e.sync()),
+ format_key(e.format()),
+ mask(e.mask())
{
}
};
@@ -67,9 +73,16 @@ UnavailableRepositoryID::UnavailableRepositoryID(const UnavailableRepositoryIDPa
PrivateImplementationPattern<UnavailableRepositoryID>(new Implementation<UnavailableRepositoryID>(entry)),
_imp(PrivateImplementationPattern<UnavailableRepositoryID>::_imp)
{
- add_metadata_key(_imp->description_key);
+ if (_imp->description_key)
+ add_metadata_key(_imp->description_key);
if (_imp->homepage_key)
add_metadata_key(_imp->homepage_key);
+ if (_imp->sync_key)
+ add_metadata_key(_imp->sync_key);
+ if (_imp->format_key)
+ add_metadata_key(_imp->format_key);
+ if (_imp->mask)
+ add_mask(_imp->mask);
}
UnavailableRepositoryID::~UnavailableRepositoryID()
diff --git a/paludis/repositories/unavailable/unavailable_repository_id.hh b/paludis/repositories/unavailable/unavailable_repository_id.hh
index da1d160..a9b4ab4 100644
--- a/paludis/repositories/unavailable/unavailable_repository_id.hh
+++ b/paludis/repositories/unavailable/unavailable_repository_id.hh
@@ -33,6 +33,7 @@ namespace paludis
struct environment;
struct format;
struct homepage;
+ struct mask;
struct name;
struct repository;
struct sync;
@@ -46,6 +47,7 @@ namespace paludis
NamedValue<n::environment, const Environment *> environment;
NamedValue<n::format, std::tr1::shared_ptr<const MetadataValueKey<std::string> > > format;
NamedValue<n::homepage, std::tr1::shared_ptr<const MetadataValueKey<std::string> > > homepage;
+ NamedValue<n::mask, std::tr1::shared_ptr<const Mask> > mask;
NamedValue<n::name, QualifiedPackageName> name;
NamedValue<n::repository, const UnavailableRepository *> repository;
NamedValue<n::sync, std::tr1::shared_ptr<const MetadataValueKey<std::string> > > sync;
diff --git a/paludis/repositories/unavailable/unavailable_repository_store.cc b/paludis/repositories/unavailable/unavailable_repository_store.cc
index 2744731..dc9261c 100644
--- a/paludis/repositories/unavailable/unavailable_repository_store.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_store.cc
@@ -121,22 +121,29 @@ UnavailableRepositoryStore::_populate_one(const Environment * const env, const F
return;
}
- std::tr1::shared_ptr<Mask> mask(new UnavailableMask);
- std::tr1::shared_ptr<Set<std::string> > from_repositories_set(new Set<std::string>);
- from_repositories_set->insert(file.repo_name());
- std::tr1::shared_ptr<MetadataCollectionKey<Set<std::string> > > from_repositories(
- new LiteralMetadataStringSetKey("OWNING_REPOSITORY", "Owning repository",
- mkt_significant, from_repositories_set));
-
- std::tr1::shared_ptr<MetadataValueKey<std::string> > repository_homepage, repository_description;
+ std::tr1::shared_ptr<MetadataValueKey<std::string> > repository_homepage, repository_description,
+ repository_format, repository_sync;
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()));
+ if (! file.repo_format().empty())
+ repository_format.reset(new LiteralMetadataValueKey<std::string>(
+ "REPOSITORY_FORMAT", "Repository format", mkt_normal, file.repo_format()));
+ if (! file.sync().empty())
+ repository_sync.reset(new LiteralMetadataValueKey<std::string>(
+ "REPOSITORY_SYNC", "Repository sync", mkt_normal, file.sync()));
{
+ std::tr1::shared_ptr<Mask> mask(new UnavailableMask);
+ std::tr1::shared_ptr<Set<std::string> > from_repositories_set(new Set<std::string>);
+ from_repositories_set->insert(file.repo_name());
+ std::tr1::shared_ptr<MetadataCollectionKey<Set<std::string> > > from_repositories(
+ new LiteralMetadataStringSetKey("OWNING_REPOSITORY", "Owning repository",
+ mkt_significant, from_repositories_set));
+
QualifiedPackageName old_name("x/x");
std::tr1::shared_ptr<QualifiedPackageNameSet> pkgs;
std::tr1::shared_ptr<PackageIDSequence> ids;
@@ -181,15 +188,18 @@ UnavailableRepositoryStore::_populate_one(const Environment * const env, const F
}
}
+ const std::tr1::shared_ptr<NoConfigurationInformationMask> no_configuration_mask(new NoConfigurationInformationMask);
const std::tr1::shared_ptr<UnavailableRepositoryID> id(new UnavailableRepositoryID(
make_named_values<UnavailableRepositoryIDParams>(
value_for<n::description>(repository_description),
value_for<n::environment>(env),
- value_for<n::format>(make_null_shared_ptr()),
+ value_for<n::format>(repository_format),
value_for<n::homepage>(repository_homepage),
+ value_for<n::mask>(repository_sync && repository_format ?
+ make_null_shared_ptr() : no_configuration_mask),
value_for<n::name>(CategoryNamePart("repository") + PackageNamePart(file.repo_name())),
value_for<n::repository>(_imp->repo),
- value_for<n::sync>(make_null_shared_ptr())
+ value_for<n::sync>(repository_sync)
)));
_imp->categories->insert(id->name().category());