]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/dvd+rw-tools-5.21.4.10.8.bacula.patch
Update spec copyrights
[bacula/bacula] / bacula / patches / dvd+rw-tools-5.21.4.10.8.bacula.patch
1 diff -u dvd+rw-tools-5.21.4.10.8/growisofs.c dvd+rw-tools-5.22/growisofs.c
2 --- dvd+rw-tools-5.21.4.10.8/growisofs.c        2004-08-25 01:02:29.000000000 +0200
3 +++ dvd+rw-tools-5.22/growisofs.c       2005-10-16 22:48:02.000000000 +0200
4 @@ -315,12 +315,17 @@
5   * - Linux: fix for kernel version 2.6>=8, 2.6.8 itself is deficient,
6   *   but the problem can be worked around by installing this version
7   *   set-root-uid;
8 + * 5.22: (by Nicolas Boichat, Bacula project)
9 + * - Allow session to cross 4GB boundary regardless of medium type
10 + *   (don't need to have a DL media)
11 + * - Add a -F option (used instead of -M or -Z), which displays next_session
12 + *   offset and capacity (free space = next_session - capacity).
13   */
14  #define PRINT_VERSION(cmd)     do {                    \
15      char *s=strrchr((cmd),'/');                                \
16      s ? s++ : (s=(cmd));                               \
17      printf ("* %.*sgrowisofs by <appro@fy.chalmers.se>,"\
18 -           " version 5.21,\n",(int)(s-(cmd)),(cmd));   \
19 +           " version 5.22,\n",(int)(s-(cmd)),(cmd));   \
20  } while (0)
21  
22  #define _LARGEFILE_SOURCE 
23 @@ -1720,6 +1725,18 @@
24                 else          in_device = argv[++i];
25                 dev_found = 'Z';
26             }
27 +           else if (argv[i][1] == 'F')
28 +           {   if (len > 2) in_device = argv[i]+2;
29 +               else         in_device = argv[++i];
30 +               dev_found = 'F';
31 +               dry_run = 1; /* NEVER write anything with -F */
32 +           }
33 +           else if (!strncmp(opt,"-free-space",11))
34 +           {   if (len > 11) in_device = opt+11;
35 +               else          in_device = argv[++i];
36 +               dev_found = 'F';
37 +               dry_run = 1; /* NEVER write anything with -F */
38 +           }
39             else if (!strcmp(opt,"-poor-man"))
40             {   if (poor_man<0) poor_man = 1;
41                 continue;
42 @@ -1908,7 +1925,9 @@
43                 fprintf (stderr,"    you most likely want to use -Z option.\n"), 
44                 exit (FATAL_START(errno));
45  
46 -           if (dev_found == 'M')
47 +           if ((dev_found == 'M') || 
48 +                       ((dev_found == 'F') && !(mmc_profile&0x10000)) && (the_buffer[0] || the_buffer[1] || the_buffer[2]))
49 +                               /* -F : The medium is not blank, there is a fs on it (the_buffer[0,1 or 2] != 0), so compute next_session. */
50             {   if (memcmp (the_buffer,"\1CD001",6))
51                     fprintf (stderr,":-( %s doesn't look like isofs...\n",
52                                 in_device), exit(FATAL_START(EMEDIUMTYPE));
53 @@ -1932,7 +1951,7 @@
54                         exit(FATAL_START(EINVAL));
55                 }
56                 else if (next_session > (0x200000-0x5000)) /* 4GB/2K-40MB/2K */
57 -                   if ((mmc_profile&0xFFFF)!=0x2B || !no_4gb_check)
58 +                   if (!no_4gb_check)
59                         fprintf (stderr,":-( next session would cross 4GB "
60                                         "boundary, aborting...\n"),
61                         exit (FATAL_START(ENOSPC));
62 @@ -1974,7 +1993,7 @@
63         exit (FATAL_START(EINVAL));
64  
65      if (imgfd<0)
66 -    {  if (mkisofs_argc==1)
67 +    {  if ((mkisofs_argc==1) && (dev_found != 'F'))
68             fprintf (stderr,"%s: no mkisofs options specified, "
69                             "aborting...\n",argv[0]),
70             exit (FATAL_START(EINVAL));
71 @@ -2114,6 +2133,15 @@
72         }
73      }
74  
75 +       if (dev_found == 'F') {
76 +               off64_t capacity = 0;
77 +               printf("next_session=%lld\n", next_session*CD_BLOCK);
78 +               if (ioctl_handle!=INVALID_HANDLE)
79 +                       capacity = get_capacity (ioctl_handle);
80 +               printf("capacity=%lld\n", capacity);
81 +               exit(0);
82 +       }
83 +
84      if (imgfd>=0)
85      {  quiet--;
86         if (builtin_dd (imgfd,out_fd,next_session*CD_BLOCK) < 0)