From ca4848b7592c312b1e946519f6d6f41a9f60aaa6 Mon Sep 17 00:00:00 2001 From: contradict Date: Mon, 1 Nov 2021 08:46:16 -0700 Subject: [PATCH] Make date condition easier to read. --- cdist/conf/type/__apt_update_index/gencode-remote | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cdist/conf/type/__apt_update_index/gencode-remote b/cdist/conf/type/__apt_update_index/gencode-remote index 77970f2c..e2e9f3ed 100755 --- a/cdist/conf/type/__apt_update_index/gencode-remote +++ b/cdist/conf/type/__apt_update_index/gencode-remote @@ -34,7 +34,8 @@ apt_opts="-o Acquire::AllowReleaseInfoChange::Suite=true -o Acquire::AllowReleas # run 'apt-get update' if anything in /etc/apt is newer then /var/lib/apt/lists # it will be run a second time on error as a redundancy messure to success cat << DONE -if [ ! -d /var/lib/apt/lists ] || { find /etc/apt -mindepth 1 -cnewer /var/lib/apt/lists | grep . > /dev/null; }; then +newer_sources=\$(find /etc/apt -mindepth 1 -cnewer /var/lib/apt/lists) +if [ ! -d /var/lib/apt/lists ] || [ -n "${newer_sources}" ]; then apt-get $apt_opts update || apt-get $apt_opts update fi DONE