aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-13 18:51:23 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-15 16:37:35 +0100
commit73c674541d16225ed1c371c2c3b0df626351a97f (patch)
treeea9c6ce7aa53b171a8de8632bcc096332bf26fb8
parent823833906c161846a9079d2f8104efefcaf263db (diff)
downloadpaludis-73c674541d16225ed1c371c2c3b0df626351a97f.tar.gz
paludis-73c674541d16225ed1c371c2c3b0df626351a97f.tar.xz
Don't bother loading empty required_use
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc10
-rw-r--r--paludis/repositories/e/ebuild_id.cc9
2 files changed, 13 insertions, 6 deletions
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index f5c2f2d..36dc5eb 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -299,9 +299,13 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->required_use()->name().empty())
if ((_imp->dir / vars->required_use()->name()).stat().exists())
{
- _imp->keys->required_use = std::make_shared<ERequiredUseKey>(_imp->environment, vars->required_use(),
- eapi(), file_contents(_imp->dir / vars->required_use()->name()), mkt_internal, is_installed());
- add_metadata_key(_imp->keys->required_use);
+ std::string v(file_contents(_imp->dir / vars->required_use()->name()));
+ if (! v.empty())
+ {
+ _imp->keys->required_use = std::make_shared<ERequiredUseKey>(_imp->environment, vars->required_use(),
+ eapi(), v, mkt_internal, is_installed());
+ add_metadata_key(_imp->keys->required_use);
+ }
}
if (! vars->use_expand()->name().empty())
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 99a1c92..a81701d 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -1073,9 +1073,12 @@ EbuildID::load_myoptions(const std::shared_ptr<const EAPIMetadataVariable> & h,
void
EbuildID::load_required_use(const std::shared_ptr<const EAPIMetadataVariable> & k, const std::string & v) const
{
- Lock l(_imp->mutex);
- _imp->required_use = std::make_shared<ERequiredUseKey>(_imp->environment, k, eapi(), v, mkt_internal, is_installed());
- add_metadata_key(_imp->required_use);
+ if (! v.empty())
+ {
+ Lock l(_imp->mutex);
+ _imp->required_use = std::make_shared<ERequiredUseKey>(_imp->environment, k, eapi(), v, mkt_internal, is_installed());
+ add_metadata_key(_imp->required_use);
+ }
}
void