diff --git a/cronie-1.5.1-power.patch b/cronie-1.5.1-power.patch new file mode 100644 index 0000000..f2f9776 --- /dev/null +++ b/cronie-1.5.1-power.patch @@ -0,0 +1,21 @@ +diff --git a/contrib/0anacron b/contrib/0anacron +index 7bcb684..72a613d 100644 +--- a/contrib/0anacron ++++ b/contrib/0anacron +@@ -4,14 +4,11 @@ if test -r /var/spool/anacron/cron.daily; then + day=`cat /var/spool/anacron/cron.daily` + fi + if [ `date +%Y%m%d` = "$day" ]; then +- exit 0; ++ exit 0 + fi + + # Do not run jobs when on battery power +-if test -x /usr/bin/on_ac_power; then +- /usr/bin/on_ac_power >/dev/null 2>&1 +- if test $? -eq 1; then ++if [ `cat /sys/class/power_supply/AC/online 2>/dev/null`x = 0x ]; then + exit 0 +- fi + fi + /usr/sbin/anacron -s diff --git a/cronie.spec b/cronie.spec index b2f4ca1..3274b51 100644 --- a/cronie.spec +++ b/cronie.spec @@ -6,12 +6,14 @@ Summary: Cron daemon for executing programs at set times Name: cronie Version: 1.5.1 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT and BSD and ISC and GPLv2+ Group: System Environment/Base URL: https://fedorahosted.org/cronie Source0: https://fedorahosted.org/releases/c/r/cronie/%{name}-%{version}.tar.gz +Patch1: cronie-1.5.1-power.patch + Requires: dailyjobs %if %{with selinux} @@ -75,6 +77,7 @@ extra features. %prep %setup -q +%patch1 -p1 -b .power %build %configure \ @@ -201,6 +204,9 @@ exit 0 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/cron.d/dailyjobs %changelog +* Tue Aug 23 2016 Tomáš Mráz - 1.5.1-2 +- query power status directly from kernel + * Thu Jun 23 2016 Tomáš Mráz - 1.5.1-1 - new upstream release