aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/depdb.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-11-28 09:40:25 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-11-28 09:40:25 +0200
commita50652b3e3323a9492c32d2ca6e97befd7d9755b (patch)
tree25ea39faa67cc87d41a3cf9623a82818dcd0ee3d /libbuild2/depdb.hxx
parenta8a54893c09c86e560e6fee9d7972419716dd56d (diff)
Generalize depdb::touch functionality to support custom timestamp
Diffstat (limited to 'libbuild2/depdb.hxx')
-rw-r--r--libbuild2/depdb.hxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/libbuild2/depdb.hxx b/libbuild2/depdb.hxx
index c3e60a2..9cff281 100644
--- a/libbuild2/depdb.hxx
+++ b/libbuild2/depdb.hxx
@@ -90,9 +90,16 @@ namespace build2
// close() even if otherwise no modifications are necessary (i.e., the
// database is in the read mode and is at eof).
//
- path_type path;
- timestamp mtime;
- bool touch;
+ // If touch is present then update the database modification time in
+ // close() even if otherwise no modifications are necessary (i.e., the
+ // database is in the read mode and is at eof). Specifically, if touch is
+ // timestamp_unknown, then set mtime to the current (filesystem) time.
+ // Otherwise, set it to the specified time (which should be sourced from
+ // the filesystem, see touch_file() for details).
+ //
+ path_type path;
+ timestamp mtime;
+ optional<timestamp> touch;
// Open the database for reading. Note that if the file does not exist,
// has wrong format version, or is corrupt, then the database will be