From ec7eb240abd60e667d1a26f89df1b064e1b3786d Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 9 Jan 2008 10:58:13 +0000 Subject: [PATCH] Re-enable the new job code editing (%f). git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@6262 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/ChangeLog | 5 +++++ bacula/ReleaseNotes | 5 ++++- bacula/src/dird/dird_conf.c | 6 +++--- bacula/src/dird/protos.h | 2 +- bacula/src/lib/protos.h | 5 +++-- bacula/src/lib/runscript.c | 2 +- bacula/src/lib/util.c | 9 ++++----- bacula/src/version.h | 4 ++-- bacula/technotes-2.1 | 4 +++- 9 files changed, 26 insertions(+), 16 deletions(-) diff --git a/bacula/ChangeLog b/bacula/ChangeLog index 3fdad8db5f..db1a0d212a 100644 --- a/bacula/ChangeLog +++ b/bacula/ChangeLog @@ -1,6 +1,11 @@ Technical notes on version 2.2.x General: +09Jan08 +kes Re-enable the new job code editing (%f). +08Jan08 +kes Fix bsnprintf for float point numbers. I broke recently when + parameterizing some variables. 03Jan08 kes Move Heartbeat documentation from Job to Director resource. This fixes bug #1033. diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index 908c6f5bfc..ce74af6a01 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -1,5 +1,5 @@ - Release Notes for Bacula 2.2.7 + Release Notes for Bacula 2.2.8 Bacula code: Total files = 520 Total lines = 195,550 (*.h *.c *.in) 82 new files, 41,221 new lines of code, 208,380 lines of change from 2.0.3 @@ -10,6 +10,9 @@ use some of the new features that affect the FD. In other words, you should not have to upgrade all your File daemons when you upgrade. There is no database upgrade needed from version 2.0.x to 2.2.0. +Version 2.2.8 is a bug fix to version 2.2.7: +- It fixes bugs: 1036, 1033(doc), 1018, and 1028. + Version 2.2.7 has several new features and several important bug fixes since version 2.2.6: - It fixes bugs: 1009, 1022, 1024, 1019, 1012, 1021, 1020 diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index 107ed51b82..77c74c73c0 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -1732,7 +1732,7 @@ static void store_short_runscript(LEX *lc, RES_ITEM *item, int index, int pass) if (pass == 2) { RUNSCRIPT *script = new_runscript(); -// script->set_job_code_callback(job_code_callback_filesetname); + script->set_job_code_callback(job_code_callback_filesetname); script->set_command(lc->str); @@ -1873,7 +1873,7 @@ static void store_runscript(LEX *lc, RES_ITEM *item, int index, int pass) RUNSCRIPT *script = new_runscript(); memcpy(script, &res_runscript, sizeof(RUNSCRIPT)); -// script->set_job_code_callback(job_code_callback_filesetname); + script->set_job_code_callback(job_code_callback_filesetname); if (*runscripts == NULL) { *runscripts = New(alist(10, not_owned_by_alist)); @@ -1888,7 +1888,7 @@ static void store_runscript(LEX *lc, RES_ITEM *item, int index, int pass) } /* callback function for edit_job_codes */ -char *job_code_callback_filesetname(JCR *jcr, const char* param) +extern "C" char *job_code_callback_filesetname(JCR *jcr, const char* param) { if (param[0] == 'f') { return jcr->fileset->name(); diff --git a/bacula/src/dird/protos.h b/bacula/src/dird/protos.h index 482ee7f870..5eeed6e93b 100644 --- a/bacula/src/dird/protos.h +++ b/bacula/src/dird/protos.h @@ -75,7 +75,7 @@ extern void catalog_update(JCR *jcr, BSOCK *bs); /* dird_conf.c */ extern const char *level_to_str(int level); -extern char *job_code_callback_filesetname(JCR *jcr, const char*); +extern "C" char *job_code_callback_filesetname(JCR *jcr, const char*); /* expand.c */ int variable_expansion(JCR *jcr, char *inp, POOLMEM **exp); diff --git a/bacula/src/lib/protos.h b/bacula/src/lib/protos.h index 8aac41a3b1..ff511f541d 100644 --- a/bacula/src/lib/protos.h +++ b/bacula/src/lib/protos.h @@ -302,7 +302,9 @@ bool get_tls_enable (TLS_CONTEXT *ctx); /* util.c */ +extern "C"{ typedef char *(*job_code_callback_t)(JCR *, const char *); +} bool is_buf_zero (char *buf, int len); void lcase (char *str); @@ -320,8 +322,7 @@ const char * job_type_to_str (int type); const char * job_status_to_str (int stat); const char * job_level_to_str (int level); void make_session_key (char *key, char *seed, int mode); -//POOLMEM * edit_job_codes (JCR *jcr, char *omsg, char *imsg, const char *to, job_code_callback_t job_code_callback = NULL); -POOLMEM * edit_job_codes (JCR *jcr, char *omsg, char *imsg, const char *to); +POOLMEM * edit_job_codes (JCR *jcr, char *omsg, char *imsg, const char *to, job_code_callback_t job_code_callback = NULL); void set_working_directory (char *wd); const char * last_path_separator (const char *str); diff --git a/bacula/src/lib/runscript.c b/bacula/src/lib/runscript.c index ea7e71bd9f..774753ffc6 100644 --- a/bacula/src/lib/runscript.c +++ b/bacula/src/lib/runscript.c @@ -208,7 +208,7 @@ bool RUNSCRIPT::run(JCR *jcr, const char *name) BPIPE *bpipe; char line[MAXSTRING]; -// ecmd = edit_job_codes(jcr, ecmd, this->command, "", this->job_code_callback); + ecmd = edit_job_codes(jcr, ecmd, this->command, "", this->job_code_callback); ecmd = edit_job_codes(jcr, ecmd, this->command, ""); Dmsg1(100, "runscript: running '%s'...\n", ecmd); Jmsg(jcr, M_INFO, 0, _("%s: run command \"%s\"\n"), name, ecmd); diff --git a/bacula/src/lib/util.c b/bacula/src/lib/util.c index e05f55c86d..54f96f16fd 100644 --- a/bacula/src/lib/util.c +++ b/bacula/src/lib/util.c @@ -574,8 +574,7 @@ void make_session_key(char *key, char *seed, int mode) * to = recepients list * */ -//POOLMEM *edit_job_codes(JCR *jcr, char *omsg, char *imsg, const char *to, job_code_callback_t callback) -POOLMEM *edit_job_codes(JCR *jcr, char *omsg, char *imsg, const char *to) +POOLMEM *edit_job_codes(JCR *jcr, char *omsg, char *imsg, const char *to, job_code_callback_t callback) { char *p, *q; const char *str; @@ -674,9 +673,9 @@ POOLMEM *edit_job_codes(JCR *jcr, char *omsg, char *imsg, const char *to) break; default: str = NULL; -// if (callback != NULL) { -// str = callback(jcr, p); -// } + if (callback != NULL) { + str = callback(jcr, p); + } if (!str) { add[0] = '%'; diff --git a/bacula/src/version.h b/bacula/src/version.h index 5c0bb5b240..41350b2b69 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.2.8" -#define BDATE "04 January 2008" -#define LSMDATE "04Jan08" +#define BDATE "08 January 2008" +#define LSMDATE "08Jan08" #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n" #define BYEAR "2008" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index d18efb836e..07e05d918a 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -1,9 +1,11 @@ Technical notes on version 2.2 General: +09Jan08 +kes Re-enable the new job code editing (%f). 08Jan08 kes Fix bsnprintf for float point numbers. I broke recently when - parameterizing some variables. + parameterizing some variables. This fixes bug #1036. 03Jan08 kes Move Heartbeat documentation from Job to Director resource. This fixes bug #1033. -- 2.39.5