freebsd-ports/sysutils/bacula/files/patch-weekofmonth
Lars Koeller 47e504a16d o) Fix a bug concerning the creation of /var/db/bacula and chmod
in pkg-install in pre-install phase (wrong order).
o) Add/delete lines for file, storage and director ports in /etc/services
o) Add bacula patches concerning EOM handling, choosing the next volume, and
   calculating weekofmonth
2004-01-12 19:56:23 +00:00

62 lines
1.8 KiB
Text

This patch fixes an incorrect calculation of the week
of the month reported by Volker Sauer. It should work on either
1.32e or 1.32f.
Apply the patch with:
cd <bacula-source>
patch -p0 <1.32f-weekofmonth.patch
make
...
Index: src/dird/scheduler.c
===================================================================
RCS file: /cvsroot/bacula/bacula/src/dird/scheduler.c,v
retrieving revision 1.13.6.1
diff -u -b -r1.13.6.1 scheduler.c
--- src/dird/scheduler.c 21 Dec 2003 15:17:42 -0000 1.13.6.1
+++ src/dird/scheduler.c 6 Jan 2004 09:43:31 -0000
@@ -205,7 +205,7 @@
mday = tm.tm_mday - 1;
wday = tm.tm_wday;
month = tm.tm_mon;
- wom = tm_wom(tm.tm_mday, tm.tm_wday); /* get week of month */
+ wom = mday / 7;
woy = tm_woy(now); /* get week of year */
/* Loop through all jobs */
@@ -237,7 +237,7 @@
if (bit_is_set(next_hour, run->hour)) {
tm.tm_hour++;
if (tm.tm_hour > 23) {
- tm.tm_hour = 0;
+ continue; /* next day */
}
runtime = mktime(&tm);
add_job(job, run, now, runtime);
Index: src/dird/ua_output.c
===================================================================
RCS file: /cvsroot/bacula/bacula/src/dird/ua_output.c,v
retrieving revision 1.25.2.11.2.3
diff -u -b -r1.25.2.11.2.3 ua_output.c
--- src/dird/ua_output.c 21 Dec 2003 15:17:42 -0000 1.25.2.11.2.3
+++ src/dird/ua_output.c 6 Jan 2004 09:43:32 -0000
@@ -454,7 +454,7 @@
mday = tm.tm_mday - 1;
wday = tm.tm_wday;
month = tm.tm_mon;
- wom = tm_wom(tm.tm_mday, tm.tm_wday);
+ wom = mday / 7;
woy = tm_woy(now);
/* Break down tomorrow into components */
@@ -463,7 +463,7 @@
tmday = tm.tm_mday - 1;
twday = tm.tm_wday;
tmonth = tm.tm_mon;
- twom = tm_wom(tm.tm_mday, tm.tm_wday);
+ twom = tmday / 7;
twoy = tm_woy(tomorrow);
if (run == NULL) {