]> git.pld-linux.org Git - packages/logrotate.git/commitdiff
move cron script to sources instead of patching 95% of the file
authorElan Ruusamäe <glen@delfi.ee>
Thu, 29 Aug 2013 14:25:59 +0000 (17:25 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Thu, 29 Aug 2013 14:26:32 +0000 (17:26 +0300)
logrotate-cron.patch [deleted file]
logrotate.cron [new file with mode: 0755]
logrotate.spec

diff --git a/logrotate-cron.patch b/logrotate-cron.patch
deleted file mode 100644 (file)
index 9c98454..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
---- logrotate-3.7.9/examples/logrotate.cron~   2010-06-28 11:04:56.000000000 +0300
-+++ logrotate-3.7.9/examples/logrotate.cron    2010-07-12 10:42:34.890404991 +0300
-@@ -1,8 +1,18 @@
- #!/bin/sh
--/usr/sbin/logrotate /etc/logrotate.conf
-+MAILTO=""
-+ARG=""
-+
-+if [ -e /etc/sysconfig/logrotate ]; then
-+      . /etc/sysconfig/logrotate
-+fi
-+
-+/usr/sbin/logrotate $ARG /etc/logrotate.conf
- EXITVALUE=$?
- if [ $EXITVALUE != 0 ]; then
--    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
-+      /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
-+      if [ -n "$MAILTO" ]; then
-+              echo "ALERT exited abnormally with [$EXITVALUE]" |  mail -s "logrotate exited abnormally" $MAILTO
-+      fi
- fi
- exit 0
diff --git a/logrotate.cron b/logrotate.cron
new file mode 100755 (executable)
index 0000000..76a7a69
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+MAILTO=""
+ARG=""
+
+if [ -e /etc/sysconfig/logrotate ]; then
+       . /etc/sysconfig/logrotate
+fi
+
+/usr/sbin/logrotate $ARG /etc/logrotate.conf
+EXITVALUE=$?
+if [ $EXITVALUE != 0 ]; then
+       /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
+       if [ -n "$MAILTO" ]; then
+               echo "ALERT exited abnormally with [$EXITVALUE]" |  mail -s "logrotate exited abnormally" $MAILTO
+       fi
+fi
+exit 0
index 44ac4a9e4e6df6e17b9af6167c3d59cdaea0de49..e8485eaa952d608b0e13f86eaa0a535250acaf35 100644 (file)
@@ -27,7 +27,7 @@ Source0:      https://fedorahosted.org/releases/l/o/logrotate/%{name}-%{version}.tar.
 # Source0-md5: cd0082bbd7248e627ec659f2442fcdf9
 Source1:       %{name}.conf
 Source2:       %{name}.sysconfig
-Patch0:                %{name}-cron.patch
+Source3:       %{name}.cron
 Patch1:                %{name}-man.patch
 Patch2:                tabooext.patch
 URL:           https://fedorahosted.org/logrotate/
@@ -111,7 +111,6 @@ Logrotate призначений для полегшення адміністр
 
 %prep
 %setup -q
-%patch0 -p1
 %patch1 -p1
 %patch2 -p1
 
@@ -137,8 +136,8 @@ install -d $RPM_BUILD_ROOT/etc/{cron.daily,logrotate.d,sysconfig} \
        MANDIR=$RPM_BUILD_ROOT%{_mandir}
 
 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.conf
-cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/logrotate
-install -p examples/logrotate.cron $RPM_BUILD_ROOT/etc/cron.daily/logrotate
+cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/logrotate
+install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.daily/logrotate
 > $RPM_BUILD_ROOT%{statdir}/logrotate.status
 
 %clean
This page took 0.048278 seconds and 4 git commands to generate.