]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Make two separate Win32 menu links for starting bconsole and
authorKern Sibbald <kern@sibbald.com>
Fri, 8 Sep 2006 12:19:52 +0000 (12:19 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 8 Sep 2006 12:19:52 +0000 (12:19 +0000)
     wx-console in winbacula.nsi
kes  Apply DVD part_spooled patch from Richard Mortimer
     richm@oldelvet.org.uk

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3438 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/stored/dev.c
bacula/src/stored/dev.h
bacula/src/stored/dvd.c
bacula/src/win32/installer/winbacula.nsi
bacula/technotes-1.39

index b52f92353b737bf546032657e18082c4e7ece6e8..a4dc8477339001af4280534e89e1f5f05008078f 100644 (file)
@@ -582,9 +582,11 @@ void DEVICE::open_dvd_device(DCR *dcr, int omode)
    if (part <= num_dvd_parts) {
       omode = OPEN_READ_ONLY;
       make_mounted_dvd_filename(this, archive_name);
+      set_part_spooled(false);
    } else {
       omode = OPEN_READ_WRITE;
       make_spooled_dvd_filename(this, archive_name);
+      set_part_spooled(true);
    }
    set_mode(omode);
 
@@ -1778,7 +1780,7 @@ void DEVICE::close()
    /* Remove the last part file if it is empty */
    if (num_dvd_parts > 0) {
       struct stat statp;
-      int part_save = part;
+      uint32_t part_save = part;
       POOL_MEM archive_name(PM_FNAME);
       int status;
 
@@ -1791,9 +1793,13 @@ void DEVICE::close()
                 part, num_dvd_parts, VolCatInfo.VolCatName);
          Dmsg1(100, "unlink(%s)\n", archive_name.c_str());
          unlink(archive_name.c_str());
-         set_part_spooled(false);        /* no spooled part left */
+         if (part_save == part) {
+           set_part_spooled(false);        /* no spooled part left */
+         }
       } else if (status < 0) {                         
-         set_part_spooled(false);        /* spool doesn't exit */
+         if (part_save == part) {
+           set_part_spooled(false);        /* spool doesn't exit */
+         }
       }       
       part = part_save;               /* restore part number */
    }
index 3781e7c63b20343040fd8284ea45cb0111f8d8f7..a7b775a3ad444e39eeb1075b8e68a033f8de1eb6 100644 (file)
@@ -324,7 +324,8 @@ public:
    void set_short_block() { state |= ST_SHORT; };
    void set_freespace_ok() { state |= ST_FREESPACE_OK; }
    void set_part_spooled(int val) { if (val) state |= ST_PART_SPOOLED; \
-          else state &= ~ST_PART_SPOOLED; };
+          else state &= ~ST_PART_SPOOLED;
+   };
    void set_mounted(int val) { if (val) state |= ST_MOUNTED; \
           else state &= ~ST_MOUNTED; };
    void clear_append() { state &= ~ST_APPEND; };
index bcd360c6c95d1339d081b58b1a6e07a1273ce1f7..3178758b5753c5e318b1aca8ae4ca6bd42b3df28 100644 (file)
@@ -36,7 +36,6 @@ void make_mounted_dvd_filename(DEVICE *dev, POOL_MEM &archive_name)
 {
    pm_strcpy(archive_name, dev->device->mount_point);
    add_file_and_part_name(dev, archive_name);
-   dev->set_part_spooled(false);
 }
 
 void make_spooled_dvd_filename(DEVICE *dev, POOL_MEM &archive_name)
@@ -48,7 +47,6 @@ void make_spooled_dvd_filename(DEVICE *dev, POOL_MEM &archive_name)
       pm_strcpy(archive_name, working_directory);
    }
    add_file_and_part_name(dev, archive_name);
-   dev->set_part_spooled(true);
 }      
 
 static void add_file_and_part_name(DEVICE *dev, POOL_MEM &archive_name)
@@ -65,7 +63,8 @@ static void add_file_and_part_name(DEVICE *dev, POOL_MEM &archive_name)
       bsnprintf(partnumber, sizeof(partnumber), "%d", dev->part);
       pm_strcat(archive_name, partnumber);
    }
-   Dmsg1(400, "Exit add_file_part_name: arch=%s\n", archive_name.c_str());
+   Dmsg2(400, "Exit add_file_part_name: arch=%s, part=%d\n",
+                  archive_name.c_str(), dev->part);
 }  
 
 /* Mount the device.
@@ -380,6 +379,7 @@ bool dvd_write_part(DCR *dcr)
       /* Delete spool file */
       make_spooled_dvd_filename(dev, archive_name);
       unlink(archive_name.c_str());
+      dev->set_part_spooled(false);
       Dmsg1(29, "unlink(%s)\n", archive_name.c_str());
       sm_check(__FILE__, __LINE__, false);
       return true;
@@ -449,6 +449,7 @@ bool dvd_write_part(DCR *dcr)
    /* Delete spool file */
    make_spooled_dvd_filename(dev, archive_name);
    unlink(archive_name.c_str());
+   dev->set_part_spooled(false);
    Dmsg1(29, "unlink(%s)\n", archive_name.c_str());
    sm_check(__FILE__, __LINE__, false);
    
@@ -520,6 +521,7 @@ int dvd_open_next_part(DCR *dcr)
          Dmsg1(100, "Check if part on DVD: %s\n", archive_name.c_str());
          if (stat(archive_name.c_str(), &buf) == 0) {
             /* bad news bail out */
+            dev->set_part_spooled(false);
             Mmsg1(&dev->errmsg, _("Next Volume part already exists on DVD. Cannot continue: %s\n"),
                archive_name.c_str());
             return -1;
@@ -537,6 +539,7 @@ int dvd_open_next_part(DCR *dcr)
          /* Then try to unlink it */
          if (unlink(archive_name.c_str()) < 0) {
             berrno be;
+            dev->set_part_spooled(false);
             dev->dev_errno = errno;
             Mmsg2(dev->errmsg, _("open_next_part can't unlink existing part %s, ERR=%s\n"), 
                    archive_name.c_str(), be.strerror());
index e561663cca3a8abd22bdfc9f3541f9a808f10be9..a6dd0e0c1481909c9f1eb83ad67771e06afc647e 100644 (file)
@@ -712,6 +712,7 @@ Section "Command Console" SecConsole
     nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$R1" /G SYSTEM:F Administrators:F'
   ${EndIf}
 
+  CreateShortCut "$SMPROGRAMS\Bacula\bconsole.lnk" "$INSTDIR\bin\bconsole.exe" '-c "$APPDATA\Bacula\bconsole.conf"' "$INSTDIR\bin\bconsole.exe" 0
   CreateShortCut "$SMPROGRAMS\Bacula\Edit Command Console Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bconsole.conf"'
 
 SectionEnd
@@ -753,7 +754,7 @@ Section "Graphical Console" SecWxConsole
   ${EndIf}
 
   ; Create Start Menu entry
-  CreateShortCut "$SMPROGRAMS\Bacula\Console.lnk" "$INSTDIR\bin\wx-console.exe" '-c "$APPDATA\Bacula\wx-console.conf"' "$INSTDIR\bin\wx-console.exe" 0
+  CreateShortCut "$SMPROGRAMS\Bacula\wx-console.lnk" "$INSTDIR\bin\wx-console.exe" '-c "$APPDATA\Bacula\wx-console.conf"' "$INSTDIR\bin\wx-console.exe" 0
   CreateShortCut "$SMPROGRAMS\Bacula\Edit Graphical Console Configuration.lnk" "write.exe" '"$APPDATA\Bacula\wx-console.conf"'
 SectionEnd
 
index 764128f22b9eee366b5dbaed6f4117945081910e..4ca576fe07bbe32067836214c6e2cab89db44d74 100644 (file)
@@ -2,6 +2,10 @@
 
 General:
 08Sep06
+kes  Make two separate Win32 menu links for starting bconsole and
+     wx-console in winbacula.nsi
+kes  Apply DVD part_spooled patch from Richard Mortimer 
+     richm@oldelvet.org.uk 
 kes  Put installer/Readme.txt into Win32 EOL format for Notebook.
 rbn  Fixed problems migrating settings from previous releases in
      Win32 installer. Add Readme.txt with an option to show it on