From 8a87b1dd46ee86612e6e466b8dac9385ec921bd9 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 26 Feb 2018 12:26:32 -0500 Subject: [PATCH] sysroot: Bump mtime when writing an origin file This ensures that e.g. `rpm-ostreed` will get notified of the changes. --- src/libostree/ostree-sysroot-deploy.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index 4284b5ae91..8fdf28a393 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -847,7 +847,9 @@ merge_configuration (OstreeSysroot *sysroot, return TRUE; } -/* Write the origin file for a deployment. */ +/* Write the origin file for a deployment; this does not bump the mtime, under + * the assumption the caller may be writing multiple. + */ static gboolean write_origin_file_internal (OstreeSysroot *sysroot, OstreeDeployment *deployment, @@ -903,9 +905,15 @@ ostree_sysroot_write_origin_file (OstreeSysroot *sysroot, GCancellable *cancellable, GError **error) { - return write_origin_file_internal (sysroot, deployment, new_origin, - GLNX_FILE_REPLACE_DATASYNC_NEW, - cancellable, error); + if (!write_origin_file_internal (sysroot, deployment, new_origin, + GLNX_FILE_REPLACE_DATASYNC_NEW, + cancellable, error)) + return FALSE; + + if (!_ostree_sysroot_bump_mtime (sysroot, error)) + return FALSE; + + return TRUE; } typedef struct {