forked from ungleich-public/cdist
__package_apt: update index cache, on installation, when it is older than one day
This commit is contained in:
parent
7a5d6d5a7d
commit
08d5814e2c
1 changed files with 5 additions and 0 deletions
|
@ -74,6 +74,11 @@ fi
|
||||||
|
|
||||||
case "$state_should" in
|
case "$state_should" in
|
||||||
present)
|
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
|
if [ -n "$version" ]; then
|
||||||
name="${name}=${version}"
|
name="${name}=${version}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue