aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-21 08:36:37 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-21 09:04:14 +0100
commit3be6f0f7ffd23dc6f3ace83ac608d5c32786ef82 (patch)
tree98caab64941dbe24bd31206e49b1fca456e11ed8
parent759b51c3476a3d01c14e20e708a509b784dcaaf1 (diff)
downloadpaludis-3be6f0f7ffd23dc6f3ace83ac608d5c32786ef82.tar.gz
paludis-3be6f0f7ffd23dc6f3ace83ac608d5c32786ef82.tar.xz
Don't bother loading empty provide
-rw-r--r--paludis/repositories/e/ebuild.cc6
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc12
-rwxr-xr-xpython/package_id_TEST_setup.sh1
-rwxr-xr-xruby/package_id_TEST_setup.sh1
4 files changed, 17 insertions, 3 deletions
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 4e5ea38..3bcda1e 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -614,7 +614,11 @@ EbuildMetadataCommand::load(const std::shared_ptr<const EbuildID> & id)
id->load_license(m.license(), get(keys, m.license()->name()));
if (! m.provide()->name().empty())
- id->load_provide(m.provide(), get(keys, m.provide()->name()));
+ {
+ std::string value(get(keys, m.provide()->name()));
+ if (! value.empty())
+ id->load_provide(m.provide(), get(keys, m.provide()->name()));
+ }
if (! m.iuse()->name().empty())
id->load_iuse(m.iuse(), get(keys, m.iuse()->name()));
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index 391d1be..0db3b60 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -243,7 +243,11 @@ namespace
id->load_post_depend(m.pdepend()->name(), m.pdepend()->description(), lines.at(m.pdepend()->flat_list_index()), false);
if (-1 != m.provide()->flat_list_index() && ! m.provide()->name().empty())
- id->load_provide(m.provide(), lines.at(m.provide()->flat_list_index()));
+ {
+ std::string value(lines.at(m.provide()->flat_list_index()));
+ if (! value.empty())
+ id->load_provide(m.provide(), value);
+ }
if (-1 != m.use()->flat_list_index() && ! m.use()->name().empty())
id->load_use(m.use(), lines.at(m.use()->flat_list_index()));
@@ -586,7 +590,11 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
id->load_post_depend(m.pdepend()->name(), m.pdepend()->description(), keys[m.pdepend()->name()], false);
if (! m.provide()->name().empty())
- id->load_provide(m.provide(), keys[m.provide()->name()]);
+ {
+ std::string value(keys[m.provide()->name()]);
+ if (! value.empty())
+ id->load_provide(m.provide(), value);
+ }
if (! m.use()->name().empty())
id->load_use(m.use(), keys[m.use()->name()]);
diff --git a/python/package_id_TEST_setup.sh b/python/package_id_TEST_setup.sh
index be84627..0efc5ff 100755
--- a/python/package_id_TEST_setup.sh
+++ b/python/package_id_TEST_setup.sh
@@ -34,6 +34,7 @@ KEYWORDS="test"
RESTRICT="monkey"
DEPEND="foo/bar"
RDEPEND=""
+PROVIDE="virtual/monkey"
END
diff --git a/ruby/package_id_TEST_setup.sh b/ruby/package_id_TEST_setup.sh
index ed1668b..745e0df 100755
--- a/ruby/package_id_TEST_setup.sh
+++ b/ruby/package_id_TEST_setup.sh
@@ -36,6 +36,7 @@ KEYWORDS="~test"
RESTRICT="monkey"
DEPEND="foo/bar"
RDEPEND=""
+PROVIDE="virtual/monkey"
END
cat <<"END" > bad/pkg/pkg-1.0.ebuild || exit 1