This repository has been archived on 2026-01-16. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
anacron/anacron-2.3-onbattery.patch
2007-12-11 08:09:04 +00:00

60 lines
2.1 KiB
Diff

diff -up anacron-2.3/debian/0anacron.daily.old anacron-2.3/debian/0anacron.daily
--- anacron-2.3/debian/0anacron.daily.old 2007-11-30 13:35:58.000000000 +0100
+++ anacron-2.3/debian/0anacron.daily 2007-12-10 12:42:04.000000000 +0100
@@ -8,5 +8,16 @@
# The script is called "0anacron" to assure that it will be executed
# _before_ all other scripts.
+# on_ac_power doesn't exist, on_ac_power returns 0 (ac power being used)
+if test -x /usr/bin/on_ac_power
+ then
+ /usr/bin/on_ac_power > /dev/null
+ if test $? -eq 1
+ then
+ echo "deferred while on battery power."
+ exit 0
+ fi
+fi
+
test -x /usr/sbin/anacron || exit 0
anacron -u cron.daily
diff -up anacron-2.3/debian/0anacron.weekly.old anacron-2.3/debian/0anacron.weekly
--- anacron-2.3/debian/0anacron.weekly.old 2007-12-10 12:42:53.000000000 +0100
+++ anacron-2.3/debian/0anacron.weekly 2007-12-10 12:43:26.000000000 +0100
@@ -8,5 +8,16 @@
# The script is called "0anacron" to assure that it will be executed
# _before_ all other scripts.
+# on_ac_power doesn't exist, on_ac_power returns 0 (ac power being used)
+if test -x /usr/bin/on_ac_power
+ then
+ /usr/bin/on_ac_power > /dev/null
+ if test $? -eq 1
+ then
+ echo "deferred while on battery power."
+ exit 0
+ fi
+fi
+
test -x /usr/sbin/anacron || exit 0
anacron -u cron.weekly
diff -up anacron-2.3/debian/0anacron.monthly.old anacron-2.3/debian/0anacron.monthly
--- anacron-2.3/debian/0anacron.monthly.old 2007-12-10 12:42:42.000000000 +0100
+++ anacron-2.3/debian/0anacron.monthly 2007-12-10 12:43:12.000000000 +0100
@@ -8,5 +8,16 @@
# The script is called "0anacron" to assure that it will be executed
# _before_ all other scripts.
+# on_ac_power doesn't exist, on_ac_power returns 0 (ac power being used)
+if test -x /usr/bin/on_ac_power
+ then
+ /usr/bin/on_ac_power > /dev/null
+ if test $? -eq 1
+ then
+ echo "deferred while on battery power."
+ exit 0
+ fi
+fi
+
test -x /usr/sbin/anacron || exit 0
anacron -u cron.monthly