aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-20 13:55:40 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-20 17:10:15 +0000
commitd4a242b1691f34bcdb8ceb0a7785e5029e0baf22 (patch)
tree36a77fdd4e21498023db87517699a4f2fa45df83
parentaf9ffdfee97b68dd495e2f19a9cc3e2878d0459f (diff)
downloadpaludis-d4a242b1691f34bcdb8ceb0a7785e5029e0baf22.tar.gz
paludis-d4a242b1691f34bcdb8ceb0a7785e5029e0baf22.tar.xz
Add SCM_REVISION to installed IDs
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc20
-rw-r--r--paludis/repositories/e/e_installed_repository_id.hh2
-rw-r--r--paludis/repositories/e/eapi.cc1
-rw-r--r--paludis/repositories/e/eapi.hh2
-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
7 files changed, 34 insertions, 0 deletions
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 358882c..aa77358 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -100,6 +100,7 @@ namespace
std::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> > remote_ids;
std::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> > bugs_to;
std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > defined_phases;
+ std::shared_ptr<const MetadataValueKey<std::string> > scm_revision;
std::shared_ptr<const MetadataValueKey<std::string> > asflags;
std::shared_ptr<const MetadataValueKey<std::string> > cbuild;
@@ -251,6 +252,18 @@ EInstalledRepositoryID::need_keys_added() const
}
}
+ if (! vars->scm_revision()->name().empty())
+ if ((_imp->dir / vars->scm_revision()->name()).stat().exists())
+ {
+ std::string d(file_contents(_imp->dir / vars->scm_revision()->name()));
+ if (! d.empty())
+ {
+ _imp->keys->scm_revision = std::make_shared<LiteralMetadataValueKey<std::string> >(vars->scm_revision()->name(),
+ vars->scm_revision()->description(), mkt_normal, d);
+ add_metadata_key(_imp->keys->scm_revision);
+ }
+ }
+
if (! vars->iuse()->name().empty())
{
if ((_imp->dir / vars->iuse()->name()).stat().exists())
@@ -867,6 +880,13 @@ EInstalledRepositoryID::from_repositories_key() const
return _imp->keys->from_repositories;
}
+const std::shared_ptr<const MetadataValueKey<std::string> >
+EInstalledRepositoryID::scm_revision_key() const
+{
+ need_keys_added();
+ return _imp->keys->scm_revision;
+}
+
const std::shared_ptr<const MetadataValueKey<FSPath> >
EInstalledRepositoryID::fs_location_key() const
{
diff --git a/paludis/repositories/e/e_installed_repository_id.hh b/paludis/repositories/e/e_installed_repository_id.hh
index 980db0a..342740e 100644
--- a/paludis/repositories/e/e_installed_repository_id.hh
+++ b/paludis/repositories/e/e_installed_repository_id.hh
@@ -93,6 +93,8 @@ namespace paludis
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > behaviours_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<std::string> > scm_revision_key() const;
+
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void perform_action(Action &) const;
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 8b31b8b..1d0ab9c 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -141,6 +141,7 @@ namespace
n::required_use() = make_metadata_variable(k, "required_use"),
n::restrictions() = make_metadata_variable(k, "restrict"),
n::run_depend() = make_metadata_variable(k, "run_depend"),
+ n::scm_revision() = make_metadata_variable(k, "scm_revision"),
n::short_description() = make_metadata_variable(k, "short_description"),
n::slot() = make_metadata_variable(k, "slot"),
n::src_uri() = make_metadata_variable(k, "src_uri"),
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index ec23871..f634edc 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -180,6 +180,7 @@ namespace paludis
typedef Name<struct name_save_base_variables> save_base_variables;
typedef Name<struct name_save_unmodifiable_variables> save_unmodifiable_variables;
typedef Name<struct name_save_variables> save_variables;
+ typedef Name<struct name_scm_revision> scm_revision;
typedef Name<struct name_shell_options> shell_options;
typedef Name<struct name_short_description> short_description;
typedef Name<struct name_slot> slot;
@@ -378,6 +379,7 @@ namespace paludis
NamedValue<n::required_use, std::shared_ptr<const EAPIMetadataVariable> > required_use;
NamedValue<n::restrictions, std::shared_ptr<const EAPIMetadataVariable> > restrictions;
NamedValue<n::run_depend, std::shared_ptr<const EAPIMetadataVariable> > run_depend;
+ NamedValue<n::scm_revision, std::shared_ptr<const EAPIMetadataVariable> > scm_revision;
NamedValue<n::short_description, std::shared_ptr<const EAPIMetadataVariable> > short_description;
NamedValue<n::slot, std::shared_ptr<const EAPIMetadataVariable> > slot;
NamedValue<n::src_uri, std::shared_ptr<const EAPIMetadataVariable> > src_uri;
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index 8b62c70..5784976 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -172,6 +172,7 @@ description_choices = Use flags
description_use_expand = USE expand flags
description_use_expand_hidden = USE expand hidden flags
description_defined_phases = Defined phases
+description_scm_revision =
metadata_build_depend = DEPEND
metadata_short_description = DESCRIPTION
@@ -193,6 +194,7 @@ metadata_properties = PROPERTIES
metadata_use_expand = USE_EXPAND
metadata_use_expand_hidden = USE_EXPAND_HIDDEN
metadata_defined_phases = DEFINED_PHASES
+metadata_scm_revision =
flat_list_minimum_size = 17
flat_list_build_depend = 0
@@ -227,6 +229,7 @@ flat_list_generated_from = -1
flat_list_generated_time = -1
flat_list_generated_using = -1
flat_list_required_use = -1
+flat_list_scm_revision = -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 bc16bb7..be46eb9 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -218,6 +218,7 @@ metadata_properties =
metadata_use_expand = SUBOPTIONS
metadata_use_expand_hidden = HIDDEN_SUBOPTIONS
metadata_defined_phases = DEFINED_PHASES
+metadata_scm_revision = SCM_REVISION
description_build_depend =
description_short_description = Summary
@@ -246,6 +247,7 @@ description_choices = Options
description_use_expand = Suboptions
description_use_expand_hidden = Hidden suboptions
description_defined_phases = Defined phases
+description_scm_revision = SCM_REVISION
flat_list_minimum_size = -1
flat_list_build_depend = -1
@@ -280,6 +282,7 @@ flat_list_generated_from = -1
flat_list_generated_time = -1
flat_list_generated_using = -1
flat_list_required_use = -1
+flat_list_scm_revision = -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 3bad9f2..ed3f17d 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -173,6 +173,7 @@ metadata_properties =
metadata_use_expand = USE_EXPAND
metadata_use_expand_hidden = USE_EXPAND_HIDDEN
metadata_defined_phases = DEFINED_PHASES
+metadata_scm_revision =
description_build_depend = Build dependencies
description_short_description = Description
@@ -195,6 +196,7 @@ description_choices = Use flags
description_use_expand = USE expand flags
description_use_expand_hidden = USE expand hidden flags
description_defined_phases = Defined phases
+description_scm_revision =
flat_list_minimum_size = -1
flat_list_build_depend = -1
@@ -230,6 +232,7 @@ flat_list_generated_from = -1
flat_list_generated_time = -1
flat_list_generated_using = -1
flat_list_required_use = -1
+flat_list_scm_revision = -1
env_use = USE
env_use_expand = USE_EXPAND