X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/14669d4b95f0f6a9b215d7fa5aebbc3b7198585d..70aa55819c08ec979f50400d159daadbfb5c7f54:/debian/apt.systemd.daily diff --git a/debian/apt.systemd.daily b/debian/apt.systemd.daily old mode 100644 new mode 100755 index ee772cc80..03d41bae5 --- a/debian/apt.systemd.daily +++ b/debian/apt.systemd.daily @@ -290,26 +290,6 @@ debug_echo() fi } -check_power(){ - # laptop check, on_ac_power returns: - # 0 (true) System is on main power - # 1 (false) System is not on main power - # 255 (false) Power status could not be determined - # Desktop systems always return 255 it seems - if which on_ac_power >/dev/null 2>&1; then - on_ac_power - POWER=$? - if [ $POWER -eq 1 ]; then - debug_echo "exit: system NOT on main power" - return 1 - elif [ $POWER -ne 0 ]; then - debug_echo "power status ($POWER) undetermined, continuing" - fi - debug_echo "system is on main power." - fi - return 0 -} - # ------------------------ main ---------------------------- if test -r /var/lib/apt/extended_states; then @@ -340,8 +320,8 @@ fi VERBOSE=0 eval $(apt-config shell VERBOSE APT::Periodic::Verbose) debug_echo "verbose level $VERBOSE" -if [ "$VERBOSE" -le 2 ]; then - # quiet for 0,1,2 +if [ "$VERBOSE" -le 1 ]; then + # quiet for 0/1 XSTDOUT=">/dev/null" XSTDERR="2>/dev/null" XAPTOPT="-qq" @@ -357,8 +337,6 @@ if [ "$VERBOSE" -ge 3 ]; then set -x fi -check_power || exit 0 - # check if we can lock the cache and if the cache is clean if which apt-get >/dev/null 2>&1 && ! eval apt-get check $XAPTOPT $XSTDERR ; then debug_echo "error encountered in cron job with \"apt-get check\"." @@ -409,9 +387,6 @@ fi # deal with BackupArchiveInterval do_cache_backup $BackupArchiveInterval -# ensure we don't do this on battery -check_power || exit 0 - # include default system language so that "apt-get update" will # fetch the right translated package descriptions if [ -r /etc/default/locale ]; then