aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-12 14:45:13 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-12 14:45:22 +0100
commitfc0d52b00263a8a0e1e6423fd9a26ea48a320430 (patch)
tree578014fa1b9981921bb80a608459d5e8a088d2ee
parent120c58323950219e16d8fe22693af221d2887f9b (diff)
downloadpaludis-fc0d52b00263a8a0e1e6423fd9a26ea48a320430.tar.gz
paludis-fc0d52b00263a8a0e1e6423fd9a26ea48a320430.tar.xz
Don't cache vdb contents
-rw-r--r--paludis/repositories/e/e_key.cc21
1 files changed, 7 insertions, 14 deletions
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 10831c2..ecf8cba 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -783,8 +783,6 @@ namespace paludis
struct Imp<EContentsKey>
{
const FSPath filename;
- mutable Mutex value_mutex;
- mutable std::shared_ptr<Contents> value;
const std::string raw_name;
const std::string human_name;
@@ -812,21 +810,16 @@ EContentsKey::~EContentsKey()
const std::shared_ptr<const Contents>
EContentsKey::parse_value() const
{
- Lock l(_imp->value_mutex);
-
- if (_imp->value)
- return _imp->value;
-
Context context("When creating contents from '" + stringify(_imp->filename) + "':");
- _imp->value = std::make_shared<Contents>();
+ auto value(std::make_shared<Contents>());
FSPath f(_imp->filename);
if (! f.stat().is_regular_file_or_symlink_to_regular_file())
{
Log::get_instance()->message("e.contents.not_a_file", ll_warning, lc_context) << "Could not read CONTENTS file '" <<
_imp->filename << "'";
- return _imp->value;
+ return value;
}
SafeIFStream ff(f);
@@ -851,28 +844,28 @@ EContentsKey::parse_value() const
e->add_metadata_key(std::make_shared<LiteralMetadataTimeKey>("mtime", "mtime", mkt_normal,
Timestamp(destringify<time_t>(tokens.at(3)), 0)));
e->add_metadata_key(std::make_shared<LiteralMetadataValueKey<std::string>>("md5", "md5", mkt_normal, tokens.at(2)));
- _imp->value->add(e);
+ value->add(e);
}
else if ("dir" == tokens.at(0))
{
std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsDirEntry>(FSPath(tokens.at(1))));
- _imp->value->add(e);
+ value->add(e);
}
else if ("sym" == tokens.at(0))
{
std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsSymEntry>(FSPath(tokens.at(1)), tokens.at(2)));
e->add_metadata_key(std::make_shared<LiteralMetadataTimeKey>("mtime", "mtime", mkt_normal,
Timestamp(destringify<time_t>(tokens.at(3)), 0)));
- _imp->value->add(e);
+ value->add(e);
}
else if ("misc" == tokens.at(0) || "fif" == tokens.at(0) || "dev" == tokens.at(0))
- _imp->value->add(std::shared_ptr<ContentsEntry>(std::make_shared<ContentsOtherEntry>(FSPath(tokens.at(1)))));
+ value->add(std::shared_ptr<ContentsEntry>(std::make_shared<ContentsOtherEntry>(FSPath(tokens.at(1)))));
else
Log::get_instance()->message("e.contents.unknown", ll_warning, lc_context) << "CONTENTS has unsupported entry type '" <<
tokens.at(0) << "', skipping";
}
- return _imp->value;
+ return value;
}
const std::string