From 1e3bf2b5aa06ef4b41bf31facbaeafc7d874c1a0 Mon Sep 17 00:00:00 2001 From: naddy Date: Mon, 17 May 2004 00:22:54 +0000 Subject: [PATCH] - 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 --- sysutils/anacron/Makefile | 4 +-- sysutils/anacron/files/obstack.c | 2 ++ sysutils/anacron/patches/patch-gregor_c | 12 +++++++++ sysutils/anacron/patches/patch-log_c | 11 +++++++++ sysutils/anacron/patches/patch-main_c | 33 +++++++++++++++++++++++++ sysutils/anacron/patches/patch-runjob_c | 14 +++++++---- sysutils/anacron/pkg/INSTALL | 18 ++++++-------- 7 files changed, 76 insertions(+), 18 deletions(-) create mode 100644 sysutils/anacron/patches/patch-gregor_c create mode 100644 sysutils/anacron/patches/patch-log_c create mode 100644 sysutils/anacron/patches/patch-main_c diff --git a/sysutils/anacron/Makefile b/sysutils/anacron/Makefile index 52e00bc6fcb..f2114f26b2c 100644 --- a/sysutils/anacron/Makefile +++ b/sysutils/anacron/Makefile @@ -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 diff --git a/sysutils/anacron/files/obstack.c b/sysutils/anacron/files/obstack.c index 0d4a4c88949..b49478ac2fa 100644 --- a/sysutils/anacron/files/obstack.c +++ b/sysutils/anacron/files/obstack.c @@ -24,6 +24,8 @@ #include #endif +#include + #include "obstack.h" /* NOTE BEFORE MODIFYING THIS FILE: This version number must be diff --git a/sysutils/anacron/patches/patch-gregor_c b/sysutils/anacron/patches/patch-gregor_c new file mode 100644 index 00000000000..a180458e900 --- /dev/null +++ b/sysutils/anacron/patches/patch-gregor_c @@ -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 */ + diff --git a/sysutils/anacron/patches/patch-log_c b/sysutils/anacron/patches/patch-log_c new file mode 100644 index 00000000000..1e846351756 --- /dev/null +++ b/sysutils/anacron/patches/patch-log_c @@ -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 + #include + #include ++#include + #include + #include + #include diff --git a/sysutils/anacron/patches/patch-main_c b/sysutils/anacron/patches/patch-main_c new file mode 100644 index 00000000000..86feeaa9cee --- /dev/null +++ b/sysutils/anacron/patches/patch-main_c @@ -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 + #include ++#include + #include + #include + #include +@@ -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"); + } + diff --git a/sysutils/anacron/patches/patch-runjob_c b/sysutils/anacron/patches/patch-runjob_c index 500f5913235..b9c1a32cf4d 100644 --- a/sysutils/anacron/patches/patch-runjob_c +++ b/sysutils/anacron/patches/patch-runjob_c @@ -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 #include #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; diff --git a/sysutils/anacron/pkg/INSTALL b/sysutils/anacron/pkg/INSTALL index 311bbc8cbff..799897e2aa3 100644 --- a/sysutils/anacron/pkg/INSTALL +++ b/sysutils/anacron/pkg/INSTALL @@ -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 <&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