-2003-10-09 Version 1.32b 08Oct03 Release
+2003-10-10 Version 1.32b 10Oct03 Release
+10Oct03
+- When pruning, select only old orphanned jobs to delete so that
+  the current job is not pruned too.
+09Oct03
+- Corrected return status for bsf_dev and bsr_dev in block.c and btape.c
+- dev.c used incorrect ruturn status for bsf_dev in the BSF at EOM
+  code. This caused all appends on FreeBSD to fail.
+- Turn on fast block rejection code.
+08Oct03
+- Optimize file index searches by adding a count to the bootstrap.
+- Write single files/blocks to bootstrap without the second part.
+- Add current Volume status to the cannot use this Volume message.
+- Zero the rx->bsr in ua_restore when freeing so it doesn't get
+  freed twice.
+- Lots of testing on the restore
 - I noticed that SD and FD bootstrap files were not always
   deleted, so delete them as soon as possible.
 - Restore by file (or by selecting files) created some
 
 
-          Release Notes for Bacula 1.32a
+          Release Notes for Bacula 1.32b
 
-  Bacula code: Total files = 259 Total lines = 77,873 (*.h *.c *.in)
+  Bacula code: Total files = 259 Total lines = 77,984 (*.h *.c *.in)
 
-Major Changes this Release:
+Changes since 1.32a:
+- Improve forward space file/block during restore, many
+  optimizations.
+- Fix a bug that did not allow appending to a tape    
+  on FreeBSD systems.
+  
+
+Major Changes 1.32a Release:
 - Implemented forward space file/block whenever possible 
   during restore. Restoring a small number of files is now  
   much faster.
   resource.
 
 
-Other Changes this Release:
+Other Changes 1.32a Release:
 - Fixed sparse file bug.
 - A warning message is sent when a job starts that will be
   blocked because the user did an "unmount".
 
 - Figure out how to use ssh or stunnel to protect Bacula communications.
 
 For 1.33 Testing/Documentation:
+- bextract is sending everything to the log file ****FIXME****
 - Document to start higher priorty jobs before lower ones.
 - suppress "Do not forget to mount the drive!!!" if error
 - Document new records in Director. SDAddress SDDeviceName, SDPassword.
 
 /* Select Jobs from the DelCandidates table that have a
  * more recent backup -- i.e. are not the only backup.
  * This is the list of Jobs to delete for a Backup Job.
+ * At the same time, we select "orphanned" jobs
+ * (i.e. no files, ...) for deletion.
  */
 char *select_backup_del =
    "SELECT DelCandidates.JobId "
    "FROM Job,DelCandidates "
-   "WHERE (DelCandidates.JobFiles=0) OR "
-   "(DelCandidates.JobStatus!='T') OR "
+   "WHERE (JobTDate<%s AND ((DelCandidates.JobFiles=0) OR "
+   "(DelCandidates.JobStatus!='T'))) OR "
    "(Job.JobTDate>%s "
    "AND Job.ClientId=%u "
    "AND Job.Type='B' "
 
 
    del.JobId = (JobId_t *)malloc(sizeof(JobId_t) * del.max_ids);
 
-   /* Now process same set but making delete list */
+   /* Now process same set but making a delete list */
    db_sql_query(ua->db, query, file_delete_handler, (void *)&del);
 
    for (i=0; i < del.num_ids; i++) {
        * Now mark Job as having files purged. This is necessary to
        * avoid having too many Jobs to process in future prunings. If
        * we don't do this, the number of JobId's in our in memory list
-       * will grow very large.
+       * could grow very large.
        */
       Mmsg(&query, upd_Purged, del.JobId[i]);
       db_sql_query(ua->db, query, NULL, (void *)NULL);
    switch (JobType) {
    case JT_ADMIN:
    case JT_BACKUP:
-      Mmsg(&query, select_backup_del, ed1, cr.ClientId);
+      Mmsg(&query, select_backup_del, ed1, ed1, cr.ClientId);
       break;
    case JT_RESTORE:
       Mmsg(&query, select_restore_del, ed1, cr.ClientId);
 
 #undef  VERSION
 #define VERSION "1.32b"
 #define VSTRING "1"
-#define BDATE   "09 Oct 2003"
-#define LSMDATE "09Oct03"
+#define BDATE   "10 Oct 2003"
+#define LSMDATE "10Oct03"
 
 /* Debug flags */
 #undef  DEBUG