diff options
author | Nicolas Le Cam <niko.lecam@gmail.com> | 2016-06-22 21:39:38 +0200 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2016-06-27 11:22:02 +0200 |
commit | 51d659e7d8cdce59f910eceeee68e2c2afdb70d4 (patch) | |
tree | 831f8e8f6e5efd069224b7eaa22ec8418ee01f5b /debian/apt.systemd.daily | |
parent | 25a694165ae46c159e0d91bf0b27717f00dbc66e (diff) |
Use the ConditionACPower feature of systemd in the apt-daily service
.. instead of hardcoding the functionnality in the apt.systemd.daily
script.
Also make the compatibility cron job provide the same functionnality
for systems that do not use systemd.
Closes: #827930
Diffstat (limited to 'debian/apt.systemd.daily')
-rw-r--r-- | debian/apt.systemd.daily | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/debian/apt.systemd.daily b/debian/apt.systemd.daily index 15024c892..d034d8c1a 100644 --- a/debian/apt.systemd.daily +++ b/debian/apt.systemd.daily @@ -290,27 +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 @@ -358,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\"." @@ -410,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 |