From 8ef1a136c1406bd1bab66e4ebf75b9375090cd86 Mon Sep 17 00:00:00 2001 From: Nikolai Kondrashov Date: Wed, 3 Sep 2014 11:18:05 +0300 Subject: CI: Preserve mock config timestamps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- contrib/ci/run | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'contrib/ci') 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" "$@" } -- cgit