aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-09-15 17:19:30 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-09-17 13:22:18 +0100
commit633cee0ee6153cfcff5d1a29aad1cdfe60f01dc1 (patch)
tree29162f37a5a8ae94db56552cd1408abf3d36c8e3
parent278eb8442b64676ed0c69bc2097898553be8a81b (diff)
downloadpaludis-633cee0ee6153cfcff5d1a29aad1cdfe60f01dc1.tar.gz
paludis-633cee0ee6153cfcff5d1a29aad1cdfe60f01dc1.tar.xz
Don't verify volatile files
-rw-r--r--paludis/ndbam.cc6
-rw-r--r--paludis/ndbam_merger.cc5
-rw-r--r--src/clients/cave/cmd_verify.cc16
3 files changed, 24 insertions, 3 deletions
diff --git a/paludis/ndbam.cc b/paludis/ndbam.cc
index c07f39e..cd2d22e 100644
--- a/paludis/ndbam.cc
+++ b/paludis/ndbam.cc
@@ -594,8 +594,14 @@ NDBAM::parse_contents(const PackageID & id,
if (tokens.count("part"))
part = tokens.find("part")->second;
+ bool isvolatile = false;
+ if (tokens.count("volatile"))
+ isvolatile = destringify<bool>(tokens.find("volatile")->second);
+
std::shared_ptr<ContentsSymEntry> entry(std::make_shared<ContentsSymEntry>(FSPath(path), target, part));
entry->add_metadata_key(std::make_shared<LiteralMetadataTimeKey>("mtime", "mtime", mkt_normal, Timestamp(mtime, 0)));
+ if (isvolatile)
+ entry->add_metadata_key(std::make_shared<LiteralMetadataValueKey<bool> >("volatile", "volatile", mkt_normal, isvolatile));
on_sym(entry);
}
else
diff --git a/paludis/ndbam_merger.cc b/paludis/ndbam_merger.cc
index 282b4c8..85acc05 100644
--- a/paludis/ndbam_merger.cc
+++ b/paludis/ndbam_merger.cc
@@ -225,7 +225,10 @@ NDBAMMerger::record_install_sym(const FSPath & src, const FSPath & dst_dir, cons
*_imp->contents_file << "type=sym path=" << escape(tidy);
*_imp->contents_file << " target=" << escape(target);
- *_imp->contents_file << " mtime=" << timestamp.seconds() << std::endl;
+ *_imp->contents_file << " mtime=" << timestamp.seconds();
+ if (_imp->params.is_volatile()(FSPath(tidy)))
+ *_imp->contents_file << " volatile=true";
+ *_imp->contents_file << std::endl;
}
void
diff --git a/src/clients/cave/cmd_verify.cc b/src/clients/cave/cmd_verify.cc
index de42e0f..c22b7ec 100644
--- a/src/clients/cave/cmd_verify.cc
+++ b/src/clients/cave/cmd_verify.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -152,6 +152,18 @@ namespace
return true;
}
+ bool is_volatile(const ContentsEntry & e)
+ {
+ ContentsEntry::MetadataConstIterator k(e.find_metadata("volatile"));
+ if (e.end_metadata() != k)
+ {
+ const MetadataValueKey<bool> * kk(visitor_cast<const MetadataValueKey<bool> >(**k));
+ if (kk)
+ return kk->parse_value();
+ }
+ return false;
+ }
+
void visit(const ContentsFileEntry & e)
{
FSPath f(e.location_key()->parse_value());
@@ -160,7 +172,7 @@ namespace
message(f, "Does not exist");
else if (! f_stat.is_regular_file())
message(f, "Not a regular file");
- else
+ else if (! is_volatile(e))
check_mtime(e, f, f_stat) && check_md5(e, f);
}