rpms/anacron/F-8 anacron-2.3-onbattery.patch, NONE, 1.1 anacron.spec, 1.42, 1.43

Marcela Mašláňová (mmaslano) fedora-extras-commits at redhat.com
Tue Dec 11 08:26:11 UTC 2007


Author: mmaslano

Update of /cvs/pkgs/rpms/anacron/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20322

Modified Files:
	anacron.spec 
Added Files:
	anacron-2.3-onbattery.patch 
Log Message:
0anacron.{daily,weekly,monthly} check whether they are on battery


anacron-2.3-onbattery.patch:

--- NEW FILE anacron-2.3-onbattery.patch ---
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


Index: anacron.spec
===================================================================
RCS file: /cvs/pkgs/rpms/anacron/F-8/anacron.spec,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- anacron.spec	25 Sep 2007 08:54:37 -0000	1.42
+++ anacron.spec	11 Dec 2007 08:25:36 -0000	1.43
@@ -1,7 +1,7 @@
 Summary: A cron-like program that can run jobs lost during downtime
 Name: anacron
 Version: 2.3
-Release: 56%{?dist}
+Release: 57%{?dist}
 License: GPLv2+
 Group: System Environment/Base
 URL: http://packages.debian.org/stable/source/anacron
@@ -13,6 +13,7 @@
 Patch2: anacron-2.3-fdclose.patch
 Patch3: anacron-2.3-pic.patch
 Patch4: anacron-2.3-memleaking.patch
+Patch5: anacron-2.3-onbattery.patch
 
 Requires: crontabs
 Requires: initscripts
@@ -44,6 +45,7 @@
 %patch2 -p1 -b .fdclose
 %patch3 -p1 -b .pic
 %patch4 -p1 -b .memleaking
+%patch5 -p1 -b .onbattery
 
 %build
 make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
@@ -104,6 +106,10 @@
 %attr(755,root,root) %dir /etc/cron.weekly/0anacron
 
 %changelog
+* Tue Dec 11 2007 Marcela Maslanova <mmaslano at redhat.com> 2.3-57
+- 0anacron.{daily,weekly,monthly} check whether they are on battery
+- rhbz#387301
+
 * Tue Sep 25 2007 Marcela Maslanova <mmaslano at redhat.com> 2.3-56
 - cron.{hourly,daily} work correct -> remove checking whether
   cron.daily has been run




More information about the fedora-extras-commits mailing list