summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>2014-09-03 11:18:05 +0300
committerJakub Hrozek <jhrozek@redhat.com>2014-09-16 14:30:23 +0200
commit8ef1a136c1406bd1bab66e4ebf75b9375090cd86 (patch)
tree472bd588c34f43f00a17b0387ac13a42e7b1afbc /contrib
parent3b8a064895aaef68fb615cf0287167aa3d3c6cfc (diff)
downloadsssd-8ef1a136c1406bd1bab66e4ebf75b9375090cd86.tar.gz
sssd-8ef1a136c1406bd1bab66e4ebf75b9375090cd86.tar.xz
sssd-8ef1a136c1406bd1bab66e4ebf75b9375090cd86.zip
CI: Preserve mock config timestamps
Preserve timestamps of mock configuration files when customizing them in CI to avoid unnecessary cache rebuilds. This reduces CI run time. Reviewed-by: Michal Židek <mzidek@redhat.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/ci/run4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/ci/run b/contrib/ci/run
index c62b63799..9864818c6 100755
--- a/contrib/ci/run
+++ b/contrib/ci/run
@@ -144,8 +144,10 @@ function mock_privileged_conf()
conf_dir=`mktemp --tmpdir --directory mock-config.XXXXXXXX`
trap 'trap - RETURN; rm -R "$conf_dir";' RETURN
- cp -r /etc/mock/* "$conf_dir"/
+ # Preserve timestamps to avoid unnecessary cache rebuilds
+ cp -r --preserve=timestamps /etc/mock/* "$conf_dir"/
cat >> "${conf_dir}/${chroot}.cfg"
+ touch --reference="/etc/mock/${chroot}.cfg" "${conf_dir}/${chroot}.cfg"
mock_privileged --configdir="$conf_dir" --root="$chroot" "$@"
}