aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-02-23 17:43:22 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-02-23 17:43:22 +0000
commitb9cf67350c847b2d38e415215cf62910bea88972 (patch)
treef9b5fb9f485d71654dc3f065fd7bf0f357959ee3
parenta3750004b2702abd8e5dfc44619d63e6b2f88930 (diff)
downloadpaludis-b9cf67350c847b2d38e415215cf62910bea88972.tar.gz
paludis-b9cf67350c847b2d38e415215cf62910bea88972.tar.xz
When writing the metadata cache, don't abort if directory creation fails.
-rw-r--r--paludis/repositories/gentoo/ebuild_flat_metadata_cache.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/paludis/repositories/gentoo/ebuild_flat_metadata_cache.cc b/paludis/repositories/gentoo/ebuild_flat_metadata_cache.cc
index e5873e4..8b3054e 100644
--- a/paludis/repositories/gentoo/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/gentoo/ebuild_flat_metadata_cache.cc
@@ -115,8 +115,15 @@ EbuildFlatMetadataCache::save(std::tr1::shared_ptr<const EbuildVersionMetadata>
{
Context context("When saving version metadata to '" + stringify(_filename) + "':");
- _filename.dirname().dirname().mkdir();
- _filename.dirname().mkdir();
+ try
+ {
+ _filename.dirname().dirname().mkdir();
+ _filename.dirname().mkdir();
+ }
+ catch (const FSError &e)
+ {
+ // let the 'if (cache)' handle the error
+ }
std::ofstream cache(stringify(_filename).c_str());
if (cache)