[paludis-commits] paludis.git (master) -- 10da0e6 by Ciaran McCreesh

git at git.pioto.org git at git.pioto.org
Fri Sep 26 08:29:34 EDT 2008


Module:    paludis.git
Branch:    master
Commit:    10da0e608f7d826ab12d23dbd4fd4ff155e8c399
URL:       http://git.pioto.org/?p=paludis.git;a=commit;h=10da0e608f7d826ab12d23dbd4fd4ff155e8c399

Author:    Ciaran McCreesh <ciaran.mccreesh at googlemail.com>
Committer: Ciaran McCreesh <ciaran.mccreesh at googlemail.com>
Date:      Fri Sep 26 13:29:18 2008 +0100

----

PROPERTIES support.

----

 .../repositories/e/e_installed_repository_id.cc    |   17 +++++++++++++
 .../repositories/e/e_installed_repository_id.hh    |    1 +
 paludis/repositories/e/e_repository_id.hh          |    1 +
 paludis/repositories/e/eapi.cc                     |    1 +
 paludis/repositories/e/eapi.hh                     |    2 +
 paludis/repositories/e/eapis/0.conf                |    7 ++++-
 paludis/repositories/e/eapis/exheres-0.conf        |    3 ++
 paludis/repositories/e/eapis/paludis-1.conf        |    3 ++
 paludis/repositories/e/ebuild.cc                   |    3 ++
 paludis/repositories/e/ebuild/ebuild.bash          |    2 +-
 .../repositories/e/ebuild_flat_metadata_cache.cc   |    9 +++++++
 .../e/ebuild_flat_metadata_cache_TEST_setup.sh     |   26 ++++++++++++++++++++
 paludis/repositories/e/ebuild_id.cc                |   16 ++++++++++++
 paludis/repositories/e/ebuild_id.hh                |    2 +
 ruby/package_id_TEST.rb                            |    2 +-
 15 files changed, 91 insertions(+), 4 deletions(-)


diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index c2f8e65..4c4dd0f 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -86,6 +86,7 @@ namespace paludis
         std::tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > run_dependencies;
         std::tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > post_dependencies;
         std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> > restrictions;
+        std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> > properties;
         std::tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> > src_uri;
         std::tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> > homepage;
         std::tr1::shared_ptr<const MetadataValueKey<std::string> > short_description;
@@ -276,6 +277,15 @@ EInstalledRepositoryID::need_keys_added() const
             add_metadata_key(_imp->restrictions);
         }
 
+    if (! vars->properties().name().empty())
+        if ((_imp->dir / vars->properties().name()).exists())
+        {
+            _imp->properties.reset(new EPlainTextSpecKey(_imp->environment, shared_from_this(), vars->properties().name(),
+                        vars->properties().description(),
+                        file_contents(_imp->dir / vars->properties().name()), mkt_internal));
+            add_metadata_key(_imp->properties);
+        }
+
     if (! vars->src_uri().name().empty())
         if ((_imp->dir / vars->src_uri().name()).exists())
         {
@@ -642,6 +652,13 @@ EInstalledRepositoryID::restrict_key() const
     return _imp->restrictions;
 }
 
+const std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> >
+EInstalledRepositoryID::properties_key() const
+{
+    need_keys_added();
+    return _imp->properties;
+}
+
 const std::tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> >
 EInstalledRepositoryID::fetches_key() const
 {
diff --git a/paludis/repositories/e/e_installed_repository_id.hh b/paludis/repositories/e/e_installed_repository_id.hh
index a2ea2bc..faec334 100644
--- a/paludis/repositories/e/e_installed_repository_id.hh
+++ b/paludis/repositories/e/e_installed_repository_id.hh
@@ -67,6 +67,7 @@ namespace paludis
                 virtual const std::tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > post_dependencies_key() const;
                 virtual const std::tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > suggested_dependencies_key() const;
                 virtual const std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> > restrict_key() const;
+                virtual const std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> > properties_key() const;
                 virtual const std::tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> > fetches_key() const;
                 virtual const std::tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> > homepage_key() const;
                 virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > short_description_key() const;
diff --git a/paludis/repositories/e/e_repository_id.hh b/paludis/repositories/e/e_repository_id.hh
index 76401f1..e564ddb 100644
--- a/paludis/repositories/e/e_repository_id.hh
+++ b/paludis/repositories/e/e_repository_id.hh
@@ -35,6 +35,7 @@ namespace paludis
                 virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > inherited_key() const = 0;
                 virtual const std::tr1::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> > license_key() const = 0;
                 virtual const std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> > restrict_key() const = 0;
+                virtual const std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> > properties_key() const = 0;
                 virtual const std::tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameSet> > use_key() const = 0;
 
                 virtual std::tr1::shared_ptr<const Set<std::string> > breaks_portage() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 78a0deb..37c89b0 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -114,6 +114,7 @@ namespace
             value_for<n::long_description>(make_metadata_variable(k, "long_description")),
             value_for<n::minimum_flat_list_size>(destringify_key<int>(k, "flat_list_minimum_size")),
             value_for<n::pdepend>(make_metadata_variable(k, "pdepend")),
+            value_for<n::properties>(make_metadata_variable(k, "properties")),
             value_for<n::provide>(make_metadata_variable(k, "provide")),
             value_for<n::remote_ids>(make_metadata_variable(k, "remote_ids")),
             value_for<n::restrictions>(make_metadata_variable(k, "restrict")),
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index 33f8fae..69052b2 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -109,6 +109,7 @@ namespace paludis
         struct package_dep_spec_parse_options;
         struct pdepend;
         struct pipe_commands;
+        struct properties;
         struct provide;
         struct rdepend_defaults_to_depend;
         struct remote_ids;
@@ -269,6 +270,7 @@ namespace paludis
             NamedValue<n::long_description, EAPIMetadataVariable> long_description;
             NamedValue<n::minimum_flat_list_size, int> minimum_flat_list_size;
             NamedValue<n::pdepend, EAPIMetadataVariable> pdepend;
+            NamedValue<n::properties, EAPIMetadataVariable> properties;
             NamedValue<n::provide, EAPIMetadataVariable> provide;
             NamedValue<n::remote_ids, EAPIMetadataVariable> remote_ids;
             NamedValue<n::restrictions, EAPIMetadataVariable> restrictions;
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index 51fd238..885cc38 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -31,7 +31,7 @@ vdb_from_env_variables = \
 vdb_from_env_unless_empty_variables = \
     ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
     EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
-    REPOSITORY RESTRICT
+    REPOSITORY RESTRICT PROPERTIES
 
 binary_from_env_variables = \
     CHOST DEPEND DESCRIPTION EAPI HOMEPAGE IUSE LICENSE PDEPEND \
@@ -157,6 +157,7 @@ description_slot = Slot
 description_src_uri = Source URI
 description_use =
 description_dependencies =
+description_properties = Properties
 
 metadata_build_depend = DEPEND
 metadata_short_description = DESCRIPTION
@@ -174,8 +175,9 @@ metadata_slot = SLOT
 metadata_src_uri = SRC_URI
 metadata_use =
 metadata_dependencies =
+metadata_properties = PROPERTIES
 
-flat_list_minimum_size = 15
+flat_list_minimum_size = 16
 flat_list_build_depend = 0
 flat_list_short_description = 7
 flat_list_long_description = -1
@@ -198,6 +200,7 @@ flat_list_remote_ids = -1
 flat_list_upstream_changelog = -1
 flat_list_upstream_release_notes = -1
 flat_list_upstream_documentation = -1
+flat_list_properties = 15
 
 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 63afb8f..96fc3db 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -170,6 +170,7 @@ metadata_remote_ids = REMOTE_IDS
 metadata_upstream_changelog = UPSTREAM_CHANGELOG
 metadata_upstream_release_notes = UPSTREAM_RELEASE_NOTES
 metadata_upstream_documentation = UPSTREAM_DOCUMENTATION
+metadata_properties =
 
 description_build_depend =
 description_short_description = Summary
@@ -193,6 +194,7 @@ description_remote_ids = Remote IDs
 description_upstream_changelog = Upstream changelog
 description_upstream_release_notes = Upstream release notes
 description_upstream_documentation = Upstream documentation
+description_properties =
 
 flat_list_minimum_size = -1
 flat_list_build_depend = -1
@@ -217,6 +219,7 @@ flat_list_remote_ids = -1
 flat_list_upstream_changelog = -1
 flat_list_upstream_release_notes = -1
 flat_list_upstream_documentation = -1
+flat_list_properties = -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 cf27909..ca698d0 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -162,6 +162,7 @@ metadata_provide = PROVIDE
 metadata_eapi = EAPI
 metadata_dependencies =
 metadata_use =
+metadata_properties =
 
 description_build_depend = Build dependencies
 description_description = Description
@@ -179,6 +180,7 @@ description_slot = Slot
 description_src_uri = Source URI
 description_use = Selected USE flags
 description_dependencies =
+description_properties =
 
 flat_list_minimum_size = -1
 flat_list_build_depend = -1
@@ -204,6 +206,7 @@ flat_list_remote_ids = -1
 flat_list_upstream_changelog = -1
 flat_list_upstream_release_notes = -1
 flat_list_upstream_documentation = -1
+flat_list_properties = -1
 
 env_use = USE
 env_use_expand = USE_EXPAND
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 3f3183b..12a2f6a 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -511,6 +511,9 @@ EbuildMetadataCommand::load(const std::tr1::shared_ptr<const EbuildID> & id)
     if (! m.restrictions().name().empty())
         id->load_restrict(m.restrictions().name(), m.restrictions().description(), get(keys, m.restrictions().name()));
 
+    if (! m.properties().name().empty())
+        id->load_properties(m.properties().name(), m.properties().description(), get(keys, m.properties().name()));
+
     if (! m.use().name().empty())
         id->load_use(m.use().name(), m.use().description(), get(keys, m.use().name()));
 
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index a0d257b..bba4349 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -42,7 +42,7 @@ EBUILD_METADATA_VARIABLES="DEPEND RDEPEND PDEPEND IUSE SRC_URI DOWNLOADS RESTRIC
     MYOPTIONS E_MYOPTIONS E_DEPENDENCIES BINARY_KEYWORDS BINARY_URI \
     GENERATED_USING GENERATED_TIME BINARY_PLATFORMS REMOTE_IDS \
     SUMMARY BUGS_TO UPSTREAM_DOCUMENTATION UPSTREAM_CHANGELOG \
-    UPSTREAM_RELEASE_NOTES"
+    UPSTREAM_RELEASE_NOTES PROPERTIES"
 unset -v ${EBUILD_METADATA_VARIABLES} ${PALUDIS_EBUILD_MUST_NOT_SET_VARIABLES}
 # These can be set by C++
 EBUILD_METADATA_VARIABLES="${EBUILD_METADATA_VARIABLES} SLOT EAPI OPTIONS USE"
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index 7891ecd..f252744 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -183,6 +183,9 @@ namespace
             if (-1 != m.restrictions().flat_list_index() && ! m.restrictions().name().empty())
                 id->load_restrict(m.restrictions().name(), m.restrictions().description(), lines.at(m.restrictions().flat_list_index()));
 
+            if (-1 != m.properties().flat_list_index() && ! m.properties().name().empty())
+                id->load_properties(m.properties().name(), m.properties().description(), lines.at(m.properties().flat_list_index()));
+
             if (-1 != m.homepage().flat_list_index() && ! m.homepage().name().empty())
                 id->load_homepage(m.homepage().name(), m.homepage().description(), lines.at(m.homepage().flat_list_index()));
 
@@ -487,6 +490,9 @@ EbuildFlatMetadataCache::load(const std::tr1::shared_ptr<const EbuildID> & id)
                 if (! m.restrictions().name().empty())
                     id->load_restrict(m.restrictions().name(), m.restrictions().description(), keys[m.restrictions().name()]);
 
+                if (! m.properties().name().empty())
+                    id->load_properties(m.properties().name(), m.properties().description(), keys[m.properties().name()]);
+
                 if (! m.homepage().name().empty())
                     id->load_homepage(m.homepage().name(), m.homepage().description(), keys[m.homepage().name()]);
 
@@ -724,6 +730,9 @@ EbuildFlatMetadataCache::save(const std::tr1::shared_ptr<const EbuildID> & id)
         if (! m.restrictions().name().empty() && id->restrict_key())
             write_kv(cache, m.restrictions().name(), flatten(id->restrict_key()->value()));
 
+        if (! m.properties().name().empty() && id->properties_key())
+            write_kv(cache, m.properties().name(), flatten(id->properties_key()->value()));
+
         if (! m.homepage().name().empty() && id->homepage_key())
             write_kv(cache, m.homepage().name(), flatten(id->homepage_key()->value()));
 
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST_setup.sh b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST_setup.sh
index 761c5a0..25dda28 100755
--- a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST_setup.sh
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST_setup.sh
@@ -50,6 +50,7 @@ unused
 the/pdepend
 the/provide
 0
+the-properties
 END
 
 mkdir cat/flat_list-stale
@@ -79,6 +80,7 @@ unused
 the/pdepend
 the/provide
 0
+the-properties
 END
 TZ=UTC touch -t 199901010101 metadata/cache/cat/flat_list-stale-1 || exit 2
 
@@ -101,6 +103,7 @@ unused
 the/pdepend
 the/provide
 0
+the-properties
 END
 
 mkdir cat/flat_list-eclass-stale
@@ -130,6 +133,7 @@ unused
 the/pdepend
 the/provide
 0
+the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_list-eclass-stale/flat_list-eclass-stale-1.ebuild || exit 2
 TZ=UTC touch -t 197001010002 metadata/cache/cat/flat_list-eclass-stale-1 || exit 2
@@ -161,6 +165,7 @@ unused
 the/pdepend
 the/provide
 0
+the-properties
 END
 
 mkdir cat/flat_list-eclass-gone
@@ -190,6 +195,7 @@ unused
 the/pdepend
 the/provide
 0
+the-properties
 END
 
 mkdir cat/flat_list-detection
@@ -211,6 +217,7 @@ unused
 the/pdepend
 the/provide
 0
+the-properties
 END
 
 mkdir cat/flat_hash
@@ -231,6 +238,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash/flat_hash-1.ebuild || exit 2
 
@@ -252,6 +260,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash-empty/flat_hash-empty-1.ebuild || exit 2
 
@@ -281,6 +290,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 
 mkdir cat/flat_hash-no-mtime
@@ -300,6 +310,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash-no-mtime/flat_hash-no-mtime-1.ebuild || exit 2
 TZ=UTC touch -t 197001010001 metadata/cache/cat/flat_hash-no-mtime-1 || exit 2
@@ -329,6 +340,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 metadata/cache/cat/flat_hash-no-mtime-stale-1 || exit 2
 
@@ -358,6 +370,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash-bad-mtime/flat_hash-bad-mtime-1 || exit 2
 TZ=UTC touch -t 197001010001 metadata/cache/cat/flat_hash-bad-mtime-1 || exit 2
@@ -440,6 +453,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash-eclass/flat_hash-eclass-1.ebuild || exit 2
 
@@ -470,6 +484,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash-eclass-stale/flat_hash-eclass-stale-1.ebuild || exit 2
 
@@ -500,6 +515,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash-eclass-wrong/flat_hash-eclass-wrong-1.ebuild || exit 2
 
@@ -530,6 +546,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash-eclass-gone/flat_hash-eclass-gone-1.ebuild || exit 2
 
@@ -552,6 +569,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash-full-eclass/flat_hash-full-eclass-1.ebuild || exit 2
 
@@ -574,6 +592,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash-full-eclass-nonstandard/flat_hash-full-eclass-nonstandard-1.ebuild || exit 2
 
@@ -604,6 +623,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash-full-eclass-stale/flat_hash-full-eclass-stale-1.ebuild || exit 2
 
@@ -634,6 +654,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash-full-eclass-wrong/flat_hash-full-eclass-wrong-1.ebuild || exit 2
 
@@ -664,6 +685,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash-full-eclass-gone/flat_hash-full-eclass-gone-1.ebuild || exit 2
 
@@ -694,6 +716,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash-eclasses-truncated/flat_hash-eclasses-truncated-1.ebuild || exit 2
 cat <<END > cat/flat_hash-eclasses-truncated/flat_hash-eclasses-truncated-2.ebuild || exit 1
@@ -722,6 +745,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash-eclasses-truncated/flat_hash-eclasses-truncated-2.ebuild || exit 2
 
@@ -752,6 +776,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash-eclasses-bad-mtime/flat_hash-eclasses-bad-mtime-1.ebuild || exit 2
 
@@ -782,6 +807,7 @@ IUSE=the-iuse
 PDEPEND=the/pdepend
 PROVIDE=the/provide
 EAPI=0
+PROPERTIES=the-properties
 END
 TZ=UTC touch -t 197001010001 cat/flat_hash-eclasses-spaces/flat_hash-eclasses-spaces-1.ebuild || exit 2
 
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 47f4e43..4448c2f 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -81,6 +81,7 @@ namespace paludis
         mutable std::tr1::shared_ptr<const EDependenciesKey> post_dependencies;
         mutable std::tr1::shared_ptr<const EProvideKey> provide;
         mutable std::tr1::shared_ptr<const EPlainTextSpecKey> restrictions;
+        mutable std::tr1::shared_ptr<const EPlainTextSpecKey> properties;
         mutable std::tr1::shared_ptr<const EFetchableURIKey> src_uri;
         mutable std::tr1::shared_ptr<const ESimpleURIKey> homepage;
         mutable std::tr1::shared_ptr<const ELicenseKey> license;
@@ -559,6 +560,13 @@ EbuildID::restrict_key() const
     return _imp->restrictions;
 }
 
+const std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> >
+EbuildID::properties_key() const
+{
+    need_keys_added();
+    return _imp->properties;
+}
+
 const std::tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> >
 EbuildID::fetches_key() const
 {
@@ -742,6 +750,14 @@ EbuildID::load_restrict(const std::string & r, const std::string & h, const std:
 }
 
 void
+EbuildID::load_properties(const std::string & r, const std::string & h, const std::string & v) const
+{
+    Lock l(_imp->mutex);
+    _imp->properties.reset(new EPlainTextSpecKey(_imp->environment, shared_from_this(), r, h, v, mkt_internal));
+    add_metadata_key(_imp->properties);
+}
+
+void
 EbuildID::load_provide(const std::string & r, const std::string & h, const std::string & v) const
 {
     Lock l(_imp->mutex);
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index f2f3032..fd9964f 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -85,6 +85,7 @@ namespace paludis
                 const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > inherited_key() const;
                 const std::tr1::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> > license_key() const;
                 virtual const std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> > restrict_key() const;
+                virtual const std::tr1::shared_ptr<const MetadataSpecTreeKey<PlainTextSpecTree> > properties_key() const;
                 virtual const std::tr1::shared_ptr<const MetadataCollectionKey<UseFlagNameSet> > use_key() const;
 
                 virtual const std::tr1::shared_ptr<const MetadataValueKey<bool> > transient_key() const;
@@ -120,6 +121,7 @@ namespace paludis
                 void load_inherited(const std::string &, const std::string &, const std::string &) const;
                 void load_keywords(const std::string &, const std::string &, const std::string &) const;
                 void load_restrict(const std::string &, const std::string &, const std::string &) const;
+                void load_properties(const std::string &, const std::string &, const std::string &) const;
                 void load_long_description(const std::string &, const std::string &, const std::string &) const;
                 void load_upstream_changelog(const std::string &, const std::string &, const std::string &) const;
                 void load_upstream_documentation(const std::string &, const std::string &, const std::string &) const;
diff --git a/ruby/package_id_TEST.rb b/ruby/package_id_TEST.rb
index 3d0e515..d8d09ff 100644
--- a/ruby/package_id_TEST.rb
+++ b/ruby/package_id_TEST.rb
@@ -158,7 +158,7 @@ module Paludis
         def test_each_metadata
             keys = { "DESCRIPTION" => 1, "IUSE" => 1, "INHERITED" => 1, "KEYWORDS" => 1, "EAPI" => 1, "repository_mask" => 1,
                 "profile_mask" => 1, "DEPEND" => 1, "RDEPEND" => 1, "PDEPEND" => 1, "LICENSE" => 1, "PROVIDE" => 1,
-                "RESTRICT" => 1, "SRC_URI" => 1, "HOMEPAGE" => 1, "EBUILD" => 1 }
+                "RESTRICT" => 1, "SRC_URI" => 1, "HOMEPAGE" => 1, "EBUILD" => 1, "PROPERTIES" => 1 }
             pid_testrepo.each_metadata do | key |
                 assert keys.has_key?(key.raw_name)
                 keys.delete key.raw_name
---


More information about the paludis-commits mailing list