- Don't leave files behind in /tmp.

- Fix a number of compiler warnings.
- Clean INSTALL a bit.
- Point HOMEPAGE to a more useful place.

From: Andreas Kahari <ak+openbsd@freeshell.org>
This commit is contained in:
naddy 2004-05-17 00:22:54 +00:00
parent 409857a1be
commit 1e3bf2b5aa
7 changed files with 76 additions and 18 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.2 2003/08/27 07:25:35 sturm Exp $
# $OpenBSD: Makefile,v 1.3 2004/05/17 00:22:54 naddy Exp $
COMMENT= "periodic command scheduler"
DISTNAME= anacron-2.3
CATEGORIES= sysutils
HOMEPAGE= http://anacron.sourceforge.net/
HOMEPAGE= http://sourceforge.net/projects/anacron/
MAINTAINER= Andreas Kahari <andreas.kahari@unix.net>

View File

@ -24,6 +24,8 @@
#include <config.h>
#endif
#include <stdlib.h>
#include "obstack.h"
/* NOTE BEFORE MODIFYING THIS FILE: This version number must be

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-gregor_c,v 1.1 2004/05/17 00:22:54 naddy Exp $
--- gregor.c.orig 2004-05-12 21:20:47.000000000 +0100
+++ gregor.c 2004-05-12 21:21:45.000000000 +0100
@@ -65,7 +65,7 @@ day_num(int year, int month, int day)
{
int dn;
int i;
- const int isleap; /* save three calls to leap() */
+ int isleap; /* save three calls to leap() */
/* Some validity checks */

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-log_c,v 1.1 2004/05/17 00:22:54 naddy Exp $
--- log.c.orig 2004-05-12 21:19:53.000000000 +0100
+++ log.c 2004-05-12 21:20:21.000000000 +0100
@@ -37,6 +37,7 @@
#include <unistd.h>
#include <syslog.h>
#include <stdio.h>
+#include <stdlib.h>
#include <stdarg.h>
#include <errno.h>
#include <signal.h>

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-main_c,v 1.1 2004/05/17 00:22:54 naddy Exp $
--- main.c.orig 2004-05-12 21:16:27.000000000 +0100
+++ main.c 2004-05-12 21:18:40.000000000 +0100
@@ -24,6 +24,7 @@
#include <time.h>
#include <stdio.h>
+#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
@@ -72,8 +73,8 @@ print_usage()
printf("Usage: anacron [-s] [-f] [-n] [-d] [-q] [-t anacrontab] [job] ...\n"
" anacron -u [job] ...\n"
" anacron [-V|-h]\n"
- "\n"
- " -s Serialize execution of jobs\n"
+ "\n");
+ printf(" -s Serialize execution of jobs\n"
" -f Force execution of jobs, even before their time\n"
" -n Run jobs with no delay, implies -s\n"
" -d Don't fork to the background\n"
@@ -82,8 +83,8 @@ print_usage()
" -t Use this anacrontab\n"
" -V Print version information\n"
" -h Print this message\n"
- "\n"
- "See the manpage for more details.\n"
+ "\n");
+ printf("See the manpage for more details.\n"
"\n");
}

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-runjob_c,v 1.2 2003/08/23 21:58:46 sturm Exp $
--- runjob.c.orig 2000-06-21 01:11:56.000000000 +0200
+++ runjob.c 2003-08-23 23:52:52.000000000 +0200
@@ -34,11 +34,34 @@
$OpenBSD: patch-runjob_c,v 1.3 2004/05/17 00:22:54 naddy Exp $
--- runjob.c.orig 2000-06-21 00:12:18.000000000 +0100
+++ runjob.c 2004-05-12 20:50:11.000000000 +0100
@@ -34,11 +34,38 @@
#include <stdio.h>
#include <string.h>
#include "global.h"
@ -30,13 +30,17 @@ $OpenBSD: patch-runjob_c,v 1.2 2003/08/23 21:58:46 sturm Exp $
+ if ((fd = mkstemp(template)) == -1) {
+ die_e("Could not create temporary file.");
+ }
+ if (unlink(template) == -1) {
+ complain("Tried to unlink temporary file '%s' but failed.",
+ template);
+ }
+ return fd;
+
+#if 0
const int max_retries = 50;
char *name;
int fd, i;
@@ -61,6 +84,7 @@ temp_file()
@@ -61,6 +88,7 @@ temp_file()
free(name);
fcntl(fd, F_SETFD, 1); /* set close-on-exec flag */
return fd;

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $OpenBSD: INSTALL,v 1.1.1.1 2003/08/23 19:24:50 sturm Exp $
# $OpenBSD: INSTALL,v 1.2 2004/05/17 00:22:54 naddy Exp $
#
# Pre/post-installation setup of anacron
@ -21,8 +21,6 @@ do_spooldir()
#
do_notice()
{
# Text take from the README file of the anacron-2.3
# distribution.
cat <<EOT
+----------
| To start using anacron:
@ -38,16 +36,16 @@ do_notice()
| SHELL=/bin/sh
| PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
| # format: period delay job-identifier command
| 1 5 cron.daily sh /etc/daily 2>&1 | tee /var/log/daily.out | mail -s "\`hostname\` daily output" root
| 7 10 cron.weekly sh /etc/weekly 2>&1 | tee /var/log/weekly.out | mail -s "\`hostname\` weekly output" root
| 30 15 cron.monthly sh /etc/monthly 2>&1 | tee /var/log/monthly.out | mail -s "\`hostname\` monthly output" root
| 1 5 cron.daily sh /etc/daily 2>&1 | tee /var/log/daily.out
| 7 10 cron.weekly sh /etc/weekly 2>&1 | tee /var/log/weekly.out
| 30 15 cron.monthly sh /etc/monthly 2>&1 | tee /var/log/monthly.out
| -----Cut
|
| Comment the invocation of these jobs in root's crontab.
| Comment out the invocation of these jobs in root's crontab.
|
| Invoke anacron from /etc/rc.local like this:
|
| if [ X"\${anacron}" == X"YES" -a -x ${PREFIX}/sbin/anacron -a -f ${SYSCONFDIR}/anacrontab ]; then
| if [ X"\${anacron}" == X"YES" -a -x ${PREFIX}/sbin/anacron ]; then
| echo -n ' anacron'
| ${PREFIX}/sbin/anacron -s
| fi
@ -55,9 +53,7 @@ do_notice()
| (and add "anacron=YES" to /etc/rc.conf.local)
|
| If your machine is left running for more than 24h at a time, you
| might also want to invoke anacron from a nightly cron job.
|
| That's it.
| might also want to invoke anacron from an early morning cron job.
+----------
EOT