X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/50816ce74432f24135aefc590361bbb8ccfc71f1..1b4560fec66a6e7b2dff9aaa19095fb8423f69a0:/debian/apt.cron.daily diff --git a/debian/apt.cron.daily b/debian/apt.cron.daily index 27f08dd4a..2616af1dd 100644 --- a/debian/apt.cron.daily +++ b/debian/apt.cron.daily @@ -197,11 +197,11 @@ check_size_constraints() delta=$(($now-$ctime)) fi if [ $delta -le $MinAge ]; then - debug_echo "skip remove by archive size: $file, delta=$delta < $MinAgeSec" + debug_echo "skip remove by archive size: $file, delta=$delta < $MinAge" break else # delete oldest file - debug_echo "remove by archive size: $file, delta=$delta >= $MinAgeSec (sec), size=$size >= $MaxSize" + debug_echo "remove by archive size: $file, delta=$delta >= $MinAge (sec), size=$size >= $MaxSize" rm -f $file fi fi @@ -289,7 +289,7 @@ random_sleep() fi if [ -z "$RANDOM" ] ; then # A fix for shells that do not have this bash feature. - RANDOM=$(dd if=/dev/urandom bs=2 count=1 2> /dev/null | cksum | cut -d' ' -f1 | cut -c"1-5") + RANDOM=$(( $(dd if=/dev/urandom bs=2 count=1 2> /dev/null | cksum | cut -d' ' -f1) % 32767 )) fi TIME=$(($RANDOM % $RandomSleep)) debug_echo "sleeping for $TIME seconds" @@ -375,7 +375,7 @@ fi check_power || exit 0 # check if we can lock the cache and if the cache is clean -if which apt-get >/dev/null && ! eval apt-get check -f $XAPTOPT $XSTDERR ; then +if which apt-get >/dev/null && ! eval apt-get check $XAPTOPT $XSTDERR ; then debug_echo "error encountered in cron job with \"apt-get check\"." exit 0 fi