__package_apt: update index cache, on installation, when it is older than one day

This commit is contained in:
ander 2020-02-09 20:37:06 +02:00
parent 7a5d6d5a7d
commit 08d5814e2c

View file

@ -74,6 +74,11 @@ fi
case "$state_should" in
present)
cat << EOF
if [ -f /var/cache/apt/pkgcache.bin ] && [ "\$( stat --format %Y /var/cache/apt/pkgcache.bin )" -lt "\$( date +%s -d '-1 day' )" ]
then echo apt-get update > /dev/null 2>&1 || true
fi
EOF
if [ -n "$version" ]; then
name="${name}=${version}"
fi