]> git.sur5r.net Git - bacula/bacula/commitdiff
Massive commit of all fixes and back ports to create 2.2.9
authorKern Sibbald <kern@sibbald.com>
Wed, 19 Mar 2008 18:01:45 +0000 (18:01 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 19 Mar 2008 18:01:45 +0000 (18:01 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@6636 91ce42f0-d328-0410-95d8-f526ca767f89

37 files changed:
bacula/src/dird/jobq.c
bacula/src/findlib/bfile.c
bacula/src/findlib/create_file.c
bacula/src/findlib/find_one.c
bacula/src/lib/bsys.c
bacula/src/stored/acquire.c
bacula/src/stored/askdir.c
bacula/src/stored/autochanger.c
bacula/src/stored/bcopy.c
bacula/src/stored/bextract.c
bacula/src/stored/block.c
bacula/src/stored/bls.c
bacula/src/stored/bscan.c
bacula/src/stored/btape.c
bacula/src/stored/dev.c
bacula/src/stored/device.c
bacula/src/stored/dircmd.c
bacula/src/stored/label.c
bacula/src/stored/mount.c
bacula/src/stored/protos.h
bacula/src/stored/read_record.c
bacula/src/stored/reserve.c
bacula/src/version.h
bacula/src/win32/External-mingw32
bacula/src/win32/Makefile.inc.in
bacula/src/win32/build-depkgs-mingw32
bacula/src/win32/compat/compat.cpp
bacula/src/win32/installer/Makefile
bacula/src/win32/installer/build-installer.cmd
bacula/src/win32/installer/winbacula.nsi
bacula/src/win32/wx-console/wx-console.vcproj
bacula/src/wx-console/wxbconfigpanel.cpp
bacula/src/wx-console/wxbconfigpanel.h
bacula/src/wx-console/wxbrestorepanel.cpp
bacula/src/wx-console/wxbutils.cpp
bacula/src/wx-console/wxbutils.h
bacula/technotes-2.1

index 7013f4897985d0ad61adf261dcf0eccadc05669e..462ed0b853ac2d58ac7dd3c3061fe97beb98b1bf 100644 (file)
@@ -478,7 +478,7 @@ void *jobq_server(void *arg)
           */
          if (jcr->acquired_resource_locks) {
             if (jcr->rstore) {
-               jcr->rstore->NumConcurrentJobs = 0;
+               jcr->rstore->NumConcurrentJobs--;
                Dmsg1(200, "Dec rncj=%d\n", jcr->rstore->NumConcurrentJobs);
             }
             if (jcr->wstore) {
index 4597d42c940ebfd3f442b170b21993d05c1ec7ca..e23b230604a2168940d82fc583b65b9fdacc4481 100644 (file)
@@ -536,9 +536,14 @@ int bclose(BFILE *bfd)
    if (bfd->mode == BF_CLOSED) {
       return 0;
    }
+   /*
+    * We need to tell the API to release the buffer it
+    *  allocated in lpContext.  We do so by calling the
+    *  API one more time, but with the Abort bit set.
+    */
    if (bfd->use_backup_api && bfd->mode == BF_READ) {
       BYTE buf[10];
-      if (!bfd->lpContext && !p_BackupRead(bfd->fh,
+      if (bfd->lpContext && !p_BackupRead(bfd->fh,
               buf,                    /* buffer */
               (DWORD)0,               /* bytes to read */
               &bfd->rw_bytes,         /* bytes read */
@@ -550,7 +555,7 @@ int bclose(BFILE *bfd)
       }
    } else if (bfd->use_backup_api && bfd->mode == BF_WRITE) {
       BYTE buf[10];
-      if (!bfd->lpContext && !p_BackupWrite(bfd->fh,
+      if (bfd->lpContext && !p_BackupWrite(bfd->fh,
               buf,                    /* buffer */
               (DWORD)0,               /* bytes to read */
               &bfd->rw_bytes,         /* bytes written */
index 12f7c487badb84a704e6c8fd26d82449dcbacc9c..91edbcdc17ab068037e7634c2a8753304d48601a 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
index 723d45ccf77a12ab09d76ee438270186b9d2426c..a1ee4dcf71c8a345c594e0c6457d214b68e3de4c 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -511,8 +511,11 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt,
       } else {
          ff_pkt->type = FT_DIRBEGIN;
       }
-      /* We have set st_rdev to 1 if it is a reparse point, otherwise 0 */
-      if (have_win32_api() && ff_pkt->statp.st_rdev) {
+      /*
+       * We have set st_rdev to 1 if it is a reparse point, otherwise 0,
+       *  if st_rdev is 2, it is a mount point 
+       */
+      if (have_win32_api() && ff_pkt->statp.st_rdev == 1) {
          ff_pkt->type = FT_REPARSE;
       }
       /*
index 2f2891a5b085c26d87808da7ffd7fc64d4e02ead..f37f4cf1519eec37094302384419540f6fda920f 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -44,7 +44,7 @@
 #endif
 
 #ifdef HAVE_AIX_OS
-extern "C" int initgroups(char *,int);
+extern "C" int initgroups(const char *,int);
 #endif
 
 
index f9a8be1e695996fc67da86a9b9041b7410e09e04..88c2eb951788260a75de5aafbd28ae671f46f2e7 100644 (file)
@@ -134,9 +134,7 @@ bool acquire_device_for_read(DCR *dcr)
       bstrncpy(store->pool_type, dcr->pool_type, sizeof(store->pool_type));
       store->append = false;
       rctx.store = store;
-      dcr->keep_dcr = true;                  /* do not free the dcr */
-      release_device(dcr);
-      dcr->keep_dcr = false;
+      clean_device(dcr);                     /* clean up the dcr */
       
       /*
        * Search for a new device
@@ -265,7 +263,7 @@ default_path:
          
          /* Mount a specific volume and no other */
          Dmsg0(200, "calling dir_ask_sysop\n");
-         if (!dir_ask_sysop_to_mount_volume(dcr)) {
+         if (!dir_ask_sysop_to_mount_volume(dcr, ST_READ)) {
             goto get_out;             /* error return */
          }
          try_autochanger = true;      /* permit using autochanger again */
@@ -326,7 +324,7 @@ DCR *acquire_device_for_append(DCR *dcr)
    init_device_wait_timers(dcr);
 
    dev->dblock(BST_DOING_ACQUIRE);
-   Dmsg1(190, "acquire_append device is %s\n", dev->is_tape()?"tape":
+   Dmsg1(100, "acquire_append device is %s\n", dev->is_tape()?"tape":
         (dev->is_dvd()?"DVD":"disk"));
 
    /*
@@ -361,8 +359,12 @@ DCR *acquire_device_for_append(DCR *dcr)
           !(dir_find_next_appendable_volume(dcr) &&
             strcmp(dev->VolHdr.VolumeName, dcr->VolumeName) == 0)) { /* wrong tape mounted */
          /* Wrong tape mounted, release it, then fall through to get correct one */
-         Dmsg0(50, "Wrong tape mounted, release and try mount.\n");
-         release = true;
+         Dmsg3(50, "Wrong tape mounted. Wanted:%s, got:%s, dev=%s release and try mount.\n",
+               dcr->VolumeName, dev->VolHdr.VolumeName, dev->print_name());
+         /* Do not release if no Volume in drive */
+         if (dev->VolHdr.VolumeName[0]) {
+            release = true;
+         }
          do_mount = true;
       } else {
          /*
@@ -373,14 +375,6 @@ DCR *acquire_device_for_append(DCR *dcr)
           do_mount = strcmp(dcr->VolCatInfo.VolCatStatus, "Recycle") == 0;
           Dmsg2(190, "jid=%u Correct tape mounted. recycle=%d\n", 
                 (uint32_t)jcr->JobId, do_mount);
-#ifdef xxx
-          if (do_mount && dev->num_writers != 0) {
-             Jmsg(jcr, M_FATAL, 0, _("Cannot recycle volume \"%s\""
-                  " on device %s because it is in use by another job.\n"),
-                  dev->VolHdr.VolumeName, dev->print_name());
-             goto get_out;
-          }
-#endif
           if (dev->num_writers == 0) {
              memcpy(&dev->VolCatInfo, &dcr->VolCatInfo, sizeof(dev->VolCatInfo));
           }
@@ -508,6 +502,7 @@ bool release_device(DCR *dcr)
       dev->clear_read();              /* clear read bit */
       Dmsg0(100, "dir_update_vol_info. Release0\n");
       dir_update_volume_info(dcr, false, false); /* send Volume info to Director */
+      volume_unused(dcr);
 
    } else if (dev->num_writers > 0) {
       /* 
@@ -528,6 +523,7 @@ bool release_device(DCR *dcr)
          if (!dev->num_writers && dev->can_write() && dev->block_num > 0) {
             dev->weof(1);
             write_ansi_ibm_labels(dcr, ANSI_EOF_LABEL, dev->VolHdr.VolumeName);
+            volume_unused(dcr);
          }
          if (!dev->at_weot()) {
             dev->VolCatInfo.VolCatFiles = dev->file;   /* set number of files */
@@ -543,6 +539,7 @@ bool release_device(DCR *dcr)
        *   has failed, since the device is not in read mode and
        *   there are no writers. It was probably reserved.
        */
+      volume_unused(dcr);
    }
 
    /* If no writers, close if file or !CAP_ALWAYS_OPEN */
@@ -597,6 +594,18 @@ bool release_device(DCR *dcr)
    return ok;
 }
 
+/*
+ * Clean up the device for reuse without freeing the memory
+ */
+bool clean_device(DCR *dcr)
+{
+   bool ok;
+   dcr->keep_dcr = true;                  /* do not free the dcr */
+   ok = release_device(dcr);
+   dcr->keep_dcr = false;
+   return ok;
+}
+
 /*
  * Create a new Device Control Record and attach
  *   it to the device (if this is a real job).
index 785a25b33c292df2dca1841d5be2e107cab2a28d..6d1d2ce823ff6e37e86d6042f1eb0e2118325f3f 100644 (file)
@@ -252,20 +252,19 @@ bool dir_find_next_appendable_volume(DCR *dcr)
 {
     JCR *jcr = dcr->jcr;
     BSOCK *dir = jcr->dir_bsock;
-    bool found = false;
 
     Dmsg2(200, "dir_find_next_appendable_volume: reserved=%d Vol=%s\n", 
        dcr->reserved_device, dcr->VolumeName);
 
     /*
-     * Try the twenty oldest or most available volumes.  Note,
+     * Try the fourty oldest or most available volumes.  Note,
      *   the most available could already be mounted on another
      *   drive, so we continue looking for a not in use Volume.
      */
     lock_reservations();
     P(vol_info_mutex);
     dcr->volume_in_use = false;
-    for (int vol_index=1;  vol_index < 20; vol_index++) {
+    for (int vol_index=1;  vol_index < 40; vol_index++) {
        bash_spaces(dcr->media_type);
        bash_spaces(dcr->pool_name);
        dir->fsend(Find_media, jcr->Job, vol_index, dcr->pool_name, dcr->media_type);
@@ -275,33 +274,26 @@ bool dir_find_next_appendable_volume(DCR *dcr)
        bool ok = do_get_volume_info(dcr);
        if (ok) {
           if (!is_volume_in_use(dcr)) {
-             found = true;
-             break;
+             Dmsg0(400, "dir_find_next_appendable_volume return true\n");
+             if (reserve_volume(dcr, dcr->VolumeName) == 0) {
+                Dmsg2(100, "Could not reserve volume %s on %s\n", dcr->VolumeName,
+                    dcr->dev->print_name());
+                continue;
+             }
+             V(vol_info_mutex);
+             unlock_reservations();
+             return true;
           } else {
              Dmsg1(100, "Volume %s is in use.\n", dcr->VolumeName);
              dcr->volume_in_use = true;
              continue;
           }
-       } else {
-          Dmsg2(100, "No vol. index %d return false. dev=%s\n", vol_index,
-             dcr->dev->print_name());
-          found = false;
-          break;
        }
-    }
-    if (found) {
-       Dmsg0(400, "dir_find_next_appendable_volume return true\n");
-       if (reserve_volume(dcr, dcr->VolumeName) == 0) {
-          Dmsg2(100, "Could not reserve volume %s on %s\n", dcr->VolumeName,
-              dcr->dev->print_name());
-          goto bail_out;
-       }
-       V(vol_info_mutex);
-       unlock_reservations();
-       return true;
+       Dmsg2(100, "No vol. index %d return false. dev=%s\n", vol_index,
+          dcr->dev->print_name());
+       break;
     }
 
-bail_out:
     dcr->VolumeName[0] = 0;
     V(vol_info_mutex);
     unlock_reservations();
@@ -553,7 +545,7 @@ bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr)
  *                  Note, must create dev->errmsg on error return.
  *
  */
-bool dir_ask_sysop_to_mount_volume(DCR *dcr)
+bool dir_ask_sysop_to_mount_volume(DCR *dcr, int mode)
 {
    int stat = W_TIMEOUT;
    DEVICE *dev = dcr->dev;
@@ -582,11 +574,21 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr)
        *   Otherwise skip it.
        */
       if (!dev->poll && (stat == W_TIMEOUT || stat == W_MOUNT)) {
-         Jmsg(jcr, M_MOUNT, 0, _("Please mount Volume \"%s\" or label a new one for:\n"
+         char *msg;
+         if (mode == ST_APPEND) {
+            msg = _("Please mount Volume \"%s\" or label a new one for:\n"
               "    Job:          %s\n"
               "    Storage:      %s\n"
               "    Pool:         %s\n"
-              "    Media type:   %s\n"),
+              "    Media type:   %s\n");
+         } else {
+            msg = _("Please mount Volume \"%s\" for:\n"
+              "    Job:          %s\n"
+              "    Storage:      %s\n"
+              "    Pool:         %s\n"
+              "    Media type:   %s\n");
+         }
+         Jmsg(jcr, M_MOUNT, 0, msg, 
               dcr->VolumeName,
               jcr->Job,
               dev->print_name(),
index 1d9cad0eba5c89b1ef0b4e12f2cf23d535c11771..d04171d28ab2e6cd5fd49e2c8d1ba6714bbfb1fd 100644 (file)
@@ -147,7 +147,7 @@ int autoload_device(DCR *dcr, int writing, BSOCK *dir)
    changer = get_pool_memory(PM_FNAME);
    if (slot <= 0) {
       Jmsg(jcr, M_INFO, 0, _("Invalid slot=%d defined in catalog for Volume \"%s\" "
-           "on %s. Manual load my be required.\n"), slot, dcr->VolCatInfo.VolCatName,
+           "on %s. Manual load may be required.\n"), slot, dcr->VolCatInfo.VolCatName,
            dev->print_name());
       rtn_stat = 0;
    } else if (!dcr->device->changer_name) {
index 5d0e00eebac07565b30d3f84af7f2a97c759a47a..33a60d7bb00637a40dffa5dfce49e4de2d2f1302 100644 (file)
@@ -349,7 +349,7 @@ bool    dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec) { return 1;}
 bool    dir_send_job_status(JCR *jcr) {return 1;}
 
 
-bool dir_ask_sysop_to_mount_volume(DCR *dcr)
+bool dir_ask_sysop_to_mount_volume(DCR *dcr, int /*mode*/)
 {
    DEVICE *dev = dcr->dev;
    fprintf(stderr, _("Mount Volume \"%s\" on device %s and press return when ready: "),
index 7c5cfada4634971e05c076ec3afc0a381e586823..45fc89110c5db1fe3b569ad2631677f303948f6f 100644 (file)
@@ -488,7 +488,7 @@ bool    dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec) { return 1;}
 bool    dir_send_job_status(JCR *jcr) {return 1;}
 
 
-bool dir_ask_sysop_to_mount_volume(DCR *dcr)
+bool dir_ask_sysop_to_mount_volume(DCR *dcr, int /*mode*/)
 {
    DEVICE *dev = dcr->dev;
    fprintf(stderr, _("Mount Volume \"%s\" on device %s and press return when ready: "),
index b9cbbfa36acaf72ae8c5c831ac24953ed4d438b8..5efc332669f878680dc1585a0a2cc6f80ec77757 100644 (file)
@@ -374,7 +374,6 @@ bool write_block_to_device(DCR *dcr)
       if (dcr->NewVol) {
          /* Note, setting a new volume also handles any pending new file */
          set_new_volume_parameters(dcr);
-         dcr->NewFile = false;        /* this handled for new file too */
       } else {
          set_new_file_parameters(dcr);
       }
@@ -705,6 +704,11 @@ static void reread_last_block(DCR *dcr)
 #endif
 }
 
+/*
+ * If this routine is called, we do our bookkeeping and
+ *   then assure that the volume will not be written any
+ *   more.
+ */
 static bool terminate_writing_volume(DCR *dcr)
 {
    DEVICE *dev = dcr->dev;
index 0ce876deaba60502dc4547c4825cfccbcdb2d09e..46a824e060b606b28cee54d6e85855a13b2fda1d 100644 (file)
@@ -453,7 +453,7 @@ bool    dir_send_job_status(JCR *jcr) {return 1;}
 int     generate_job_event(JCR *jcr, const char *event) { return 1; }
        
 
-bool dir_ask_sysop_to_mount_volume(DCR *dcr)
+bool dir_ask_sysop_to_mount_volume(DCR *dcr, int /*mode*/)
 {
    DEVICE *dev = dcr->dev;
    fprintf(stderr, _("Mount Volume \"%s\" on device %s and press return when ready: "),
index fd11d7ff41319f5c34fa893fa78541fe79a9fc81..2cb3655ad47fb32f800ff707270484a719712d6f 100644 (file)
@@ -1292,7 +1292,7 @@ bool    dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec) { return 1;}
 bool    dir_send_job_status(JCR *jcr) {return 1;}
 int     generate_job_event(JCR *jcr, const char *event) { return 1; }
 
-bool dir_ask_sysop_to_mount_volume(DCR *dcr)
+bool dir_ask_sysop_to_mount_volume(DCR *dcr, int /*mode*/)
 {
    DEVICE *dev = dcr->dev;
    Dmsg0(20, "Enter dir_ask_sysop_to_mount_volume\n");
index 1a276916d5604a09f0994a4ed65d6c63e5c031fc..d9b6a471fa86c152328db0f5966309cab784e5c4 100644 (file)
@@ -2674,7 +2674,7 @@ bool dir_find_next_appendable_volume(DCR *dcr)
    return dcr->VolumeName[0] != 0;
 }
 
-bool dir_ask_sysop_to_mount_volume(DCR *dcr)
+bool dir_ask_sysop_to_mount_volume(DCR *dcr, int /* mode */)
 {
    DEVICE *dev = dcr->dev;
    Dmsg0(20, "Enter dir_ask_sysop_to_mount_volume\n");
@@ -2731,6 +2731,7 @@ static bool my_mount_next_read_volume(DCR *dcr)
    Pmsg2(000, _("End of Volume \"%s\" %d records.\n"), dcr->VolumeName,
       quickie_count);
 
+   volume_unused(dcr);
    if (LastBlock != block->BlockNumber) {
       VolBytes += block->block_len;
    }
index 28bcc4e8032a58d3f04701ff3a85630135977fe5..f525e0924c7163b67321d9c31f26f48caaabf09e 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -1855,6 +1855,10 @@ void DEVICE::close()
 
    /* Clean up device packet so it can be reused */
    clear_opened();
+   /*
+    * Be careful not to clear items needed by the DVD driver
+    *    when it is closing a single part.
+    */
    state &= ~(ST_LABEL|ST_READ|ST_APPEND|ST_EOT|ST_WEOT|ST_EOF|
               ST_MOUNTED|ST_MEDIA|ST_SHORT);
    label_type = B_BACULA_LABEL;
@@ -2381,7 +2385,7 @@ void set_os_device_parameters(DCR *dcr)
    }
 #endif
 #if defined(MTSETDRVBUFFER)
-   if (getpid() == 0) {          /* Only root can do this */
+   if (getuid() == 0) {          /* Only root can do this */
       mt_com.mt_op = MTSETDRVBUFFER;
       mt_com.mt_count = MT_ST_CLEARBOOLEANS;
       if (!dev->has_cap(CAP_TWOEOF)) {
index b38b512d0bba87783189ab5d40f589c78febd802..50ab5dab1a48a968170c556a107aa92f95bc5e0b 100644 (file)
@@ -226,6 +226,7 @@ void set_new_volume_parameters(DCR *dcr)
    }
    set_new_file_parameters(dcr);
    jcr->NumWriteVolumes++;
+   dcr->NewVol = false;
 }
 
 /*
index 95a05e075abd295baa0db0702fcedf11c9656cf1..a7b631a8311ab2b069c55360cc89a3acaab936ba 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2001-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2001-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -515,6 +515,7 @@ bail_out:
    if (!dev->is_open()) {
       dev->clear_volhdr();
    }
+   volume_unused(dcr);                   /* no longer using volume */
    give_back_device_lock(dev, &hold);
    return;
 }
@@ -548,6 +549,7 @@ static bool read_label(DCR *dcr)
       ok = false;
       break;
    }
+   volume_unused(dcr);
    give_back_device_lock(dev, &hold);
    return ok;
 }
index 5e6c75bfca368026510c2f8622ffa368bb3d7e0a..115f7ae0d1e1f53f82979e9e154f24f1a3784135 100644 (file)
@@ -257,6 +257,7 @@ int read_dev_volume_label(DCR *dcr)
    return VOL_OK;
 
 bail_out:
+   volume_unused(dcr);                /* mark volume "released" */
    empty_block(block);
    dev->rewind(dcr);
    Dmsg1(150, "return %d\n", stat);
@@ -315,13 +316,15 @@ bool write_new_volume_label_to_dev(DCR *dcr, const char *VolName,
    Dmsg0(150, "write_volume_label()\n");
    empty_block(dcr->block);
 
-   /* If relabeling, truncate the device */
-   if (relabel && !dev->truncate(dcr)) {
-      goto bail_out;
-   }
-
-   if (relabel && !dev->is_tape()) {
-      dev->close_part(dcr);              /* make sure DVD/file closed for rename */
+   if (relabel) {
+      volume_unused(dcr);             /* mark current volume unused */
+      /* Truncate device */
+      if (!dev->truncate(dcr)) {
+         goto bail_out;
+      }
+      if (!dev->is_tape()) {
+         dev->close_part(dcr);        /* make sure DVD/file closed for rename */
+      }
    }
 
    /* Set the new filename for open, ... */
@@ -408,6 +411,7 @@ bool write_new_volume_label_to_dev(DCR *dcr, const char *VolName,
    return true;
 
 bail_out:
+   volume_unused(dcr);
    dev->clear_volhdr();
    dev->clear_append();               /* remove append since this is PRE_LABEL */
    return false;
@@ -451,6 +455,7 @@ bool rewrite_volume_label(DCR *dcr, bool recycle)
          return false;
       }
       if (recycle) {
+         volume_unused(dcr);             /* mark volume unused */
          if (!dev->truncate(dcr)) {
             Jmsg2(jcr, M_FATAL, 0, _("Truncate error on device %s: ERR=%s\n"),
                   dev->print_name(), dev->print_errmsg());
@@ -698,13 +703,7 @@ bool write_session_label(DCR *dcr, int label)
    Dmsg1(130, "session_label record=%x\n", rec);
    switch (label) {
    case SOS_LABEL:
-      if (dev->is_tape()) {
-         dcr->StartBlock = dev->block_num;
-         dcr->StartFile  = dev->file;
-      } else {
-         dcr->StartBlock = (uint32_t)dev->file_addr;
-         dcr->StartFile = (uint32_t)(dev->file_addr >> 32);
-      }
+      set_start_vol_position(dcr);
       break;
    case EOS_LABEL:
       if (dev->is_tape()) {
index c8beb34a999b84292f398d80a7d7f1950bce3b7c..0feccef48971fb9efd1344860ae2b91101c673f9 100644 (file)
@@ -86,7 +86,7 @@ mount_next_vol:
    if (!dev->poll && retry++ > 4) {
       /* Last ditch effort before giving up, force operator to respond */
       dcr->VolCatInfo.Slot = 0;
-      if (!dir_ask_sysop_to_mount_volume(dcr)) {
+      if (!dir_ask_sysop_to_mount_volume(dcr, ST_APPEND)) {
          Jmsg(jcr, M_FATAL, 0, _("Too many errors trying to mount device %s.\n"),
               dev->print_name());
          return false;
@@ -162,14 +162,14 @@ mount_next_vol:
    Dmsg2(150, "Ask=%d autochanger=%d\n", ask, autochanger);
    release = true;                /* release next time if we "recurse" */
 
-   if (ask && !dir_ask_sysop_to_mount_volume(dcr)) {
+   if (ask && !dir_ask_sysop_to_mount_volume(dcr, ST_APPEND)) {
       Dmsg0(150, "Error return ask_sysop ...\n");
       return false;          /* error return */
    }
    if (job_canceled(jcr)) {
       return false;
    }
-   Dmsg1(150, "want vol=%s\n", dcr->VolumeName);
+   Dmsg2(150, "want vol=%s dev=%s\n", dcr->VolumeName, dev->VolHdr.VolumeName);
 
    if (dev->poll && dev->has_cap(CAP_CLOSEONPOLL)) {
       dev->close();
@@ -596,14 +596,14 @@ void release_volume(DCR *dcr)
    dev->block_num = dev->file = 0;
    dev->EndBlock = dev->EndFile = 0;
    memset(&dev->VolCatInfo, 0, sizeof(dev->VolCatInfo));
-   memset(&dcr->VolCatInfo, 0, sizeof(dcr->VolCatInfo));
+// memset(&dcr->VolCatInfo, 0, sizeof(dcr->VolCatInfo));
    dev->clear_volhdr();
    /* Force re-read of label */
    dev->clear_labeled();
    dev->clear_read();
    dev->clear_append();
    dev->label_type = B_BACULA_LABEL;
-   dcr->VolumeName[0] = 0;
+// dcr->VolumeName[0] = 0;
 
    if (dev->is_open() && (!dev->is_tape() || !dev->has_cap(CAP_ALWAYSOPEN))) {
       dev->close();
@@ -625,6 +625,8 @@ bool mount_next_read_volume(DCR *dcr)
    DEVICE *dev = dcr->dev;
    JCR *jcr = dcr->jcr;
    Dmsg2(90, "NumReadVolumes=%d CurReadVolume=%d\n", jcr->NumReadVolumes, jcr->CurReadVolume);
+
+   volume_unused(dcr);                /* release current volume */
    /*
     * End Of Tape -- mount next Volume (if another specified)
     */
index 7d1b75a3e23895bbcbeb780eaff892aba28543e3..616c1d9c8dc5cab2d9edb8397087ba885ab4a25f 100644 (file)
@@ -38,6 +38,7 @@ uint32_t new_VolSessionId();
 DCR     *acquire_device_for_append(DCR *dcr);
 bool     acquire_device_for_read(DCR *dcr);
 bool     release_device(DCR *dcr);
+bool     clean_device(DCR *dcr);
 DCR     *new_dcr(JCR *jcr, DCR *dcr, DEVICE *dev);
 void     free_dcr(DCR *dcr);
 void     detach_dcr_from_dev(DCR *dcr);
@@ -51,7 +52,7 @@ bool    dir_get_volume_info(DCR *dcr, enum get_vol_info_rw);
 bool    dir_find_next_appendable_volume(DCR *dcr);
 bool    dir_update_volume_info(DCR *dcr, bool label, bool update_LastWritten);
 bool    dir_ask_sysop_to_create_appendable_volume(DCR *dcr);
-bool    dir_ask_sysop_to_mount_volume(DCR *dcr);
+bool    dir_ask_sysop_to_mount_volume(DCR *dcr, int mode);
 bool    dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec);
 bool    dir_send_job_status(JCR *jcr);
 bool    dir_create_jobmedia_record(DCR *dcr);
index 69707e247d91152f229fd7bf33881cf2c60c53f6..4190d11848b4d62f94bcd618a8917e10e680e95a 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2002-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2002-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -82,6 +82,7 @@ bool read_records(DCR *dcr,
             DEV_RECORD *trec = new_record();
             Jmsg(jcr, M_INFO, 0, _("End of Volume at file %u on device %s, Volume \"%s\"\n"),
                  dev->file, dev->print_name(), dcr->VolumeName);
+            volume_unused(dcr);       /* mark volume unused */
             if (!mount_cb(dcr)) {
                Jmsg(jcr, M_INFO, 0, _("End of all volumes.\n"));
                ok = false;            /* Stop everything */
index 6cd269eeae833ff49bc1376d12a67b7c3b70124d..33340c1e6edb134675bf35de6182e59bef19bc51 100644 (file)
@@ -324,17 +324,26 @@ VOLRES *reserve_volume(DCR *dcr, const char *VolumeName)
     */
    if (dev->vol) {
       vol = dev->vol;
+      Dmsg5(dbglvl, "jid=%u Vol attached=%s, newvol=%s release=%d on %s\n",
+         jid(), vol->vol_name, VolumeName, vol->released, dev->print_name());
       /*
        * Make sure we don't remove the current volume we are inserting
-       *  because it was probably inserted by another job.
+       *  because it was probably inserted by another job, or it
+       *  is not being used and is marked as released.
        */
       if (strcmp(vol->vol_name, VolumeName) == 0) {
-         Dmsg1(dbglvl, "OK, vol=%s on device.\n", VolumeName);
+         Dmsg2(dbglvl, "jid=%u === OK, vol=%s on device. set not released.\n", jid(), VolumeName);
+         vol->released = false;         /* retake vol if released previously */
          goto get_out;                  /* Volume already on this device */
       } else {
-         Dmsg3(dbglvl, "jid=%u reserve_vol free vol=%s at %p\n",
-               (int)dcr->jcr->JobId, vol->vol_name, vol->vol_name);
-         unload_autochanger(dcr, -1);    /* unload the volume */       
+         /* Don't release a volume if it is in use */
+         if (!vol->released) {
+            Dmsg2(dbglvl, "jid=%u Cannot free vol=%s. It is not released.\n", jid(), vol->vol_name);
+            vol = NULL;                  /* vol in use */
+            goto get_out;
+         }
+         Dmsg3(dbglvl, "jid=%u reserve_vol free vol=%s at %p\n", jid(), vol->vol_name, vol->vol_name);
+         unload_autochanger(dcr, -1);   /* unload the volume */
          free_volume(dev);
          debug_list_volumes("reserve_vol free");
       }
@@ -387,6 +396,7 @@ VOLRES *reserve_volume(DCR *dcr, const char *VolumeName)
 
 get_out:
    if (vol) {
+      Dmsg2(dbglvl, "jid=%u === set not released. vol=%s\n", jid(), vol->vol_name);
       vol->released = false;
    }
    debug_list_volumes("end new volume");
@@ -394,6 +404,36 @@ get_out:
    return vol;
 }
 
+/* 
+ * Switch from current device to given device  
+ *   (not yet used) 
+ */
+void switch_device(DCR *dcr, DEVICE *dev)
+{
+   // lock_reservations();
+   DCR save_dcr;
+
+   dev->dlock();
+   memcpy(&save_dcr, dcr, sizeof(save_dcr));
+   clean_device(dcr);                  /* clean up the dcr */
+
+   dcr->dev = dev;                     /* get new device pointer */
+   Jmsg(dcr->jcr, M_INFO, 0, _("Device switch. New device %s chosen.\n"),
+      dcr->dev->print_name());
+
+   bstrncpy(dcr->VolumeName, save_dcr.VolumeName, sizeof(dcr->VolumeName));
+   bstrncpy(dcr->media_type, save_dcr.media_type, sizeof(dcr->media_type));
+   dcr->VolCatInfo.Slot = save_dcr.VolCatInfo.Slot;
+   bstrncpy(dcr->pool_name, save_dcr.pool_name, sizeof(dcr->pool_name));
+   bstrncpy(dcr->pool_type, save_dcr.pool_type, sizeof(dcr->pool_type));
+   bstrncpy(dcr->dev_name, dev->dev_name, sizeof(dcr->dev_name));
+
+   dev->reserved_device++;
+   dcr->reserved_device = true;
+
+   dev->dunlock();
+}
+
 /*
  * Search for a Volume name in the Volume list.
  *
@@ -434,15 +474,20 @@ void unreserve_device(DCR *dcr)
          Jmsg1(dcr->jcr, M_ERROR, 0, _("Hey! num_writers=%d!!!!\n"), dev->num_writers);
          dev->num_writers = 0;
       }
+      if (dev->reserved_device == 0 && dev->num_writers == 0) {
+         volume_unused(dcr);
+      }
    }
-
-   volume_unused(dcr);
 }
 
 /*  
  * Free a Volume from the Volume list if it is no longer used
+ *   Note, for tape drives we want to remember where the Volume
+ *   was when last used, so rather than free the volume entry,
+ *   we simply mark it "released" so when the drive is really
+ *   needed for another volume, we can reuse it.
  *
- *  Returns: true if the Volume found and removed from the list
+ *  Returns: true if the Volume found and "removed" from the list
  *           false if the Volume is not in the list or is in use
  */
 bool volume_unused(DCR *dcr)
@@ -455,11 +500,18 @@ bool volume_unused(DCR *dcr)
       return false;
    }
 
+#ifdef xxx
    if (dev->is_busy()) {
       Dmsg2(dbglvl, "jid=%u vol_unused: no vol on %s\n", (int)dcr->jcr->JobId, dev->print_name());
       debug_list_volumes("dev busy cannot unreserve_volume");
       return false;
    }
+#endif
+#ifdef xxx
+   if (dev->num_writers > 0 || dev->reserved_device > 0) {
+      ASSERT(0);
+   }
+#endif
 
    /*  
     * If this is a tape, we do not free the volume, rather we wait
@@ -468,15 +520,19 @@ bool volume_unused(DCR *dcr)
     *  where the tapes are or last were.
     */
    dev->vol->released = true;
-   if (dev->is_tape() || dev->is_autochanger()) {
+   if (dev->is_tape()) { // || dev->is_autochanger()) {
       return true;
    } else {
+      /*
+       * Note, this frees the volume reservation entry, but the
+       *   file descriptor remains open with the OS.
+       */
       return free_volume(dev);
    }
 }
 
 /*
- * Unconditionally release the volume
+ * Unconditionally release the volume entry
  */
 bool free_volume(DEVICE *dev)
 {
@@ -925,6 +981,7 @@ bool find_suitable_device_for_job(JCR *jcr, RCTX &rctx)
                   Dmsg1(dbglvl, "jid=%u No suitable device found.\n", (int)rctx.jcr->JobId);
                }
                rctx.have_volume = false;
+               rctx.VolumeName[0] = 0;
             }
             if (ok) {
                break;
@@ -935,12 +992,14 @@ bool find_suitable_device_for_job(JCR *jcr, RCTX &rctx)
          }
       } /* end for loop over reserved volumes */
 
+      Dmsg1(dbglvl, "%u lock volumes\n", jid());
       lock_volumes();
       save_vol_list = vol_list;
       vol_list = temp_vol_list;
       free_volume_list();                  /* release temp_vol_list */
       vol_list = save_vol_list;
       Dmsg1(dbglvl, "jid=%u deleted temp vol list\n", (int)rctx.jcr->JobId);
+      Dmsg1(dbglvl, "jid=%u unlock volumes\n", (int)rctx.jcr->JobId);
       unlock_volumes();
    }
    if (ok) {
@@ -1110,7 +1169,14 @@ static int reserve_device(RCTX &rctx)
                (int)rctx.jcr->JobId,
                dcr->dev->reserved_device,
                dcr->dev_name, dcr->media_type, dcr->pool_name, ok);
-      if (!rctx.have_volume) {
+      if (rctx.have_volume) {
+         if (reserve_volume(dcr, rctx.VolumeName)) {
+            Dmsg2(dbglvl, "jid=%u Reserved vol=%s\n", jid(), rctx.VolumeName);
+         } else {
+            Dmsg2(dbglvl, "jid=%u Could not reserve vol=%s\n", jid(), rctx.VolumeName);
+            goto bail_out;
+         }
+      } else {
          dcr->any_volume = true;
          if (dir_find_next_appendable_volume(dcr)) {
             bstrncpy(rctx.VolumeName, dcr->VolumeName, sizeof(rctx.VolumeName));
@@ -1130,13 +1196,13 @@ static int reserve_device(RCTX &rctx)
             if (dcr->volume_in_use && !rctx.PreferMountedVols) {
                rctx.PreferMountedVols = true;
                if (dcr->VolumeName[0]) {
-                  volume_unused(dcr);
+                  unreserve_device(dcr);
                }
                goto bail_out;
             }
             /*
              * Note. Under some circumstances, the Director can hand us
-             *  a Volume name that is no the same as the one on the current
+             *  a Volume name that is not the same as the one on the current
              *  drive, and in that case, the call above to find the next
              *  volume will fail because in attempting to reserve the Volume
              *  the code will realize that we already have a tape mounted,
@@ -1147,7 +1213,7 @@ static int reserve_device(RCTX &rctx)
              */
             if (dcr->dev->num_writers != 0) {
                if (dcr->VolumeName[0]) {
-                  volume_unused(dcr);
+                  unreserve_device(dcr);
                }
                goto bail_out;
             }
@@ -1166,6 +1232,7 @@ static int reserve_device(RCTX &rctx)
    if (!ok) {
       goto bail_out;
    }
+
    if (rctx.notify_dir) {
       POOL_MEM dev_name;
       BSOCK *dir = rctx.jcr->dir_bsock;
@@ -1180,8 +1247,8 @@ static int reserve_device(RCTX &rctx)
 
 bail_out:
    rctx.have_volume = false;
-// free_dcr(dcr);
    Dmsg1(dbglvl, "jid=%u Not OK.\n", (int)rctx.jcr->JobId);
+   rctx.VolumeName[0] = 0;
    return 0;
 }
 
index 2dc4c9db7fd2ddbef6c4adb431c3802213c73dc6..91894f78f2a6c18a2515dd99c4f3cd8b6afad31f 100644 (file)
@@ -3,9 +3,9 @@
  */
 
 #undef  VERSION
-#define VERSION "2.2.8"
-#define BDATE   "26 January 2008"
-#define LSMDATE "26Jan08"
+#define VERSION "2.2.9"
+#define BDATE   "18 March 2008"
+#define LSMDATE "18Mar08"
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2008"       /* year for copyright messages in progs */
index 5496d0ef7ed2d241fcc4e6880412219f89ccef5c..7dbfeb849c2d6af5ca233af4ab6ad712364475bf 100644 (file)
@@ -32,12 +32,12 @@ OPENSSL|http://www.bacula.org/depkgs-mingw32/openssl-0.9.8b.tar.gz
 PCRE|http://www.bacula.org/depkgs-mingw32/pcre-6.3.tar.bz2
 POSTGRESQL|http://www.bacula.org/depkgs-mingw32/postgresql-base-8.1.4.tar.bz2|postgresql-8.1.4
 PTHREADS|http://www.bacula.org/depkgs-mingw32/pthreads-snap-2004-06-22.tar.gz
-Qt4|ftp://ftp.trolltech.com/qt/source/qt-win-opensource-src-4.3.0.zip
+Qt4|ftp://www.bacula.org/depkgs-mingw32/qt-win-opensource-src-4.3.4.zip
 SCONS|http://www.bacula.org/depkgs-mingw32/scons-0.96.92.tar.gz
 SED|http://www.bacula.org/depkgs-mingw32/sed-4.1.5.tar.gz
 SQLITE|http://www.bacula.org/depkgs-mingw32/sqlite-3.3.17.tar.gz
 STAB2CV|http://www.bacula.org/depkgs-mingw32/stab2cv-0.1.tar.bz2
-WX|http://www.bacula.org/depkgs-mingw32/wxWidgets-2.7.0.tar.gz
+WX|http://www.bacula.org/depkgs-mingw32/wxWidgets-2.8.7.tar.gz
 ZLIB|http://www.bacula.org/depkgs-mingw32/zlib-1.2.3.tar.gz
 # 
 # 
index c5b651b0c0b2694558ba7d40c5e059630bdc87be..7b41950ce7d167e182de490d02601f8c84d04e0a 100644 (file)
@@ -67,8 +67,8 @@ LIBS_CRYPTO := \
         $(DEPKGS)/lib/libcrypto.dll.a
 
 LIBS_WX := \
-        $(DEPKGS)/lib/wx_dll/libwxmsw27_core.a \
-        $(DEPKGS)/lib/wx_dll/libwxbase27.a
+        $(DEPKGS)/lib/wx_dll/libwxmsw28_core.a \
+        $(DEPKGS)/lib/wx_dll/libwxbase28.a
 
 LIBS_CATS := \
         $(LIBDIR)/libcats.a
index ce132dace7b51d7b7789a0dd2db99b449fff2701..046813ac6c80960d142ee6748c4fc68b5b1df9b6 100755 (executable)
@@ -6,26 +6,26 @@
 
 usage()
 {
-        echo "usage: $0 [-h] [-C] [<dependency 1>] [<dependency 2>] ..."
-        echo "       -h      Displays this usage"
-        echo "       -C      Clobbers (overwrites) the source code by "
-        echo "               reextracting the archive and reapplying the"
-        echo "               patches."
-        echo ""
-        echo "<dependency N> Optional dependency, If none are given then all"
-        echo "               of them will be built."
-        echo ""
-        echo "Valid dependencies are:"
-        grep -v '^#' < External-mingw32 | cut -d'|' -f1 | cut -d'_' -f1 | tr A-Z a-z | sort -u | awk '{ print "        " $1 }'
+   echo "usage: $0 [-h] [-C] [<dependency 1>] [<dependency 2>] ..."
+   echo "       -h      Displays this usage"
+   echo "       -C      Clobbers (overwrites) the source code by "
+   echo "               reextracting the archive and reapplying the"
+   echo "               patches."
+   echo ""
+   echo "<dependency N> Optional dependency, If none are given then all"
+   echo "               of them will be built."
+   echo ""
+   echo "Valid dependencies are:"
+   grep -v '^#' < External-mingw32 | cut -d'|' -f1 | cut -d'_' -f1 | tr A-Z a-z | sort -u | awk '{ print "        " $1 }'
 }
 
 CLOBBER_SOURCE=
 
 while getopts "hHC" opt; do
-        case ${opt} in
-        H|h|\?) usage;exit 1;;
-        C)      CLOBBER_SOURCE=true;;
-        esac
+   case ${opt} in
+   H|h|\?) usage;exit 1;;
+   C)      CLOBBER_SOURCE=true;;
+   esac
 done
 
 [ ${OPTIND} -gt 1 ] && shift `expr ${OPTIND} - 1`
@@ -39,15 +39,15 @@ TOP_DIR=`pwd`
 
 if [ -e ${TOP_DIR}/cross-tools/mingw32/bin/mingw32-gcc ]
 then
-        cd ${TOP_DIR}/cross-tools/mingw32/bin
-        BIN_DIR=`pwd`
+   cd ${TOP_DIR}/cross-tools/mingw32/bin
+   BIN_DIR=`pwd`
 elif [ -e /mingw/bin/mingw32-gcc ] 
 then
-        BIN_DIR=/mingw/bin
+   BIN_DIR=/mingw/bin
 else
-        echo The GCC cross compiler isn\'t installed.
-        echo You must run build-win32-cross-tools first
-        exit 1
+   echo "The GCC cross compiler isn\'t installed."
+   echo "You must run build-win32-cross-tools first"
+   exit 1
 fi
 
 [ ! -e ${TOP_DIR}/depkgs-mingw32 ] && mkdir ${TOP_DIR}/depkgs-mingw32
@@ -63,328 +63,328 @@ export PATH=${BIN_DIR}:${PATH}
 
 OLD_IFS=${IFS};IFS="|";
 while read package url dir mkd; do
-        echo "Got package ${package}"
-        case ${package} in
-        \#*) ;;
-        *) eval "URL_${package}=${url};DIR_${package}=${dir};MKD_${package}=${mkd}";;
+   echo "Got package ${package}"
+   case ${package} in
+   \#*) ;;
+   *) eval "URL_${package}=${url};DIR_${package}=${dir};MKD_${package}=${mkd}";;
         esac
 done < ${SCRIPT_DIR}/External-mingw32
 IFS=${OLD_IFS};unset OLD_IFS
 
 get_source()
 {
-        URL=$1
-        SRC_DIR=$2
-        MAKE_DIR=$3
-        echo "Processing ${URL}"
-        ARCHIVE=`basename ${URL}`
-        
-        case ${ARCHIVE} in
-        *.tar.gz)       ARCHIVER="tar xzf";    [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.tar\.gz'`;;
-        *.tar.bz2)      ARCHIVER="tar xjf";    [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.tar\.bz2'`;;
-        *.zip)          ARCHIVER="unzip -q";   [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.zip'`;;
-        *.exe)          ARCHIVER="";           [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.zip'`;;
-        *)              echo Unsupported archive type - $ARCHIVE; exit 1;;
-        esac
-        
-        cd ${DEPPKG_DIR}/src
-        
-        if [ ! -e "${ARCHIVE}" ]
-        then 
-                echo Downloading "${URL}"
-                if wget --passive-ftp "${URL}"
-                then
-                        :
-                else
-                        echo Unable to download ${ARCHIVE}
-                        exit 1
-                fi
-        fi
-
-        [ -z "${ARCHIVER}" ] && return 0
-
-        if [ ! -e "${SRC_DIR}" -o "${CLOBBER_SOURCE}" = "true" ]
-        then
-                rm -rf ${SRC_DIR}
-                echo Extracting ${ARCHIVE}
-                if [ "${MAKE_DIR}" = "true" ]
-                then
-                        mkdir ${SRC_DIR}
-                        cd ${SRC_DIR}
-                        ${ARCHIVER} ../${ARCHIVE} > ../${ARCHIVE}.log 2>&1
-                else
-                        ${ARCHIVER} ${ARCHIVE} > ${ARCHIVE}.log 2>&1
-                        cd ${SRC_DIR}
-                fi
-                return 0
-        fi
-
-        cd ${SRC_DIR}
-        return 1
+   URL=$1
+   SRC_DIR=$2
+   MAKE_DIR=$3
+   echo "Processing ${URL}"
+   ARCHIVE=`basename ${URL}`
+   
+   case ${ARCHIVE} in
+   *.tar.gz)       ARCHIVER="tar xzf";    [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.tar\.gz'`;;
+   *.tar.bz2)      ARCHIVER="tar xjf";    [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.tar\.bz2'`;;
+   *.zip)          ARCHIVER="unzip -q";   [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.zip'`;;
+   *.exe)          ARCHIVER="";           [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.zip'`;;
+   *)              echo Unsupported archive type - $ARCHIVE; exit 1;;
+   esac
+   
+   cd ${DEPPKG_DIR}/src
+   
+   if [ ! -e "${ARCHIVE}" ]
+   then 
+      echo Downloading "${URL}"
+      if wget --passive-ftp "${URL}"
+      then
+         :
+      else
+         echo Unable to download ${ARCHIVE}
+         exit 1
+      fi
+   fi
+
+   [ -z "${ARCHIVER}" ] && return 0
+
+   if [ ! -e "${SRC_DIR}" -o "${CLOBBER_SOURCE}" = "true" ]
+   then
+      rm -rf ${SRC_DIR}
+      echo Extracting ${ARCHIVE}
+      if [ "${MAKE_DIR}" = "true" ]
+      then
+         mkdir ${SRC_DIR}
+         cd ${SRC_DIR}
+         ${ARCHIVER} ../${ARCHIVE} > ../${ARCHIVE}.log 2>&1
+      else
+         ${ARCHIVER} ${ARCHIVE} > ${ARCHIVE}.log 2>&1
+         cd ${SRC_DIR}
+      fi
+      return 0
+   fi
+
+   cd ${SRC_DIR}
+   return 1
 }
 
 parse_output()
 {
-        sed -ne '/\\$/N' -e 's/\\\n//' -e 's/\t\+/ /g' -e 's/ \+/ /g' \
-            -e '/ error: /p' \
-            -e "s%.*Entering directory[ ]\\+.${DEPPKG_DIR}/\\([^ ]\+\).%Entering \\1%p" \
-            -e "s%.*Leaving directory[ ]\\+.${DEPPKG_DIR}/\\([^ ]\+.\).%Leaving \\1%p" \
-            -e '/gcc \|g\+\+ \|ar /!d' \
-            -e 's/ \(\.\.\/\)\+/ /g' \
-            -e 's/.* \([^ ]\+\(\.c\|\.cpp\|\.cc\|\.cxx\)\)\( .*\|\)$/Compiling \1/p' \
-            -e 's/.* \([^ ]\+\.s\)\( .*\|\)$/Assembling \1/p' \
-            -e 's/.*ar [^ ]\+ \([^ ]\+\)\(\( [^ ]\+\.o\)\+\)/Updating \1 -\2/p' \
-            -e 's/.* -o \([^ ]\+\)\( .*\|\)$/Linking \1/p'
+   sed -ne '/\\$/N' -e 's/\\\n//' -e 's/\t\+/ /g' -e 's/ \+/ /g' \
+       -e '/ error: /p' \
+       -e "s%.*Entering directory[ ]\\+.${DEPPKG_DIR}/\\([^ ]\+\).%Entering \\1%p" \
+       -e "s%.*Leaving directory[ ]\\+.${DEPPKG_DIR}/\\([^ ]\+.\).%Leaving \\1%p" \
+       -e '/gcc \|g\+\+ \|ar /!d' \
+       -e 's/ \(\.\.\/\)\+/ /g' \
+       -e 's/.* \([^ ]\+\(\.c\|\.cpp\|\.cc\|\.cxx\)\)\( .*\|\)$/Compiling \1/p' \
+       -e 's/.* \([^ ]\+\.s\)\( .*\|\)$/Assembling \1/p' \
+       -e 's/.*ar [^ ]\+ \([^ ]\+\)\(\( [^ ]\+\.o\)\+\)/Updating \1 -\2/p' \
+       -e 's/.* -o \([^ ]\+\)\( .*\|\)$/Linking \1/p'
 }
 
 do_patch()
 {
-        PATCH_FILE=${SCRIPT_DIR}/patches/$1; shift
-        
-        if patch -f -p0 "$@" >>patch.log < ${PATCH_FILE}
-        then
-                :
-        else
-                echo Patch failed - Check `pwd`/patch.log > /dev/tty
-                exit 1
-        fi
+   PATCH_FILE=${SCRIPT_DIR}/patches/$1; shift
+   
+   if patch -f -p0 "$@" >>patch.log < ${PATCH_FILE}
+   then
+      :
+   else
+      echo "Patch failed - Check `pwd`/patch.log" > /dev/tty
+      exit 1
+   fi
 }
 
 do_make()
 {
-        if make -f "$@" 2>&1
-        then
-                :
-        else
-                echo Make failed - Check `pwd`/make.log > /dev/tty
-                exit 1
-        fi | tee -a make.log | parse_output
+   if make -f "$@" 2>&1
+   then
+      :
+   else
+      echo "Make failed - Check `pwd`/make.log" > /dev/tty
+      exit 1
+   fi | tee -a make.log | parse_output
 }
 
 process_zlib()
 {
-        if get_source "${URL_ZLIB}" "${DIR_ZLIB}" "${MKD_ZLIB}"
-        then
-                echo Patching zlib
-                >patch.log
-                do_patch zlib.patch
-        fi
-        echo Building zlib
-        > make.log
-        do_make win32/Makefile.mingw32 PREFIX=${DEPPKG_DIR} all
-        echo Installing zlib
-        do_make win32/Makefile.mingw32 PREFIX=${DEPPKG_DIR} install
+   if get_source "${URL_ZLIB}" "${DIR_ZLIB}" "${MKD_ZLIB}"
+   then
+      echo "Patching zlib"
+      >patch.log
+      do_patch zlib.patch
+   fi
+   echo Building zlib
+   > make.log
+   do_make win32/Makefile.mingw32 PREFIX=${DEPPKG_DIR} all
+   echo Installing zlib
+   do_make win32/Makefile.mingw32 PREFIX=${DEPPKG_DIR} install
 }
 
 process_pcre()
 {
-        if get_source "${URL_PCRE}" "${DIR_PCRE}" "${MKD_PCRE}"
-        then
-                echo Patching PCRE
-                >patch.log
-                do_patch pcre.patch
-                echo Configuring PCRE
-                ./configure CC_FOR_BUILD=gcc \
-                            CXX_FOR_BUILD=g++ \
-                            --host=mingw32 \
-                            --prefix=${DEPPKG_DIR} \
-                            --enable-utf8 \
-                            --enable-unicode-properties >make.log 2>&1
-        fi
-        echo Building PCRE
-        do_make Makefile PREFIX=${DEPPKG_DIR} all
-        echo Installing PCRE
-        do_make Makefile PREFIX=${DEPPKG_DIR} install
+   if get_source "${URL_PCRE}" "${DIR_PCRE}" "${MKD_PCRE}"
+   then
+           echo Patching PCRE
+           >patch.log
+           do_patch pcre.patch
+           echo Configuring PCRE
+           ./configure CC_FOR_BUILD=gcc \
+                       CXX_FOR_BUILD=g++ \
+                       --host=mingw32 \
+                       --prefix=${DEPPKG_DIR} \
+                       --enable-utf8 \
+                       --enable-unicode-properties >make.log 2>&1
+   fi
+   echo Building PCRE
+   do_make Makefile PREFIX=${DEPPKG_DIR} all
+   echo Installing PCRE
+   do_make Makefile PREFIX=${DEPPKG_DIR} install
 }
 
 process_pthreads()
 {
-        if get_source "${URL_PTHREADS}" "${DIR_PTHREADS}" "${MKD_PTHREADS}"
-        then
-                echo Patching pthreads
-                >patch.log
-                do_patch pthreads.patch
-        fi
-        echo Building pthreads
-        > make.log
-        do_make GNUmakefile GCE
-        echo Installing pthreads
-        rm -rf ${DEPPKG_DIR}/include/pthreads
-        mkdir ${DEPPKG_DIR}/include/pthreads
-        cp -p *.h ${DEPPKG_DIR}/include/pthreads
-        cp -p *.dll ${DEPPKG_DIR}/bin
-        cp -p *.a ${DEPPKG_DIR}/lib
+   if get_source "${URL_PTHREADS}" "${DIR_PTHREADS}" "${MKD_PTHREADS}"
+   then
+           echo Patching pthreads
+           >patch.log
+           do_patch pthreads.patch
+   fi
+   echo Building pthreads
+   > make.log
+   do_make GNUmakefile GCE
+   echo Installing pthreads
+   rm -rf ${DEPPKG_DIR}/include/pthreads
+   mkdir ${DEPPKG_DIR}/include/pthreads
+   cp -p *.h ${DEPPKG_DIR}/include/pthreads
+   cp -p *.dll ${DEPPKG_DIR}/bin
+   cp -p *.a ${DEPPKG_DIR}/lib
 }
 
 process_openssl()
 {
-        if get_source "${URL_OPENSSL}" "${DIR_OPENSSL}" "${MKD_OPENSSL}"
-        then
-                echo Patching openssl
-                >patch.log
-                do_patch openssl.patch
-                echo Configuring openssl
-                ./Configure --prefix=${DEPPKG_DIR} \
-                            shared zlib-dynamic \
-                            threads \
-                            --with-zlib-include=${DEPPKG_DIR}/include \
-                            mingw32 > make.log 2>&1
-        fi
-        echo Building openssl
-        perl util/mkdef.pl 32 libeay no-static-engine >ms/libeay32.def
-        perl util/mkdef.pl 32 ssleay >ms/ssleay32.def
-        do_make Makefile all
-        echo Installing openssl
-        do_make Makefile install_sw
+   if get_source "${URL_OPENSSL}" "${DIR_OPENSSL}" "${MKD_OPENSSL}"
+   then
+           echo Patching openssl
+           >patch.log
+           do_patch openssl.patch
+           echo Configuring openssl
+           ./Configure --prefix=${DEPPKG_DIR} \
+                       shared zlib-dynamic \
+                       threads \
+                       --with-zlib-include=${DEPPKG_DIR}/include \
+                       mingw32 > make.log 2>&1
+   fi
+   echo Building openssl
+   perl util/mkdef.pl 32 libeay no-static-engine >ms/libeay32.def
+   perl util/mkdef.pl 32 ssleay >ms/ssleay32.def
+   do_make Makefile all
+   echo Installing openssl
+   do_make Makefile install_sw
 }
 
 process_mysql()
 {
-        get_source "${URL_MYSQL}" "${DIR_MYSQL}" "${DIR_MYSQL}" "${MKD_MYSQL}"
-        echo Converting mysql lib file
-        if [ -e ${BIN_DIR}/reimp ]
-        then
-                reimp --dlltool ${BIN_DIR}/mingw32-dlltool --as ${BIN_DIR}/mingw32-as lib/opt/libmysql.lib
-        else
-                ${BIN_DIR}/../mingw32/bin/reimp --dlltool ${BIN_DIR}/mingw32-dlltool --as ${BIN_DIR}/mingw32-as lib/opt/libmysql.lib
-        fi
-        echo Installing mysql
-        cp -p liblibmysql.a ../../lib/libmysql.a
-        rm -rf ../../include/mysql
-        mkdir ../../include/mysql
-        cp -p include/* ../../include/mysql 2>&1 | grep -v 'omitting directory'
-        cp -p lib/opt/libmysql.dll ../../bin
+   get_source "${URL_MYSQL}" "${DIR_MYSQL}" "${DIR_MYSQL}" "${MKD_MYSQL}"
+   echo Converting mysql lib file
+   if [ -e ${BIN_DIR}/reimp ]
+   then
+           reimp --dlltool ${BIN_DIR}/mingw32-dlltool --as ${BIN_DIR}/mingw32-as lib/opt/libmysql.lib
+   else
+           ${BIN_DIR}/../mingw32/bin/reimp --dlltool ${BIN_DIR}/mingw32-dlltool --as ${BIN_DIR}/mingw32-as lib/opt/libmysql.lib
+   fi
+   echo Installing mysql
+   cp -p liblibmysql.a ../../lib/libmysql.a
+   rm -rf ../../include/mysql
+   mkdir ../../include/mysql
+   cp -p include/* ../../include/mysql 2>&1 | grep -v 'omitting directory'
+   cp -p lib/opt/libmysql.dll ../../bin
 }
 
 process_postgresql()
 {
-        if get_source "${URL_POSTGRESQL}" "${DIR_POSTGRESQL}" "${MKD_POSTGRESQL}"
-        then
-                echo Patching postgreSQL
-                >patch.log
-                do_patch postgresql.patch
-
-                # We need a native version of zic to build the timezone tables.
-                echo Configuring postgreSQL to build native zic
-                ./configure > make.log 2>&1
-
-                echo Building native zic
-                cd src/timezone
-                do_make Makefile >> make.log 2>&1
-                cp zic ../..
-                cd ../..
-                do_make GNUmakefile distclean >> make.log 2>&1
-
-                echo Configuring postgreSQL for MinGW32
-
-                ./configure --host=mingw32 \
-                            --enable-shared \
-                            --enable-thread-safety \
-                            --prefix=${DEPPKG_DIR} \
-                            --with-includes=${DEPPKG_DIR}/include:${DEPPKG_DIR}/include/pthreads \
-                            --with-libraries=${DEPPKG_DIR}/lib >> make.log 2>&1
-        fi
-        echo Building postgreSQL
-        ZIC=`pwd`/zic
-        do_make GNUmakefile AR=mingw32-ar DLLTOOL=mingw32-dlltool DLLWRAP=mingw32-dllwrap WINDRES=mingw32-windres PTHREAD_LIBS=-lpthreadGCE ZIC=${ZIC}
-        echo Installing postgreSQL
-        do_make GNUmakefile AR=mingw32-ar DLLTOOL=mingw32-dlltool DLLWRAP=mingw32-dllwrap WINDRES=mingw32-windres PTHREAD_LIBS=-lpthreadGCE ZIC=${ZIC} install
+   if get_source "${URL_POSTGRESQL}" "${DIR_POSTGRESQL}" "${MKD_POSTGRESQL}"
+   then
+           echo Patching postgreSQL
+           >patch.log
+           do_patch postgresql.patch
+
+           # We need a native version of zic to build the timezone tables.
+           echo Configuring postgreSQL to build native zic
+           ./configure > make.log 2>&1
+
+           echo Building native zic
+           cd src/timezone
+           do_make Makefile >> make.log 2>&1
+           cp zic ../..
+           cd ../..
+           do_make GNUmakefile distclean >> make.log 2>&1
+
+           echo Configuring postgreSQL for MinGW32
+
+           ./configure --host=mingw32 \
+                       --enable-shared \
+                       --enable-thread-safety \
+                       --prefix=${DEPPKG_DIR} \
+                       --with-includes=${DEPPKG_DIR}/include:${DEPPKG_DIR}/include/pthreads \
+                       --with-libraries=${DEPPKG_DIR}/lib >> make.log 2>&1
+   fi
+   echo Building postgreSQL
+   ZIC=`pwd`/zic
+   do_make GNUmakefile AR=mingw32-ar DLLTOOL=mingw32-dlltool DLLWRAP=mingw32-dllwrap WINDRES=mingw32-windres PTHREAD_LIBS=-lpthreadGCE ZIC=${ZIC}
+   echo Installing postgreSQL
+   do_make GNUmakefile AR=mingw32-ar DLLTOOL=mingw32-dlltool DLLWRAP=mingw32-dllwrap WINDRES=mingw32-windres PTHREAD_LIBS=-lpthreadGCE ZIC=${ZIC} install
 }
 
 process_sqlite()
 {
-        if get_source "${URL_SQLITE}" "${DIR_SQLITE}" "${MKD_SQLITE}"
-        then
-                echo Patching SQLite
-                >patch.log
-                do_patch sqlite.patch
-        fi
-        echo Building SQLite
-        [ ! -e bld ] && mkdir bld
-        cd bld
-        > make.log
-        do_make ../Makefile.mingw32 CROSSTOOLS=${BIN_DIR} TLIBS="-L${DEPPKG_DIR}/lib" TCL_FLAGS="-I${DEPPKG_DIR}/include"
-        echo Installing SQLite
-        cp -p sqlite3.exe ${DEPPKG_DIR}/bin
-        cp -p libsqlite3.a ${DEPPKG_DIR}/lib
-        cp -p sqlite3.h ${DEPPKG_DIR}/include
+   if get_source "${URL_SQLITE}" "${DIR_SQLITE}" "${MKD_SQLITE}"
+   then
+           echo Patching SQLite
+           >patch.log
+           do_patch sqlite.patch
+   fi
+   echo Building SQLite
+   [ ! -e bld ] && mkdir bld
+   cd bld
+   > make.log
+   do_make ../Makefile.mingw32 CROSSTOOLS=${BIN_DIR} TLIBS="-L${DEPPKG_DIR}/lib" TCL_FLAGS="-I${DEPPKG_DIR}/include"
+   echo Installing SQLite
+   cp -p sqlite3.exe ${DEPPKG_DIR}/bin
+   cp -p libsqlite3.a ${DEPPKG_DIR}/lib
+   cp -p sqlite3.h ${DEPPKG_DIR}/include
 }
 
 process_wx()
 {
-        if get_source "${URL_WX}" "${DIR_WX}" "${MKD_WX}"
-        then
-                echo Patching wxWidgets
-                >patch.log
-                do_patch wx1.patch -o build/msw/config.mingw32
-                do_patch wx2.patch
-                find . -name makefile.gcc -exec sh -c "sed -f ${SCRIPT_DIR}/patches/wx.sed {} > \`echo {} | sed -e 's/\.gcc$/\.mingw32/'\`" \;
-        fi
-        echo Building wxWidgets
-        cd build/msw
-        > make.log
-        do_make makefile.mingw32 SHARED=1 VENDOR=bacula DEBUG_INFO=1
-        echo Installing wxWidgets
-        cd ../..
-        rm -rf ../../include/wx
-        mkdir ../../include/wx
-        cp -p include/wx/* ../../include/wx 2>&1 | grep -v 'omitting directory'
-        mkdir ../../include/wx/generic
-        cp -p include/wx/generic/* ../../include/wx/generic 2>&1 | grep -v 'omitting directory'
-        mkdir ../../include/wx/msw
-        cp -p include/wx/msw/* ../../include/wx/msw 2>&1 | grep -v 'omitting directory'
-        mkdir ../../include/wx/msw/ole
-        cp -p include/wx/msw/ole/* ../../include/wx/msw/ole 2>&1 | grep -v 'omitting directory'
-        cp -p lib/gcc_dll/*.dll ../../bin
-        rm -rf ../../lib/wx_dll
-        mkdir ../../lib/wx_dll
-        cp -p lib/gcc_dll/*.a ../../lib/wx_dll
-        mkdir ../../lib/wx_dll/msw
-        cp -p lib/gcc_dll/msw/* ../../lib/wx_dll/msw 2>&1 | grep -v 'omitting directory'
-        mkdir ../../lib/wx_dll/msw/wx
-        cp -p lib/gcc_dll/msw/wx/* ../../lib/wx_dll/msw/wx 2>&1 | grep -v 'omitting directory'
-        mkdir ../../lib/wx_dll/msw/wx/msw
-        cp -p lib/gcc_dll/msw/wx/msw/* ../../lib/wx_dll/msw/wx/msw 2>&1 | grep -v 'omitting directory'
+   if get_source "${URL_WX}" "${DIR_WX}" "${MKD_WX}"
+   then
+      echo Patching wxWidgets
+      >patch.log
+      cp build/msw/config.gcc build/msw/config.mingw32
+      do_patch wxWidgets.patch
+      find . -name makefile.gcc -exec sh -c "sed -f ${SCRIPT_DIR}/patches/wx.sed {} > \`echo {} | sed -e 's/\.gcc$/\.mingw32/'\`" \;
+   fi
+   echo Building wxWidgets
+   cd build/msw
+   > make.log
+   do_make makefile.mingw32 SHARED=1 VENDOR=bacula DEBUG_INFO=1
+   echo Installing wxWidgets
+   cd ../..
+   rm -rf ../../include/wx
+   mkdir ../../include/wx
+   cp -p include/wx/* ../../include/wx 2>&1 | grep -v 'omitting directory'
+   mkdir ../../include/wx/generic
+   cp -p include/wx/generic/* ../../include/wx/generic 2>&1 | grep -v 'omitting directory'
+   mkdir ../../include/wx/msw
+   cp -p include/wx/msw/* ../../include/wx/msw 2>&1 | grep -v 'omitting directory'
+   mkdir ../../include/wx/msw/ole
+   cp -p include/wx/msw/ole/* ../../include/wx/msw/ole 2>&1 | grep -v 'omitting directory'
+   cp -p lib/gcc_dll/*.dll ../../bin
+   rm -rf ../../lib/wx_dll
+   mkdir ../../lib/wx_dll
+   cp -p lib/gcc_dll/*.a ../../lib/wx_dll
+   mkdir ../../lib/wx_dll/msw
+   cp -p lib/gcc_dll/msw/* ../../lib/wx_dll/msw 2>&1 | grep -v 'omitting directory'
+   mkdir ../../lib/wx_dll/msw/wx
+   cp -p lib/gcc_dll/msw/wx/* ../../lib/wx_dll/msw/wx 2>&1 | grep -v 'omitting directory'
+   mkdir ../../lib/wx_dll/msw/wx/msw
+   cp -p lib/gcc_dll/msw/wx/msw/* ../../lib/wx_dll/msw/wx/msw 2>&1 | grep -v 'omitting directory'
 }
 
 process_scons()
 {
-        get_source "${URL_SCONS}" "${DIR_SCONS}" "${MKD_SCONS}"
-        echo "Installing scons"
-        if python setup.py install --prefix=${DEPPKG_DIR}/scons > make.log 2>&1
-        then
-                :
-        else
-                echo "Make failed - Check `pwd`/make.log"
-                exit 1
-        fi
+   get_source "${URL_SCONS}" "${DIR_SCONS}" "${MKD_SCONS}"
+   echo "Installing scons"
+   if python setup.py install --prefix=${DEPPKG_DIR}/scons > make.log 2>&1
+   then
+           :
+   else
+           echo "Make failed - Check `pwd`/make.log"
+           exit 1
+   fi
 }
 
 process_nsis()
 {
-        get_source "${URL_NSIS_BIN}" "${DIR_NSIS_BIN}" "${MKD_NSIS_BIN}"
-        cd ..
-        rm -rf ../nsis
-        mv nsis-2.17 ../nsis
-        if get_source "${URL_NSIS_SRC}" "${DIR_NSIS_SRC}" "${MKD_NSIS_SRC}"
-        then
-                echo "Patching nsis"
-                >patch.log
-                do_patch nsis.patch
-        fi
-        echo "Building nsis"
-        if ../../scons/bin/scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all \
-                PREFIX=${DEPPKG_DIR}/nsis PREFIX_BIN=${DEPPKG_DIR}/nsis/Bin \
-                PREFIX_CONF=${DEPPKG_DIR}/nsis PREFIX_DATA=${DEPPKG_DIR}/nsis \
-                PREFIX_DOC=${DEPPKG_DIR}/nsis/Docs 2>&1 | tee make.log | parse_output
-        then
-                :
-        else
-                echo "Scons failed - Check `pwd`/make.log"
-                exit 1
-        fi
-        echo "Installing nsis"
-        cp -p build/release/makensis/makensis ../../nsis
+   get_source "${URL_NSIS_BIN}" "${DIR_NSIS_BIN}" "${MKD_NSIS_BIN}"
+   cd ..
+   rm -rf ../nsis
+   mv nsis-2.17 ../nsis
+   if get_source "${URL_NSIS_SRC}" "${DIR_NSIS_SRC}" "${MKD_NSIS_SRC}"
+   then
+           echo "Patching nsis"
+           >patch.log
+           do_patch nsis.patch
+   fi
+   echo "Building nsis"
+   if ../../scons/bin/scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all \
+           PREFIX=${DEPPKG_DIR}/nsis PREFIX_BIN=${DEPPKG_DIR}/nsis/Bin \
+           PREFIX_CONF=${DEPPKG_DIR}/nsis PREFIX_DATA=${DEPPKG_DIR}/nsis \
+           PREFIX_DOC=${DEPPKG_DIR}/nsis/Docs 2>&1 | tee make.log | parse_output
+   then
+           :
+   else
+           echo "Scons failed - Check `pwd`/make.log"
+           exit 1
+   fi
+   echo "Installing nsis"
+   cp -p build/release/makensis/makensis ../../nsis
 }
 
 process_mtx()
@@ -457,41 +457,41 @@ process_stab2cv()
 
 process_cmd_utils()
 {
-        if get_source "${URL_CMD_UTILS}" "${DIR_CMD_UTILS}" "${MKD_CMD_UTILS}"
-        then
-                # echo Patching cmd-utils
-                # >patch.log
-                # do_patch cmd-utils.patch
-                echo Configuring cmd-utils
-                ./configure --host=mingw32 \
-                            --prefix=${DEPPKG_DIR} \
-                            >make.log 2>&1
-        fi
-        echo Building cmd-utils
-        do_make Makefile 
-        echo Installing cmd-utils
-        do_make Makefile install
+   if get_source "${URL_CMD_UTILS}" "${DIR_CMD_UTILS}" "${MKD_CMD_UTILS}"
+   then
+           # echo Patching cmd-utils
+           # >patch.log
+           # do_patch cmd-utils.patch
+           echo Configuring cmd-utils
+           ./configure --host=mingw32 \
+                       --prefix=${DEPPKG_DIR} \
+                       >make.log 2>&1
+   fi
+   echo Building cmd-utils
+   do_make Makefile 
+   echo Installing cmd-utils
+   do_make Makefile install
 }
 
 process_mkisofs()
 {
-        get_source "${URL_MKISOFS}" "${DIR_MKISOFS}" "${MKD_MKISOFS}"
-        echo Installing mkisofs
-        cp `basename ${URL_MKISOFS}` ${DEPPKG_DIR}/bin
+   get_source "${URL_MKISOFS}" "${DIR_MKISOFS}" "${MKD_MKISOFS}"
+   echo Installing mkisofs
+   cp `basename ${URL_MKISOFS}` ${DEPPKG_DIR}/bin
 }
 
 process_dvd_rw_tools()
 {
-        if get_source "${URL_DVD_RW_TOOLS}" "${DIR_DVD_RW_TOOLS}" "${MKD_DVD_RW_TOOLS}"
-        then
-                echo Patching dvd+rw-tools
-                >patch.log
-                do_patch dvd+rw-tools.patch
-        fi
-        echo "Building dvd+rw-tools"
-        m4 -DOS=XMINGW32 Makefile.m4 | make -f - dvd+rw-tools >make.log 2>&1
-        echo "Installing dvd+rw-tools"
-        m4 -DOS=XMINGW32 Makefile.m4 | make -f - prefix=${DEPPKG_DIR} manprefix=${DEPPKG_DIR} install >>make.log 2>&1
+   if get_source "${URL_DVD_RW_TOOLS}" "${DIR_DVD_RW_TOOLS}" "${MKD_DVD_RW_TOOLS}"
+   then
+           echo Patching dvd+rw-tools
+           >patch.log
+           do_patch dvd+rw-tools.patch
+   fi
+   echo "Building dvd+rw-tools"
+   m4 -DOS=XMINGW32 Makefile.m4 | make -f - dvd+rw-tools >make.log 2>&1
+   echo "Installing dvd+rw-tools"
+   m4 -DOS=XMINGW32 Makefile.m4 | make -f - prefix=${DEPPKG_DIR} manprefix=${DEPPKG_DIR} install >>make.log 2>&1
 }
 
 process_qt4()
@@ -502,30 +502,29 @@ process_qt4()
 
 if [ "$#" -eq 0 ]
 then
-        process_zlib
-        process_pcre
-        process_pthreads
-        process_openssl
-        process_mysql
-        process_sqlite
-        process_postgresql
-        process_wx
-        process_scons
-        process_nsis
-        process_mtx
-        process_mt
-        process_sed
-        process_stab2cv
-        process_cmd_utils
-        process_mkisofs
-        process_dvd_rw_tools
-        process_qt4
+   process_zlib
+   process_pcre
+   process_pthreads
+   process_openssl
+   process_mysql
+   process_sqlite
+   process_postgresql
+   process_wx
+   process_scons
+   process_nsis
+   process_mtx
+   process_mt
+   process_sed
+   process_stab2cv
+   process_cmd_utils
+   process_mkisofs
+   process_dvd_rw_tools
+   process_qt4
 else
-        for dependency in "$@"
-        do
-                eval "process_${dependency}"
-        done
-
+   for dependency in "$@"
+   do
+      eval "process_${dependency}"
+   done
 fi
 #vss
 #Need to download from Microsoft
index 5f50e3fd11b472bca400c665f0f20662b96783d1..14a97cf239b30cd333ccb505f87ba0973ecb792d 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2004-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -584,12 +584,13 @@ statDir(const char *file, struct stat *sb)
    WIN32_FIND_DATAA info_a;       // window's file info
 
    // cache some common vars to make code more transparent
-   DWORD* pdwFileAttributes;
-   DWORD* pnFileSizeHigh;
-   DWORD* pnFileSizeLow;
-   FILETIME* pftLastAccessTime;
-   FILETIME* pftLastWriteTime;
-   FILETIME* pftCreationTime;
+   DWORD *pdwFileAttributes;
+   DWORD *pnFileSizeHigh;
+   DWORD *pnFileSizeLow;
+   DWORD *pdwReserved0;
+   FILETIME *pftLastAccessTime;
+   FILETIME *pftLastWriteTime;
+   FILETIME *pftCreationTime;
 
    if (file[1] == ':' && file[2] == 0) {
         Dmsg1(99, "faking ROOT attrs(%s).\n", file);
@@ -612,6 +613,7 @@ statDir(const char *file, struct stat *sb)
       free_pool_memory(pwszBuf);
 
       pdwFileAttributes = &info_w.dwFileAttributes;
+      pdwReserved0      = &info_w.dwReserved0;
       pnFileSizeHigh    = &info_w.nFileSizeHigh;
       pnFileSizeLow     = &info_w.nFileSizeLow;
       pftLastAccessTime = &info_w.ftLastAccessTime;
@@ -623,6 +625,7 @@ statDir(const char *file, struct stat *sb)
       h = p_FindFirstFileA(file, &info_a);
 
       pdwFileAttributes = &info_a.dwFileAttributes;
+      pdwReserved0      = &info_a.dwReserved0;
       pnFileSizeHigh    = &info_a.nFileSizeHigh;
       pnFileSizeLow     = &info_a.nFileSizeLow;
       pftLastAccessTime = &info_a.ftLastAccessTime;
@@ -649,7 +652,9 @@ statDir(const char *file, struct stat *sb)
 
    /* Use st_rdev to store reparse attribute */
    sb->st_rdev = (*pdwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) ? 1 : 0; 
-
+   if (sb->st_rdev == 1 && *pdwReserved0 & IO_REPARSE_TAG_MOUNT_POINT) {
+      sb->st_rdev = 2;                /* mount point */
+   }
 
    sb->st_size = *pnFileSizeHigh;
    sb->st_size <<= 32;
@@ -740,9 +745,6 @@ stat2(const char *file, struct stat *sb)
       return -1;
    }
 
-   if (attr & FILE_ATTRIBUTE_DIRECTORY) {
-      return statDir(tmpbuf, sb);
-   }
 
    h = CreateFileA(tmpbuf, GENERIC_READ,
                   FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
@@ -758,6 +760,10 @@ stat2(const char *file, struct stat *sb)
    rval = fstat((int)h, sb);
    CloseHandle(h);
 
+   if (attr & FILE_ATTRIBUTE_DIRECTORY) {
+      return statDir(tmpbuf, sb);
+   }
+
    return rval;
 }
 
@@ -824,6 +830,9 @@ stat(const char *file, struct stat *sb)
    sb->st_atime = cvt_ftime_to_utime(data.ftLastAccessTime);
    sb->st_mtime = cvt_ftime_to_utime(data.ftLastWriteTime);
    sb->st_ctime = cvt_ftime_to_utime(data.ftCreationTime);
+   if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+      return statDir(file, sb);
+   }
    return 0;
 }
 
index f3b904963bed96df2a8ea0464af78022450f8b40..3c0ee400d6c9e6503e8f1ac3278982d18206b60c 100644 (file)
@@ -58,8 +58,8 @@ DEPKGS_BINARIES := \
        dvd+rw-booktype.exe \
        dvd+rw-format.exe \
        dvd+rw-mediainfo.exe \
-       wxbase270_gcc_bacula.dll \
-       wxmsw270_core_gcc_bacula.dll
+       wxbase28_gcc_bacula.dll \
+       wxmsw28_core_gcc_bacula.dll
 
 NONGCC_BINARIES := \
        libmysql.dll
index b4faacddfe12a3a776e567ee204ebac6d5621ff4..385537ea39e1026f623c26e81d7e47c1e4ddd69e 100644 (file)
@@ -12,7 +12,7 @@ SET BACULA_DLLS=bacula.dll cats_mysql.dll cats_postgresql.dll cats_sqlite3.dll
 SET BACULA_EXES=bacula-dir.exe bacula-fd.exe bacula-sd.exe bconsole.exe wx-console.exe\r
 SET BACULA_TOOLS=bcopy.exe bextract.exe bls.exe bscan.exe bsleep.exe bsmtp.exe btape.exe dbcheck.exe scsilist.exe\r
 \r
-SET DEP_DLLS=libeay32.dll pthreadVCE.dll ssleay32.dll zlib1.dll zlib1.dll.manifest wxbase270_vc_bacula.dll wxmsw270_core_vc_bacula.dll libmysql.dll libpq.dll comerr32.dll libintl-2.dll libiconv-2.dll krb5_32.dll\r
+SET DEP_DLLS=libeay32.dll pthreadVCE.dll ssleay32.dll zlib1.dll zlib1.dll.manifest wxbase28_vc_bacula.dll wxmsw28_core_vc_bacula.dll libmysql.dll libpq.dll comerr32.dll libintl-2.dll libiconv-2.dll krb5_32.dll\r
 SET DEP_EXES=openssl.exe loaderinfo.exe mt.exe mtx.exe scsitape.exe sed.exe tapeinfo.exe sqlite3.exe sqlite3.exe.manifest expr64.exe snooze.exe mkisofs.exe growisofs.exe dvd-ram-control.exe dvd+rw-booktype.exe dvd+rw-format.exe dvd+rw-mediainfo.exe\r
 \r
 SET SCRIPTS=mtx-changer.cmd disk-changer.cmd dvd-handler.cmd\r
index ca5216628d2bb07d16ab2c56493e45ce4e7cfced..f360c6dc28a03c66bff4713ff10e9064c8f95605 100644 (file)
@@ -787,16 +787,16 @@ Section "Graphical Console" SecWxConsole
 \r
   Call InstallCommonFiles\r
 !if "${BUILD_TOOLS}" == "VC8"\r
-  File "${SRC_DIR}\wxbase270_vc_bacula.dll"\r
-  File "${SRC_DIR}\wxmsw270_core_vc_bacula.dll"\r
+  File "${SRC_DIR}\wxbase28_vc_bacula.dll"\r
+  File "${SRC_DIR}\wxmsw28_core_vc_bacula.dll"\r
 !endif\r
 !If "${BUILD_TOOLS}" == "VC8_DEBUG"\r
-  File "${SRC_DIR}\wxbase270_vc_bacula.dll"\r
-  File "${SRC_DIR}\wxmsw270_core_vc_bacula.dll"\r
+  File "${SRC_DIR}\wxbase28_vc_bacula.dll"\r
+  File "${SRC_DIR}\wxmsw28_core_vc_bacula.dll"\r
 !endif\r
 !if "${BUILD_TOOLS}" == "MinGW"\r
-  File "${SRC_DIR}\wxbase270_gcc_bacula.dll"\r
-  File "${SRC_DIR}\wxmsw270_core_gcc_bacula.dll"\r
+  File "${SRC_DIR}\wxbase28_gcc_bacula.dll"\r
+  File "${SRC_DIR}\wxmsw28_core_gcc_bacula.dll"\r
 !endif\r
 \r
   File "${SRC_DIR}\bwx-console.exe"\r
index ee93c79d5987a0cd95a5adcf171140ce0e04e5bc..bab6aca1689e4ea10d7a8825df1103a1dce82e4a 100644 (file)
 <?xml version="1.0" encoding="Windows-1252"?>\r
 <VisualStudioProject\r
-       ProjectType="Visual C++"\r
-       Version="8.00"\r
-       Name="wx-console"\r
-       ProjectGUID="{9BA8E10D-0D82-4B25-8543-DE34641FBC10}"\r
-       RootNamespace="wx-console"\r
-       >\r
-       <Platforms>\r
-               <Platform\r
-                       Name="Win32"\r
-               />\r
-       </Platforms>\r
-       <ToolFiles>\r
-       </ToolFiles>\r
-       <Configurations>\r
-               <Configuration\r
-                       Name="Debug|Win32"\r
-                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
-                       IntermediateDirectory="$(ConfigurationName)"\r
-                       ConfigurationType="1"\r
-                       CharacterSet="2"\r
-                       DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;$(TargetPath)"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               Optimization="0"\r
-                               AdditionalIncludeDirectories="../compat;../../../../depkgs-msvc/include;../..;../../../../depkgs-msvc/lib/wx_dll/msw"\r
-                               PreprocessorDefinitions="WIN32;_WINDOWS;wxUSE_GUI;WXUSINGDLL;__WXMSW__;_CONSOLE;HAVE_WIN32;HAVE_WXCONSOLE;USING_DLL;_STAT_H;_STAT_DEFINED;_USE_32BIT_TIME_T;_WIN32_WINNT=0x0500;_CRT_SECURE_NO_DEPRECATE"\r
-                               MinimalRebuild="true"\r
-                               BasicRuntimeChecks="3"\r
-                               RuntimeLibrary="3"\r
-                               UsePrecompiledHeader="0"\r
-                               BrowseInformation="1"\r
-                               WarningLevel="3"\r
-                               SuppressStartupBanner="true"\r
-                               Detect64BitPortabilityProblems="false"\r
-                               DebugInformationFormat="4"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="wxmsw27_core.lib wxbase27.lib pthreadVCE.lib zlib.lib wsock32.lib comctl32.lib rpcrt4.lib atlsd.lib"\r
-                               LinkIncremental="2"\r
-                               AdditionalLibraryDirectories="../../../../depkgs-msvc/lib;../../../../depkgs-msvc/lib/wx_dll"\r
-                               GenerateDebugInformation="true"\r
-                               SubSystem="2"\r
-                               TargetMachine="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|Win32"\r
-                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
-                       IntermediateDirectory="$(ConfigurationName)"\r
-                       ConfigurationType="1"\r
-                       CharacterSet="2"\r
-                       DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;$(TargetPath)"\r
-                       WholeProgramOptimization="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               AdditionalIncludeDirectories="../compat;../../../../depkgs-msvc/include;../..;../../../../depkgs-msvc\lib\wx_dll\msw"\r
-                               PreprocessorDefinitions="NDEBUG;_WINDOWS;wxUSE_GUI;WXUSINGDLL;__WXMSW__;HAVE_WIN32;HAVE_WXCONSOLE;USING_DLL;_STAT_H;_STAT_DEFINED;_USE_32BIT_TIME_T;_WIN32_WINNT=0x0500;_CRT_SECURE_NO_DEPRECATE"\r
-                               RuntimeLibrary="2"\r
-                               UsePrecompiledHeader="0"\r
-                               BrowseInformation="1"\r
-                               WarningLevel="3"\r
-                               Detect64BitPortabilityProblems="false"\r
-                               DebugInformationFormat="3"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="wxmsw27_core.lib wxbase27.lib pthreadVCE.lib zlib.lib wsock32.lib comctl32.lib rpcrt4.lib atls.lib"\r
-                               LinkIncremental="0"\r
-                               AdditionalLibraryDirectories="&quot;../../../../depkgs-msvc/lib&quot;;&quot;../../../../depkgs-msvc/lib/wx_dll&quot;"\r
-                               IgnoreDefaultLibraryNames=""\r
-                               GenerateDebugInformation="true"\r
-                               SubSystem="2"\r
-                               OptimizeReferences="2"\r
-                               EnableCOMDATFolding="2"\r
-                               TargetMachine="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-       </Configurations>\r
-       <References>\r
-       </References>\r
-       <Files>\r
-               <Filter\r
-                       Name="Header Files"\r
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
-                       >\r
-                       <File\r
-                               RelativePath="..\..\wx-console\console_conf.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\console_thread.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\csprint.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\w32api.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wx-console_private.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbconfigfileeditor.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbconfigpanel.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbhistorytextctrl.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxblistctrl.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbmainframe.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbrestorepanel.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbtableparser.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbtreectrl.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbutils.h"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Resource Files"\r
-                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
-                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
-                       >\r
-                       <File\r
-                               RelativePath=".\wx-console.manifest"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wx-console_private.rc"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Source Files"\r
-                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
-                       >\r
-                       <File\r
-                               RelativePath="..\..\wx-console\authenticate.c"\r
-                               >\r
-                               <FileConfiguration\r
-                                       Name="Debug|Win32"\r
-                                       >\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                               CompileAs="2"\r
-                                       />\r
-                               </FileConfiguration>\r
-                               <FileConfiguration\r
-                                       Name="Release|Win32"\r
-                                       >\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                               CompileAs="2"\r
-                                       />\r
-                               </FileConfiguration>\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\console_conf.c"\r
-                               >\r
-                               <FileConfiguration\r
-                                       Name="Debug|Win32"\r
-                                       >\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                               CompileAs="2"\r
-                                       />\r
-                               </FileConfiguration>\r
-                               <FileConfiguration\r
-                                       Name="Release|Win32"\r
-                                       >\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                               CompileAs="2"\r
-                                       />\r
-                               </FileConfiguration>\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\console_thread.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\main.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbconfigfileeditor.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbconfigpanel.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbhistorytextctrl.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxblistctrl.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbmainframe.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbrestorepanel.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbtableparser.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbtreectrl.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\wx-console\wxbutils.cpp"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-       </Files>\r
-       <Globals>\r
-       </Globals>\r
+        ProjectType="Visual C++"\r
+        Version="8.00"\r
+        Name="wx-console"\r
+        ProjectGUID="{9BA8E10D-0D82-4B25-8543-DE34641FBC10}"\r
+        RootNamespace="wx-console"\r
+        >\r
+        <Platforms>\r
+                <Platform\r
+                        Name="Win32"\r
+                />\r
+        </Platforms>\r
+        <ToolFiles>\r
+        </ToolFiles>\r
+        <Configurations>\r
+                <Configuration\r
+                        Name="Debug|Win32"\r
+                        OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                        IntermediateDirectory="$(ConfigurationName)"\r
+                        ConfigurationType="1"\r
+                        CharacterSet="2"\r
+                        DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;$(TargetPath)"\r
+                        >\r
+                        <Tool\r
+                                Name="VCPreBuildEventTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCCustomBuildTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCXMLDataGeneratorTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCWebServiceProxyGeneratorTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCMIDLTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCCLCompilerTool"\r
+                                Optimization="0"\r
+                                AdditionalIncludeDirectories="../compat;../../../../depkgs-msvc/include;../..;../../../../depkgs-msvc/lib/wx_dll/msw"\r
+                                PreprocessorDefinitions="WIN32;_WINDOWS;wxUSE_GUI;WXUSINGDLL;__WXMSW__;_CONSOLE;HAVE_WIN32;HAVE_WXCONSOLE;USING_DLL;_STAT_H;_STAT_DEFINED;_USE_32BIT_TIME_T;_WIN32_WINNT=0x0500;_CRT_SECURE_NO_DEPRECATE"\r
+                                MinimalRebuild="true"\r
+                                BasicRuntimeChecks="3"\r
+                                RuntimeLibrary="3"\r
+                                UsePrecompiledHeader="0"\r
+                                BrowseInformation="1"\r
+                                WarningLevel="3"\r
+                                SuppressStartupBanner="true"\r
+                                Detect64BitPortabilityProblems="false"\r
+                                DebugInformationFormat="4"\r
+                        />\r
+                        <Tool\r
+                                Name="VCManagedResourceCompilerTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCResourceCompilerTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCPreLinkEventTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCLinkerTool"\r
+                                AdditionalDependencies="wxmsw28_core.lib wxbase27.lib pthreadVCE.lib zlib.lib wsock32.lib comctl32.lib rpcrt4.lib atlsd.lib"\r
+                                LinkIncremental="2"\r
+                                AdditionalLibraryDirectories="../../../../depkgs-msvc/lib;../../../../depkgs-msvc/lib/wx_dll"\r
+                                GenerateDebugInformation="true"\r
+                                SubSystem="2"\r
+                                TargetMachine="1"\r
+                        />\r
+                        <Tool\r
+                                Name="VCALinkTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCManifestTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCXDCMakeTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCBscMakeTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCFxCopTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCAppVerifierTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCWebDeploymentTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCPostBuildEventTool"\r
+                        />\r
+                </Configuration>\r
+                <Configuration\r
+                        Name="Release|Win32"\r
+                        OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                        IntermediateDirectory="$(ConfigurationName)"\r
+                        ConfigurationType="1"\r
+                        CharacterSet="2"\r
+                        DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;$(TargetPath)"\r
+                        WholeProgramOptimization="1"\r
+                        >\r
+                        <Tool\r
+                                Name="VCPreBuildEventTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCCustomBuildTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCXMLDataGeneratorTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCWebServiceProxyGeneratorTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCMIDLTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCCLCompilerTool"\r
+                                AdditionalIncludeDirectories="../compat;../../../../depkgs-msvc/include;../..;../../../../depkgs-msvc\lib\wx_dll\msw"\r
+                                PreprocessorDefinitions="NDEBUG;_WINDOWS;wxUSE_GUI;WXUSINGDLL;__WXMSW__;HAVE_WIN32;HAVE_WXCONSOLE;USING_DLL;_STAT_H;_STAT_DEFINED;_USE_32BIT_TIME_T;_WIN32_WINNT=0x0500;_CRT_SECURE_NO_DEPRECATE"\r
+                                RuntimeLibrary="2"\r
+                                UsePrecompiledHeader="0"\r
+                                BrowseInformation="1"\r
+                                WarningLevel="3"\r
+                                Detect64BitPortabilityProblems="false"\r
+                                DebugInformationFormat="3"\r
+                        />\r
+                        <Tool\r
+                                Name="VCManagedResourceCompilerTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCResourceCompilerTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCPreLinkEventTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCLinkerTool"\r
+                                AdditionalDependencies="wxmsw28_core.lib wxbase27.lib pthreadVCE.lib zlib.lib wsock32.lib comctl32.lib rpcrt4.lib atls.lib"\r
+                                LinkIncremental="0"\r
+                                AdditionalLibraryDirectories="&quot;../../../../depkgs-msvc/lib&quot;;&quot;../../../../depkgs-msvc/lib/wx_dll&quot;"\r
+                                IgnoreDefaultLibraryNames=""\r
+                                GenerateDebugInformation="true"\r
+                                SubSystem="2"\r
+                                OptimizeReferences="2"\r
+                                EnableCOMDATFolding="2"\r
+                                TargetMachine="1"\r
+                        />\r
+                        <Tool\r
+                                Name="VCALinkTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCManifestTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCXDCMakeTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCBscMakeTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCFxCopTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCAppVerifierTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCWebDeploymentTool"\r
+                        />\r
+                        <Tool\r
+                                Name="VCPostBuildEventTool"\r
+                        />\r
+                </Configuration>\r
+        </Configurations>\r
+        <References>\r
+        </References>\r
+        <Files>\r
+                <Filter\r
+                        Name="Header Files"\r
+                        Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                        UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                        >\r
+                        <File\r
+                                RelativePath="..\..\wx-console\console_conf.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\console_thread.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\csprint.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath=".\w32api.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wx-console_private.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbconfigfileeditor.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbconfigpanel.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbhistorytextctrl.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxblistctrl.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbmainframe.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbrestorepanel.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbtableparser.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbtreectrl.h"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbutils.h"\r
+                                >\r
+                        </File>\r
+                </Filter>\r
+                <Filter\r
+                        Name="Resource Files"\r
+                        Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
+                        UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                        >\r
+                        <File\r
+                                RelativePath=".\wx-console.manifest"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wx-console_private.rc"\r
+                                >\r
+                        </File>\r
+                </Filter>\r
+                <Filter\r
+                        Name="Source Files"\r
+                        Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                        UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                        >\r
+                        <File\r
+                                RelativePath="..\..\wx-console\authenticate.c"\r
+                                >\r
+                                <FileConfiguration\r
+                                        Name="Debug|Win32"\r
+                                        >\r
+                                        <Tool\r
+                                                Name="VCCLCompilerTool"\r
+                                                CompileAs="2"\r
+                                        />\r
+                                </FileConfiguration>\r
+                                <FileConfiguration\r
+                                        Name="Release|Win32"\r
+                                        >\r
+                                        <Tool\r
+                                                Name="VCCLCompilerTool"\r
+                                                CompileAs="2"\r
+                                        />\r
+                                </FileConfiguration>\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\console_conf.c"\r
+                                >\r
+                                <FileConfiguration\r
+                                        Name="Debug|Win32"\r
+                                        >\r
+                                        <Tool\r
+                                                Name="VCCLCompilerTool"\r
+                                                CompileAs="2"\r
+                                        />\r
+                                </FileConfiguration>\r
+                                <FileConfiguration\r
+                                        Name="Release|Win32"\r
+                                        >\r
+                                        <Tool\r
+                                                Name="VCCLCompilerTool"\r
+                                                CompileAs="2"\r
+                                        />\r
+                                </FileConfiguration>\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\console_thread.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\main.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbconfigfileeditor.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbconfigpanel.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbhistorytextctrl.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxblistctrl.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbmainframe.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbrestorepanel.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbtableparser.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbtreectrl.cpp"\r
+                                >\r
+                        </File>\r
+                        <File\r
+                                RelativePath="..\..\wx-console\wxbutils.cpp"\r
+                                >\r
+                        </File>\r
+                </Filter>\r
+        </Files>\r
+        <Globals>\r
+        </Globals>\r
 </VisualStudioProject>\r
index 1cfca94661d81dd16d0fc74edbeae8c034019094..d71812dc3083b9571156bf5414656613a6f53495 100644 (file)
@@ -1,15 +1,7 @@
-/*
- *
- *   Config panel, used to specify parameters (for example clients, filesets... in restore)
- *
- *    Nicolas Boichat, April 2004
- *
- *    Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *
+ *   Config panel, used to specify parameters (for example clients, filesets... in restore)
+ *
+ *    Nicolas Boichat, April 2004
+ *
+ *    Version $Id$
+ */
 
 /*  Windows debug builds set _DEBUG which is used by wxWidgets to select their
  *  debug memory allocator.  Unfortunately it conflicts with Bacula's SmartAlloc.
@@ -159,6 +159,14 @@ int wxbConfigParam::GetIndex() {
    return -1;
 }
 
+int wxbConfigParam::GetCount() {
+   if (choicectrl) {
+      return choicectrl->GetCount();
+   }
+   return -1;
+}
+   
+
 void wxbConfigParam::SetIndex(int ind) {
    if (choicectrl) {
       choicectrl->SetSelection(ind);
@@ -289,6 +297,16 @@ int wxbConfigPanel::FindRow(const wxChar* title) {
    return -1;
 }
 
+int wxbConfigPanel::GetRowCount(const wxChar* title)
+{
+   int i;
+   if ((i = FindRow(title)) > -1) {
+      return (*config)[i].GetCount();
+   }  
+
+   return -1;
+}
+
 void wxbConfigPanel::EnableApply(bool enable) {
    cfgOk->Enable(!enable);
    if (cfgApply) cfgApply->Enable(enable);
index e64ec8c06348314e749914d178be190bda9c321f..3f712caae6dac4bf69b840aa5862cf200c27b156 100644 (file)
@@ -1,15 +1,7 @@
-/*
- *
- *   Config panel, used to specify parameters (for example clients, filesets... in restore)
- *
- *    Nicolas Boichat, April 2004
- *
- *    Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *
+ *   Config panel, used to specify parameters (for example clients, filesets... in restore)
+ *
+ *    Nicolas Boichat, April 2004
+ *
+ *    Version $Id$
+ */
 
 #ifndef WXBCONFIGPANEL_H
 #define WXBCONFIGPANEL_H
@@ -68,6 +68,7 @@ class wxbConfigParam {
 
      void Clear();
      void Add(wxString value);
+     int GetCount();
 
      wxString GetTitle();
 
@@ -102,6 +103,7 @@ public:
 
    void ClearRowChoices(const wxChar* title);
    void AddRowChoice(const wxChar* title, wxString value);
+   int GetRowCount(const wxChar* title);
 
    /* If enable is true, enables apply button, and disables ok button */
    void EnableApply(bool enable = true);
index f74163bc00de3158026e88aeb1cf8630e7b509af..7504bf597e83339e7e24b3e8fee2b73bf560c1fa 100644 (file)
@@ -1,15 +1,7 @@
-/*
- *
- *   wxbPanel for restoring files
- *
- *    Nicolas Boichat, April-July 2004
- *
- *    Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *
+ *   wxbPanel for restoring files
+ *
+ *    Nicolas Boichat, April-July 2004
+ *
+ *    Version $Id$
+ */
 
 /* Note concerning "done" output (modifiable marked with +)
 Run Restore job
@@ -551,14 +551,17 @@ void wxbRestorePanel::CmdStart()
       wxbMainFrame::GetInstance()->SetStatusText(_("Please configure your restore parameters."));
    }
    else if (status == entered) {
-/*      if (clientChoice->GetStringSelection().Length() < 1) {
+#ifdef xxx
+      if (clientChoice->GetStringSelection().Length() < 1) {
          wxbMainFrame::GetInstance()->SetStatusText(_("Please select a client."));
          return;
       }
       if (jobChoice->GetStringSelection().Length() < 1) {
          wxbMainFrame::GetInstance()->SetStatusText(_("Please select a restore date."));
          return;
-      }*/
+      }
+#endif
+
       wxbMainFrame::GetInstance()->SetStatusText(_("Building restore tree..."));
       
       SetStatus(choosing);
@@ -577,17 +580,22 @@ void wxbRestorePanel::CmdStart()
          wxT("\" storage=\"") << configPanel->GetRowString(wxT("Storage")) <<
          wxT("\" before=\"") << configPanel->GetRowString(wxT("Before")) <<
          wxT("\" select\n"));
-      //wxbUtils::WaitForPrompt("6\n");
-      //WaitForEnd();
-      /*wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxString() << configPanel->GetRowString(wxT("Before")) << "\n", true);
+
+#ifdef xxx
+      wxbUtils::WaitForPrompt("6\n");
+      WaitForEnd();
+
+      wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxString() << configPanel->GetRowString(wxT("Before")) << "\n", true);
+
       int client = pp->getChoices()->Index(configPanel->GetRowString(wxT("Client")));
       if (client == wxNOT_FOUND) {
          wxbMainFrame::GetInstance()->SetStatusText("Failed to find the selected client.");
          return;
       }
-      delete pp;*/
+      delete pp;
       
-      //wxbMainFrame::GetInstance()->Send(wxString() << configPanel->GetRowString(wxT("Before")) << "\n");
+      wxbMainFrame::GetInstance()->Send(wxString() << configPanel->GetRowString(wxT("Before")) << "\n");
+#endif
    
       while (!tableparser->hasFinished() && !dt->hasFinished()) {
          wxTheApp->Yield(true);
@@ -623,8 +631,10 @@ void wxbRestorePanel::CmdStart()
       gauge->SetValue(0);
       gauge->SetRange(tot);
       
-      /*wxbMainFrame::GetInstance()->Print(
-               wxString("[") << tot << "]", CS_DEBUG);*/
+#ifdef xxx
+      wxbMainFrame::GetInstance()->Print(
+               wxString("[") << tot << "]", CS_DEBUG);
+#endif
       
       wxDateTime base = wxDateTime::Now();
       wxDateTime newdate;
@@ -849,8 +859,8 @@ void wxbRestorePanel::CmdStart()
       }
 
       if (scheduledtime.Subtract(currenttime).IsLongerThan(wxTimeSpan::Seconds(150))) {
-         wxbMainFrame::GetInstance()->Print(_("Restore is scheduled in more than two minutes, bwx-console will not wait for its completion.\n"), CS_DEBUG);
-         wxbMainFrame::GetInstance()->SetStatusText(_("Restore is scheduled in more than two minutes, bwx-console will not wait for its completion."));
+         wxbMainFrame::GetInstance()->Print(_("Restore is scheduled to run. bwx-console will not wait for its completion.\n"), CS_DEBUG);
+         wxbMainFrame::GetInstance()->SetStatusText(_("Restore is scheduled to run. bwx-console will not wait for its completion."));
          SetStatus(finished);
          return;
       }
@@ -1069,7 +1079,8 @@ void wxbRestorePanel::CmdCancel() {
  *  11: JobId (no)
  */
 
-void wxbRestorePanel::CmdConfigApply() {
+void wxbRestorePanel::CmdConfigApply() 
+{
    if (cfgUpdated == 0) return;
    
    wxbMainFrame::GetInstance()->SetStatusText(_("Applying restore configuration changes..."));
@@ -1096,7 +1107,7 @@ void wxbRestorePanel::CmdConfigApply() {
       }
       else if ((cfgUpdated >> ConfigReplace) & 1) {
          wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
-         wxbUtils::WaitForPrompt(wxT("10\n"));
+         wxbUtils::WaitForPrompt(wxT("11\n"));
          dt = new wxbDataTokenizer(true);
          wxbUtils::WaitForPrompt(wxString() << (restorePanel->GetRowSelection(_("Replace"))+1) << wxT("\n"));
          def = wxT("1");
@@ -1119,49 +1130,64 @@ void wxbRestorePanel::CmdConfigApply() {
          cfgUpdated = cfgUpdated & (~(1 << ConfigPriority));
       }
       else if ((cfgUpdated >> ConfigClient) & 1) {
-         wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
-         wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxT("5\n"), true);
-         int client = pp->getChoices()->Index(restorePanel->GetRowString(_("Client")));
-         if (client == wxNOT_FOUND) {
-            wxbMainFrame::GetInstance()->SetStatusText(_("Failed to find the selected client."));
-            failed = true;
-            client = 1;
+         if (restorePanel->GetRowCount(_("Client")) > 1) {
+            wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
+            wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxT("5\n"), true);
+            int client = pp->getChoices()->Index(restorePanel->GetRowString(_("Client")));
+            if (client == wxNOT_FOUND) {
+               wxbMainFrame::GetInstance()->SetStatusText(_("Failed to find the selected client."));
+               failed = true;
+               client = 1;
+            }
+            delete pp;
+            dt = new wxbDataTokenizer(true);
+            wxbUtils::WaitForPrompt(wxString() << client << wxT("\n"));
+            def = wxT("1");
+            cfgUpdated = cfgUpdated & (~(1 << ConfigClient));
+         } else {
+            cfgUpdated = cfgUpdated & (~(1 << ConfigClient));
+            continue;
          }
-         delete pp;
-         dt = new wxbDataTokenizer(true);
-         wxbUtils::WaitForPrompt(wxString() << client << wxT("\n"));
-         def = wxT("1");
-         cfgUpdated = cfgUpdated & (~(1 << ConfigClient));
       }
       else if ((cfgUpdated >> ConfigFileset) & 1) {
-         wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
-         wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxT("4\n"), true);
-         int fileset = pp->getChoices()->Index(restorePanel->GetRowString(_("Fileset")));
-         if (fileset == wxNOT_FOUND) {
-            wxbMainFrame::GetInstance()->SetStatusText(_("Failed to find the selected fileset."));
-            failed = true;
-            fileset = 1;
+         if (restorePanel->GetRowCount(_("Fileset")) > 1) {
+            wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
+            wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxT("4\n"), true);
+            int fileset = pp->getChoices()->Index(restorePanel->GetRowString(_("Fileset")));
+            if (fileset == wxNOT_FOUND) {
+               wxbMainFrame::GetInstance()->SetStatusText(_("Failed to find the selected fileset."));
+               failed = true;
+               fileset = 1;
+            }
+            delete pp;
+            dt = new wxbDataTokenizer(true);
+            wxbUtils::WaitForPrompt(wxString() << fileset << wxT("\n"));
+            def = wxT("1");
+            cfgUpdated = cfgUpdated & (~(1 << ConfigFileset));
+         } else {
+            cfgUpdated = cfgUpdated & (~(1 << ConfigFileset));
+            continue;
          }
-         delete pp;
-         dt = new wxbDataTokenizer(true);
-         wxbUtils::WaitForPrompt(wxString() << fileset << wxT("\n"));
-         def = wxT("1");
-         cfgUpdated = cfgUpdated & (~(1 << ConfigFileset));
       }
       else if ((cfgUpdated >> ConfigStorage) & 1) {
-         wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
-         wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxT("2\n"), true);
-         int fileset = pp->getChoices()->Index(restorePanel->GetRowString(_("Storage")));
-         if (fileset == wxNOT_FOUND) {
-            wxbMainFrame::GetInstance()->SetStatusText(_("Failed to find the selected storage."));
-            failed = true;
-            fileset = 1;
+         if (restorePanel->GetRowCount(_("Storage")) > 1) {
+            wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
+            wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxT("2\n"), true);
+            int storage = pp->getChoices()->Index(restorePanel->GetRowString(_("Storage")));
+            if (storage == wxNOT_FOUND) {
+               wxbMainFrame::GetInstance()->SetStatusText(_("Failed to find the selected storage."));
+               failed = true;
+               storage = 1;
+            }
+            delete pp;
+            dt = new wxbDataTokenizer(true);
+            wxbUtils::WaitForPrompt(wxString() << storage << wxT("\n"));
+            def = wxT("1");
+            cfgUpdated = cfgUpdated & (~(1 << ConfigStorage));
+         } else {
+            cfgUpdated = cfgUpdated & (~(1 << ConfigStorage));
+            continue;
          }
-         delete pp;
-         dt = new wxbDataTokenizer(true);
-         wxbUtils::WaitForPrompt(wxString() << fileset << wxT("\n"));
-         def = wxT("1");
-         cfgUpdated = cfgUpdated & (~(1 << ConfigStorage));
       }
       else {
          cfgUpdated = 0;
@@ -1175,7 +1201,7 @@ void wxbRestorePanel::CmdConfigApply() {
          }
       }
       
-      if (i == dt->GetCount()) {
+      if (i != 0 && i == dt->GetCount()) {
          delete dt;   
          dt = wxbUtils::WaitForEnd(def + wxT("\n"), true);
          failed = true;
@@ -1184,6 +1210,7 @@ void wxbRestorePanel::CmdConfigApply() {
    UpdateSecondConfig(dt); /* TODO: Check result */
    
    EnableConfig(true);
+   restorePanel->EnableApply(false);
 
    if (!failed) {
       wxbMainFrame::GetInstance()->SetStatusText(_("Restore configuration changes were applied."));
@@ -1967,7 +1994,6 @@ void wxbRestorePanel::SetStatus(status_enum newstatus) {
       cfgUpdated = 0;
       break;
    case listing:
-      
       break;
    case choosing:
       start->Enable(true);
@@ -1996,6 +2022,7 @@ void wxbRestorePanel::SetStatus(status_enum newstatus) {
       centerSizer->Layout();
       this->Layout();
       restorePanel->EnableApply(false);
+      cancel->Enable(true);
       break;
    case restoring:
       start->SetLabel(_("Restoring..."));
@@ -2362,7 +2389,8 @@ void wxbRestorePanel::OnListRemove(wxCommandEvent& event) {
    listremove->Enable(false);
 }
 
-void wxbRestorePanel::OnListRefresh(wxCommandEvent& event) {
+void wxbRestorePanel::OnListRefresh(wxCommandEvent& event) 
+{
    if (IsWorking()) {
       return;
    }
@@ -2372,7 +2400,8 @@ void wxbRestorePanel::OnListRefresh(wxCommandEvent& event) {
    SetWorking(false);
 }
 
-void wxbRestorePanel::OnConfigUpdated(wxCommandEvent& event) {
+void wxbRestorePanel::OnConfigUpdated(wxCommandEvent& event) 
+{
    if (status == entered) {
       if (event.GetId() == ConfigJobName) {
          if (IsWorking()) {
index 6fccb368bd713d22b924d225b220f59d1b0393eb..daf9d634a6a811206e533223d569f5f3c111a813 100644 (file)
@@ -1,15 +1,7 @@
-/*
- *
- *   wxbDataParser, class that receives and analyses data
- *
- *    Nicolas Boichat, April-July 2004
- *
- *    Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *
+ *   wxbDataParser, class that receives and analyses data
+ *
+ *    Nicolas Boichat, April-July 2004
+ *
+ *    Version $Id$
+ */
 
 /*  Windows debug builds set _DEBUG which is used by wxWidgets to select their
  *  debug memory allocator.  Unfortunately it conflicts with Bacula's SmartAlloc.
 #undef _DEBUG
 
 #include "bacula.h"
-
 #include "wxbutils.h"
-
 #include "wxbmainframe.h"
-
 #include "csprint.h"
-
 #include "wxbtableparser.h"
 
 /* A macro named Yield is defined under MinGW */
@@ -335,7 +331,6 @@ bool wxbPromptParser::Analyse(wxString str, int status) {
             choices->Add(wxT("no"));
             numerical = false;
          }
-         
          return true;
       }
       else { /* ended or (dis)connected */
index c3f05bf067ce4f5849c2b1f899f73b96d4c24919..d91ff2d35a72ae3069adca8a69c9a1f9a2221747 100644 (file)
@@ -1,16 +1,7 @@
-/*
- *
- *   wxbDataParser, class that receives and analyses data
- *   wxbPanel, main frame's notebook panels
- *
- *    Nicolas Boichat, April-July 2004
- *
- *   Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *
+ *   wxbDataParser, class that receives and analyses data
+ *   wxbPanel, main frame's notebook panels
+ *
+ *    Nicolas Boichat, April-July 2004
+ *
+ *   Version $Id$
+ */
 
 #ifndef WXBUTILS_H
 #define WXBUTILS_H
index 735cba879aab0295822e53f4489c2611951e4c3f..79e785b6321bea1b9cb037e5fde5146daa78a71f 100644 (file)
@@ -1,6 +1,18 @@
               Technical notes on version 2.2
 
 General:
+19Mar08
+kes  Massive commit of all fixes and back ports to create 2.2.9
+18Mar08
+kes  Apply doc fix from bug #1062.
+kes  Resolve crash and improper restore wx-console Win32 restore
+     GUI. Fixes bug #1065.
+kes  Update Win32 wxWidgets to latest version.
+kes  Attempt to do correct handling of Win32 mount points. Should
+     fix bug #1046.
+kes  Fix Win32 FD backup/restore memory leak due to improper termination
+     of BackupRead/Write. This fixes bug# 1038.
+kes  Add const to AIX prototype for initgroups()
 27Feb08
 kes  Undo bug #1047 heap overrun fix as it is not correct.
 14Feb08