aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-25 11:14:07 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-25 11:14:07 +0100
commitf4e73a72917137235e04e3ce72a620cdec32dbeb (patch)
tree01c1b97fcb5e503a57fef119a6d49892baa0ff04
parent9ec90fdfe97f208cdcb006086c36232821028d2f (diff)
downloadpaludis-f4e73a72917137235e04e3ce72a620cdec32dbeb.tar.gz
paludis-f4e73a72917137235e04e3ce72a620cdec32dbeb.tar.xz
Implement GENERATED_FROM_REPOSITORY
Fixes: ticket:483
-rw-r--r--paludis/repositories/e/eapi.cc3
-rw-r--r--paludis/repositories/e/eapi.hh6
-rw-r--r--paludis/repositories/e/eapis/0.conf3
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf3
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf3
-rw-r--r--paludis/repositories/e/eapis/pbin-1+0.conf2
-rw-r--r--paludis/repositories/e/eapis/pbin-1+1.conf2
-rw-r--r--paludis/repositories/e/eapis/pbin-1+2.conf2
-rw-r--r--paludis/repositories/e/eapis/pbin-1+3.conf2
-rw-r--r--paludis/repositories/e/eapis/pbin-1+4.conf2
-rw-r--r--paludis/repositories/e/eapis/pbin-1+exheres-0.conf2
-rw-r--r--paludis/repositories/e/eapis/pbin-1+paludis-1.conf2
-rw-r--r--paludis/repositories/e/ebuild.cc9
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash2
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc28
-rw-r--r--paludis/repositories/e/ebuild_id.cc54
-rw-r--r--paludis/repositories/e/ebuild_id.hh6
17 files changed, 128 insertions, 3 deletions
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index a6aee2e..bcbbdc2 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -120,6 +120,9 @@ namespace
n::defined_phases() = make_metadata_variable(k, "defined_phases"),
n::dependencies() = make_metadata_variable(k, "dependencies"),
n::eapi() = make_metadata_variable(k, "eapi"),
+ n::generated_from() = make_metadata_variable(k, "generated_from"),
+ n::generated_time() = make_metadata_variable(k, "generated_time"),
+ n::generated_using() = make_metadata_variable(k, "generated_using"),
n::homepage() = make_metadata_variable(k, "homepage"),
n::inherited() = make_metadata_variable(k, "inherited"),
n::iuse() = make_metadata_variable(k, "iuse"),
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index 40127bb..ffee931 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -115,6 +115,9 @@ namespace paludis
typedef Name<struct fancy_test_flag_name> fancy_test_flag;
typedef Name<struct fix_mtimes_name> fix_mtimes;
typedef Name<struct flat_list_index_name> flat_list_index;
+ typedef Name<struct generated_from_name> generated_from;
+ typedef Name<struct generated_time_name> generated_time;
+ typedef Name<struct generated_using_name> generated_using;
typedef Name<struct has_expensive_tests_name> has_expensive_tests;
typedef Name<struct has_optional_tests_name> has_optional_tests;
typedef Name<struct has_recommended_tests_name> has_recommended_tests;
@@ -336,6 +339,9 @@ namespace paludis
NamedValue<n::defined_phases, std::shared_ptr<const EAPIMetadataVariable> > defined_phases;
NamedValue<n::dependencies, std::shared_ptr<const EAPIMetadataVariable> > dependencies;
NamedValue<n::eapi, std::shared_ptr<const EAPIMetadataVariable> > eapi;
+ NamedValue<n::generated_from, std::shared_ptr<const EAPIMetadataVariable> > generated_from;
+ NamedValue<n::generated_time, std::shared_ptr<const EAPIMetadataVariable> > generated_time;
+ NamedValue<n::generated_using, std::shared_ptr<const EAPIMetadataVariable> > generated_using;
NamedValue<n::homepage, std::shared_ptr<const EAPIMetadataVariable> > homepage;
NamedValue<n::inherited, std::shared_ptr<const EAPIMetadataVariable> > inherited;
NamedValue<n::iuse, std::shared_ptr<const EAPIMetadataVariable> > iuse;
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index 099b44e..da7f43a 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -222,6 +222,9 @@ flat_list_properties = 15
flat_list_use_expand = -1
flat_list_use_expand_hidden = -1
flat_list_defined_phases = 16
+flat_list_generated_from = -1
+flat_list_generated_time = -1
+flat_list_generated_using = -1
env_use = USE
env_use_expand = USE_EXPAND
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 2c1d27f..b37d218 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -274,6 +274,9 @@ flat_list_properties = -1
flat_list_use_expand = -1
flat_list_use_expand_hidden = -1
flat_list_defined_phases = -1
+flat_list_generated_from = -1
+flat_list_generated_time = -1
+flat_list_generated_using = -1
env_use = OPTIONS
env_use_expand = SUBOPTIONS
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index 9f45ef7..33419f7 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -225,6 +225,9 @@ flat_list_properties = -1
flat_list_use_expand = -1
flat_list_use_expand_hidden = -1
flat_list_defined_phases = -1
+flat_list_generated_from = -1
+flat_list_generated_time = -1
+flat_list_generated_using = -1
env_use = USE
env_use_expand = USE_EXPAND
diff --git a/paludis/repositories/e/eapis/pbin-1+0.conf b/paludis/repositories/e/eapis/pbin-1+0.conf
index e4760bb..379d787 100644
--- a/paludis/repositories/e/eapis/pbin-1+0.conf
+++ b/paludis/repositories/e/eapis/pbin-1+0.conf
@@ -38,12 +38,14 @@ ebuild_install = \
description_generated_using = Generated using
description_generated_time = Generated time
+description_generated_from = Generated from
description_keywords = Binary keywords
description_src_uri = Binary URI
description_use = Selected USE flags
metadata_generated_using = GENERATED_USING
metadata_generated_time = GENERATED_TIME
+metadata_generated_from = GENERATED_FROM_REPOSITORY
metadata_keywords = BINARY_KEYWORDS
metadata_src_uri = BINARY_URI
metadata_use = USE
diff --git a/paludis/repositories/e/eapis/pbin-1+1.conf b/paludis/repositories/e/eapis/pbin-1+1.conf
index 5485f96..5e7cc80 100644
--- a/paludis/repositories/e/eapis/pbin-1+1.conf
+++ b/paludis/repositories/e/eapis/pbin-1+1.conf
@@ -38,12 +38,14 @@ ebuild_install = \
description_generated_using = Generated using
description_generated_time = Generated time
+description_generated_from = Generated from
description_keywords = Binary keywords
description_src_uri = Binary URI
description_use = Selected USE flags
metadata_generated_using = GENERATED_USING
metadata_generated_time = GENERATED_TIME
+metadata_generated_from = GENERATED_FROM_REPOSITORY
metadata_keywords = BINARY_KEYWORDS
metadata_src_uri = BINARY_URI
metadata_use = USE
diff --git a/paludis/repositories/e/eapis/pbin-1+2.conf b/paludis/repositories/e/eapis/pbin-1+2.conf
index 93b8d71..6d900b9 100644
--- a/paludis/repositories/e/eapis/pbin-1+2.conf
+++ b/paludis/repositories/e/eapis/pbin-1+2.conf
@@ -38,12 +38,14 @@ ebuild_install = \
description_generated_using = Generated using
description_generated_time = Generated time
+description_generated_from = Generated from
description_keywords = Binary keywords
description_src_uri = Binary URI
description_use = Selected USE flags
metadata_generated_using = GENERATED_USING
metadata_generated_time = GENERATED_TIME
+metadata_generated_from = GENERATED_FROM_REPOSITORY
metadata_keywords = BINARY_KEYWORDS
metadata_src_uri = BINARY_URI
metadata_use = USE
diff --git a/paludis/repositories/e/eapis/pbin-1+3.conf b/paludis/repositories/e/eapis/pbin-1+3.conf
index 4206823..91da125 100644
--- a/paludis/repositories/e/eapis/pbin-1+3.conf
+++ b/paludis/repositories/e/eapis/pbin-1+3.conf
@@ -38,12 +38,14 @@ ebuild_install = \
description_generated_using = Generated using
description_generated_time = Generated time
+description_generated_from = Generated from
description_keywords = Binary keywords
description_src_uri = Binary URI
description_use = Selected USE flags
metadata_generated_using = GENERATED_USING
metadata_generated_time = GENERATED_TIME
+metadata_generated_from = GENERATED_FROM_REPOSITORY
metadata_keywords = BINARY_KEYWORDS
metadata_src_uri = BINARY_URI
metadata_use = USE
diff --git a/paludis/repositories/e/eapis/pbin-1+4.conf b/paludis/repositories/e/eapis/pbin-1+4.conf
index d502ad3..f3d1d38 100644
--- a/paludis/repositories/e/eapis/pbin-1+4.conf
+++ b/paludis/repositories/e/eapis/pbin-1+4.conf
@@ -38,12 +38,14 @@ ebuild_install = \
description_generated_using = Generated using
description_generated_time = Generated time
+description_generated_from = Generated from
description_keywords = Binary keywords
description_src_uri = Binary URI
description_use = Selected USE flags
metadata_generated_using = GENERATED_USING
metadata_generated_time = GENERATED_TIME
+metadata_generated_from = GENERATED_FROM_REPOSITORY
metadata_keywords = BINARY_KEYWORDS
metadata_src_uri = BINARY_URI
metadata_use = USE
diff --git a/paludis/repositories/e/eapis/pbin-1+exheres-0.conf b/paludis/repositories/e/eapis/pbin-1+exheres-0.conf
index 08395c2..bfee77b 100644
--- a/paludis/repositories/e/eapis/pbin-1+exheres-0.conf
+++ b/paludis/repositories/e/eapis/pbin-1+exheres-0.conf
@@ -37,12 +37,14 @@ ebuild_install = \
description_generated_using = Generated using
description_generated_time = Generated time
+description_generated_from = Generated from
description_src_uri = Binary URI
description_keywords = Binary platforms
description_use = Selected option flags
metadata_generated_using = GENERATED_USING
metadata_generated_time = GENERATED_TIME
+metadata_generated_from = GENERATED_FROM_REPOSITORY
metadata_keywords = BINARY_PLATFORMS
metadata_src_uri = BINARY_URI
metadata_use = OPTIONS
diff --git a/paludis/repositories/e/eapis/pbin-1+paludis-1.conf b/paludis/repositories/e/eapis/pbin-1+paludis-1.conf
index edcaec9..188082f 100644
--- a/paludis/repositories/e/eapis/pbin-1+paludis-1.conf
+++ b/paludis/repositories/e/eapis/pbin-1+paludis-1.conf
@@ -36,12 +36,14 @@ ebuild_install = \
description_generated_using = Generated using
description_generated_time = Generated time
+description_generated_from = Generated from
description_keywords = Binary keywords
description_src_uri = Binary URI
description_use = Selected USE flags
metadata_generated_using = GENERATED_USING
metadata_generated_time = GENERATED_TIME
+metadata_generated_from = GENERATED_FROM_REPOSITORY
metadata_keywords = BINARY_KEYWORDS
metadata_src_uri = BINARY_URI
metadata_use = USE
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index e643b56..09e387f 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -626,6 +626,15 @@ EbuildMetadataCommand::load(const std::shared_ptr<const EbuildID> & id)
if (! m.use()->name().empty())
id->load_use(m.use()->name(), m.use()->description(), get(keys, m.use()->name()));
+ if (! m.generated_from()->name().empty())
+ id->load_generated_from(m.generated_from()->name(), m.generated_from()->description(), get(keys, m.generated_from()->name()));
+
+ if (! m.generated_time()->name().empty())
+ id->load_generated_time(m.generated_time()->name(), m.generated_time()->description(), get(keys, m.generated_time()->name()));
+
+ if (! m.generated_using()->name().empty())
+ id->load_generated_using(m.generated_using()->name(), m.generated_using()->description(), get(keys, m.generated_using()->name()));
+
if (! m.upstream_changelog()->name().empty())
{
std::string value(get(keys, m.upstream_changelog()->name()));
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index ccba87f..3e3ad23 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -83,7 +83,7 @@ EBUILD_METADATA_VARIABLES="DEPEND RDEPEND PDEPEND IUSE SRC_URI DOWNLOADS RESTRIC
LICENSE LICENCES KEYWORDS INHERITED PROVIDE HOMEPAGE DESCRIPTION DEPENDENCIES \
E_IUSE E_DEPEND E_RDEPEND E_PDEPEND PLATFORMS \
MYOPTIONS E_MYOPTIONS E_DEPENDENCIES BINARY_KEYWORDS BINARY_URI \
- GENERATED_USING GENERATED_TIME BINARY_PLATFORMS REMOTE_IDS \
+ GENERATED_USING GENERATED_TIME GENERATED_FROM_REPOSITORY BINARY_PLATFORMS REMOTE_IDS \
SUMMARY BUGS_TO UPSTREAM_DOCUMENTATION UPSTREAM_CHANGELOG \
UPSTREAM_RELEASE_NOTES PROPERTIES PALUDIS_DECLARED_FUNCTIONS SLOT EAPI OPTIONS USE \
PALUDIS_EBUILD_RDEPEND_WAS_SET PALUDIS_EBUILD_DEPEND"
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index ec44068..90105b7 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -242,6 +242,15 @@ namespace
if (-1 != m.use()->flat_list_index() && ! m.use()->name().empty())
id->load_use(m.use()->name(), m.use()->description(), lines.at(m.use()->flat_list_index()));
+ if (-1 != m.generated_from()->flat_list_index() && ! m.generated_from()->name().empty())
+ id->load_generated_from(m.generated_from()->name(), m.generated_from()->description(), lines.at(m.generated_from()->flat_list_index()));
+
+ if (-1 != m.generated_time()->flat_list_index() && ! m.generated_time()->name().empty())
+ id->load_generated_time(m.generated_time()->name(), m.generated_time()->description(), lines.at(m.generated_time()->flat_list_index()));
+
+ if (-1 != m.generated_using()->flat_list_index() && ! m.generated_using()->name().empty())
+ id->load_generated_using(m.generated_using()->name(), m.generated_using()->description(), lines.at(m.generated_using()->flat_list_index()));
+
if (-1 != m.upstream_changelog()->flat_list_index() && ! m.upstream_changelog()->name().empty())
{
std::string value(lines.at(m.upstream_changelog()->flat_list_index()));
@@ -575,6 +584,15 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
if (! m.use()->name().empty())
id->load_use(m.use()->name(), m.use()->description(), keys[m.use()->name()]);
+ if (! m.generated_from()->name().empty())
+ id->load_generated_from(m.generated_from()->name(), m.generated_from()->description(), keys[m.generated_from()->name()]);
+
+ if (! m.generated_time()->name().empty())
+ id->load_generated_time(m.generated_time()->name(), m.generated_time()->description(), keys[m.generated_time()->name()]);
+
+ if (! m.generated_using()->name().empty())
+ id->load_generated_using(m.generated_using()->name(), m.generated_using()->description(), keys[m.generated_using()->name()]);
+
if (! m.upstream_changelog()->name().empty())
{
std::string value(keys[m.upstream_changelog()->name()]);
@@ -810,6 +828,16 @@ EbuildFlatMetadataCache::save(const std::shared_ptr<const EbuildID> & id)
if (! m.remote_ids()->name().empty() && id->remote_ids_key())
write_kv(cache, m.remote_ids()->name(), flatten(id->remote_ids_key()->value()));
+ if (! m.generated_using()->name().empty() && id->generated_using_key())
+ write_kv(cache, m.generated_using()->name(), id->generated_using_key()->value());
+
+ if (! m.generated_time()->name().empty() && id->generated_time_key())
+ write_kv(cache, m.generated_time()->name(), stringify(id->generated_time_key()->value().seconds()));
+
+ if (! m.generated_from()->name().empty() && id->generated_from_key())
+ write_kv(cache, m.generated_from()->name(), join(id->generated_from_key()->value()->begin(),
+ id->generated_from_key()->value()->end(), " "));
+
if (! m.upstream_changelog()->name().empty() && id->upstream_changelog_key())
write_kv(cache, m.upstream_changelog()->name(), flatten(id->upstream_changelog_key()->value()));
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 9456bf5..542b42e 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -54,6 +54,7 @@
#include <paludis/util/return_literal_function.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/destringify.hh>
#include <set>
#include <iterator>
@@ -113,6 +114,9 @@ namespace paludis
mutable std::shared_ptr<const ESimpleURIKey> upstream_release_notes;
mutable std::shared_ptr<const EChoicesKey> choices;
mutable std::shared_ptr<const EStringSetKey> defined_phases;
+ mutable std::shared_ptr<const EStringSetKey> generated_from;
+ mutable std::shared_ptr<const LiteralMetadataTimeKey> generated_time;
+ mutable std::shared_ptr<const LiteralMetadataValueKey<std::string> > generated_using;
std::shared_ptr<DependenciesLabelSequence> raw_dependencies_labels;
std::shared_ptr<DependenciesLabelSequence> build_dependencies_labels;
@@ -264,7 +268,7 @@ EbuildID::need_keys_added() const
n::maybe_output_manager() = make_null_shared_ptr(),
n::package_builddir() = _imp->repository->params().builddir() / (stringify(name().category()) + "-" + stringify(name().package()) + "-" + stringify(version()) + "-metadata"),
n::package_id() = shared_from_this(),
- n::portdir() =
+ n::portdir() =
(_imp->repository->params().master_repositories() && ! _imp->repository->params().master_repositories()->empty()) ?
(*_imp->repository->params().master_repositories()->begin())->params().location() : _imp->repository->params().location(),
n::root() = "/",
@@ -810,7 +814,8 @@ EbuildID::installed_time_key() const
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > >
EbuildID::from_repositories_key() const
{
- return std::shared_ptr<const MetadataCollectionKey<Set<std::string> > >();
+ need_keys_added();
+ return _imp->generated_from;
}
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > >
@@ -1089,6 +1094,30 @@ EbuildID::load_slot(const std::shared_ptr<const EAPIMetadataVariable> & m, const
add_metadata_key(_imp->slot);
}
+void
+EbuildID::load_generated_from(const std::string & r, const std::string & h, const std::string & v) const
+{
+ Lock l(_imp->mutex);
+ _imp->generated_from = std::make_shared<EStringSetKey>(shared_from_this(), r, h, v, mkt_normal);
+ add_metadata_key(_imp->generated_from);
+}
+
+void
+EbuildID::load_generated_time(const std::string & r, const std::string & h, const std::string & v) const
+{
+ Lock l(_imp->mutex);
+ _imp->generated_time = std::make_shared<LiteralMetadataTimeKey>(r, h, mkt_normal, Timestamp(destringify<std::time_t>(v), 0));
+ add_metadata_key(_imp->generated_time);
+}
+
+void
+EbuildID::load_generated_using(const std::string & r, const std::string & h, const std::string & v) const
+{
+ Lock l(_imp->mutex);
+ _imp->generated_using = std::make_shared<LiteralMetadataValueKey<std::string> >(r, h, mkt_normal, v);
+ add_metadata_key(_imp->generated_using);
+}
+
namespace
{
struct SupportsActionQuery
@@ -1256,6 +1285,27 @@ EbuildID::upstream_release_notes_key() const
return _imp->upstream_release_notes;
}
+const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > >
+EbuildID::generated_from_key() const
+{
+ need_keys_added();
+ return _imp->generated_from;
+}
+
+const std::shared_ptr<const MetadataTimeKey>
+EbuildID::generated_time_key() const
+{
+ need_keys_added();
+ return _imp->generated_time;
+}
+
+const std::shared_ptr<const MetadataValueKey<std::string> >
+EbuildID::generated_using_key() const
+{
+ need_keys_added();
+ return _imp->generated_using;
+}
+
const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Choices> > >
EbuildID::choices_key() const
{
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index 5fea7b2..e6cd418 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -104,6 +104,9 @@ namespace paludis
const std::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> > upstream_changelog_key() const;
const std::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> > upstream_documentation_key() const;
const std::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> > upstream_release_notes_key() const;
+ const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > generated_from_key() const;
+ const std::shared_ptr<const MetadataTimeKey> generated_time_key() const;
+ const std::shared_ptr<const MetadataValueKey<std::string> > generated_using_key() const;
virtual bool arbitrary_less_than_comparison(const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -145,6 +148,9 @@ namespace paludis
void load_remote_ids(const std::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;
void load_defined_phases(const std::string &, const std::string &, const std::string &) const;
void load_slot(const std::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;
+ void load_generated_from(const std::string &, const std::string &, const std::string &) const;
+ void load_generated_using(const std::string &, const std::string &, const std::string &) const;
+ void load_generated_time(const std::string &, const std::string &, const std::string &) const;
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void perform_action(Action &) const;