Update of /cvsroot/fink/dists/10.4/unstable/main/finkinfo/base
In directory sc8-pr-cvs17:/tmp/cvs-serv26243

Modified Files:
        anacron.info anacron.patch 
Log Message:
new version which copes with a missing /etc/crontab


Index: anacron.info
===================================================================
RCS file: /cvsroot/fink/dists/10.4/unstable/main/finkinfo/base/anacron.info,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- anacron.info        12 Jan 2007 19:13:22 -0000      1.4
+++ anacron.info        1 Sep 2007 16:28:56 -0000       1.5
@@ -1,6 +1,6 @@
 Package: anacron
 Version: 2.3
-Revision: 5
+Revision: 6
 Description: Periodic command scheduler
 License: GPL
 Maintainer: Christian Swinehart <[EMAIL PROTECTED]>
@@ -12,7 +12,7 @@
 Source-MD5: 865cc1dfe1ed75c470d3e6de13763f03
 SetCPPFLAGS: -I.
 PatchFile: %n.patch
-PatchFile-MD5: e727f1098c9def6052550aa1fa9fe7bf
+PatchFile-MD5: e0c44f5e3f2a5d049995a406be9b9f91
 PatchScript: sed 's|@PREFIX@|%p|g' < %{PatchFile} | patch -p1
 CompileScript: make PREFIX=%p
 InstallScript: <<
@@ -48,8 +48,10 @@
 PreRmScript: <<
  if [ $1 != "upgrade" ]; then
    daemonic remove anacron
-   cat /etc/crontab | grep -v "%p/sbin/anacron" > /etc/a_very_temporary_crontab
-   mv /etc/a_very_temporary_crontab /etc/crontab
+   if [ -f "/etc/crontab" ]; then
+     cat /etc/crontab | grep -v "%p/sbin/anacron" > 
/etc/a_very_temporary_crontab
+     mv /etc/a_very_temporary_crontab /etc/crontab
+   fi
    rm -f %p/var/spool/anacron/*
  fi
 <<

Index: anacron.patch
===================================================================
RCS file: /cvsroot/fink/dists/10.4/unstable/main/finkinfo/base/anacron.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- anacron.patch       16 Dec 2006 19:17:33 -0000      1.2
+++ anacron.patch       1 Sep 2007 16:28:56 -0000       1.3
@@ -1546,7 +1546,7 @@
 diff -Nurd -x'*~' anacron-2.3.orig/update-anacron anacron-2.3/update-anacron
 --- anacron-2.3.orig/update-anacron    1969-12-31 19:00:00.000000000 -0500
 +++ anacron-2.3/update-anacron 2005-12-01 12:55:39.000000000 -0500
-@@ -0,0 +1,105 @@
+@@ -0,0 +1,113 @@
 +#!/bin/sh
 +#
 +# Add anacron to the system's crontab (so anacron will be run automatically)
@@ -1604,6 +1604,10 @@
 +fi
 +
 +# Check whether the system crontab already contains an entry for anacron
++PARSE_CRONTAB=""
++if [ -f "/etc/crontab" ]; then
++    PARSE_CRONTAB=`grep $PREFIX/sbin/anacron /etc/crontab | grep -v "^#"`
++fi
 +PARSE_CRONTAB=`grep $PREFIX/sbin/anacron /etc/crontab | grep -v "^#"`
 +if [ -z "$PARSE_CRONTAB" ]; then
 +    echo "Anacron is not currently set up to be run periodically by cron."
@@ -1613,6 +1617,10 @@
 +
 +    answer=`echo $answer | sed 's/^[yY].*$/y/'`
 +    if [ -z "$answer" -o "x$answer" = "xy" ]; then
++      if [ ! -f "/etc/crontab" ]; then
++          touch /etc/crontab
++          echo "" >> /etc/crontab
++      fi          
 +      # Add anacron to /etc/crontab
 +      echo "10      *       *       *       *       root    
$PREFIX/sbin/anacron -s" >> /etc/crontab
 +      daemonic enable anacron


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Fink-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to