]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/1.36.0/1.36.0-verify-2.patch
Fix scripts/bacula.in to have awk on an environment variable
[bacula/bacula] / bacula / patches / 1.36.0 / 1.36.0-verify-2.patch
1
2  This patch fixes the calculation for the total number of files
3  to be restored or verified by not double counting files that are
4  split across a tape file or across tapes.
5
6  To apply this patch, you must first have applied 1.36.0-verify.patch.
7
8  Apply it with:
9
10  cd <bacula-source>
11  patch -p0 <1.36.0-verify-2.patch
12  make
13  make install
14  ...
15
16 Index: src/dird/bsr.c
17 ===================================================================
18 RCS file: /cvsroot/bacula/bacula/src/dird/bsr.c,v
19 retrieving revision 1.16
20 diff -u -r1.16 bsr.c
21 --- src/dird/bsr.c      29 Oct 2004 22:11:43 -0000      1.16
22 +++ src/dird/bsr.c      4 Nov 2004 10:37:37 -0000
23 @@ -238,6 +238,8 @@
24  {
25     uint32_t count = 0;
26     uint32_t total_count = 0; 
27 +   uint32_t LastIndex = 0;
28 +   bool first = true;
29     if (bsr) {
30        /*
31         * For a given volume, loop over all the JobMedia records.
32 @@ -273,6 +275,15 @@
33              fprintf(fd, "Count=%u\n", count);
34          }
35          total_count += count;
36 +        /* If the same file is present on two tapes or in two files
37 +         *   on a tape, it is a continuation, and should not be treated
38 +         *   twice in the totals.
39 +         */
40 +        if (!first && LastIndex == bsr->VolParams[i].FirstIndex) {
41 +           total_count--;
42 +        }
43 +        first = false;
44 +        LastIndex = bsr->VolParams[i].LastIndex;
45        }
46        write_bsr(ua, bsr->next, fd);
47     }