+/* In this procedure, we check if the current fileset is using
+ * FileSet-> Include-> Options-> Accurate/Verify/BaseJob=checksum
+ */
+static bool is_checksum_needed_by_fileset(JCR *jcr)
+{
+ FILESET *f;
+ INCEXE *inc;
+ FOPTS *fopts;
+ bool in_block=false;
+ if (!jcr->job || !jcr->job->fileset) {
+ return false;
+ }
+
+ f = jcr->job->fileset;
+
+ for (int i=0; i < f->num_includes; i++) {
+ inc = f->include_items[i];
+
+ for (int j=0; j < inc->num_opts; j++) {
+ fopts = inc->opts_list[j];
+
+ for (char *k=fopts->opts; *k ; k++) {
+ switch (*k) {
+ case 'V': /* verify */
+ in_block = (jcr->get_JobType() == JT_VERIFY);
+ break;
+ case 'J': /* Basejob */
+ in_block = (jcr->get_JobLevel() == L_FULL);
+ break;
+ case 'C': /* Accurate */
+ in_block = (jcr->get_JobLevel() != L_FULL);
+ break;
+ case ':':
+ in_block = false;
+ break;
+ case '5': /* MD5 */
+ case '1': /* SHA1 */
+ if (in_block) {
+ return true;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+ return false;
+}
+