From af3841f6ee704dd2e214455613d62a9d8facbf7f Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 19 Mar 2008 18:01:45 +0000 Subject: [PATCH] Massive commit of all fixes and back ports to create 2.2.9 git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@6636 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/jobq.c | 2 +- bacula/src/findlib/bfile.c | 9 +- bacula/src/findlib/create_file.c | 2 +- bacula/src/findlib/find_one.c | 9 +- bacula/src/lib/bsys.c | 4 +- bacula/src/stored/acquire.c | 39 +- bacula/src/stored/askdir.c | 52 +- bacula/src/stored/autochanger.c | 2 +- bacula/src/stored/bcopy.c | 2 +- bacula/src/stored/bextract.c | 2 +- bacula/src/stored/block.c | 6 +- bacula/src/stored/bls.c | 2 +- bacula/src/stored/bscan.c | 2 +- bacula/src/stored/btape.c | 3 +- bacula/src/stored/dev.c | 8 +- bacula/src/stored/device.c | 1 + bacula/src/stored/dircmd.c | 4 +- bacula/src/stored/label.c | 27 +- bacula/src/stored/mount.c | 12 +- bacula/src/stored/protos.h | 3 +- bacula/src/stored/read_record.c | 3 +- bacula/src/stored/reserve.c | 97 ++- bacula/src/version.h | 6 +- bacula/src/win32/External-mingw32 | 4 +- bacula/src/win32/Makefile.inc.in | 4 +- bacula/src/win32/build-depkgs-mingw32 | 669 +++++++++-------- bacula/src/win32/compat/compat.cpp | 31 +- bacula/src/win32/installer/Makefile | 4 +- .../src/win32/installer/build-installer.cmd | 2 +- bacula/src/win32/installer/winbacula.nsi | 12 +- bacula/src/win32/wx-console/wx-console.vcproj | 698 +++++++++--------- bacula/src/wx-console/wxbconfigpanel.cpp | 36 +- bacula/src/wx-console/wxbconfigpanel.h | 20 +- bacula/src/wx-console/wxbrestorepanel.cpp | 153 ++-- bacula/src/wx-console/wxbutils.cpp | 23 +- bacula/src/wx-console/wxbutils.h | 20 +- bacula/technotes-2.1 | 12 + 37 files changed, 1075 insertions(+), 910 deletions(-) diff --git a/bacula/src/dird/jobq.c b/bacula/src/dird/jobq.c index 7013f48979..462ed0b853 100644 --- a/bacula/src/dird/jobq.c +++ b/bacula/src/dird/jobq.c @@ -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) { diff --git a/bacula/src/findlib/bfile.c b/bacula/src/findlib/bfile.c index 4597d42c94..e23b230604 100644 --- a/bacula/src/findlib/bfile.c +++ b/bacula/src/findlib/bfile.c @@ -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 */ diff --git a/bacula/src/findlib/create_file.c b/bacula/src/findlib/create_file.c index 12f7c487ba..91edbcdc17 100644 --- a/bacula/src/findlib/create_file.c +++ b/bacula/src/findlib/create_file.c @@ -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. diff --git a/bacula/src/findlib/find_one.c b/bacula/src/findlib/find_one.c index 723d45ccf7..a1ee4dcf71 100644 --- a/bacula/src/findlib/find_one.c +++ b/bacula/src/findlib/find_one.c @@ -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; } /* diff --git a/bacula/src/lib/bsys.c b/bacula/src/lib/bsys.c index 2f2891a5b0..f37f4cf151 100644 --- a/bacula/src/lib/bsys.c +++ b/bacula/src/lib/bsys.c @@ -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 diff --git a/bacula/src/stored/acquire.c b/bacula/src/stored/acquire.c index f9a8be1e69..88c2eb9517 100644 --- a/bacula/src/stored/acquire.c +++ b/bacula/src/stored/acquire.c @@ -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). diff --git a/bacula/src/stored/askdir.c b/bacula/src/stored/askdir.c index 785a25b33c..6d1d2ce823 100644 --- a/bacula/src/stored/askdir.c +++ b/bacula/src/stored/askdir.c @@ -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(), diff --git a/bacula/src/stored/autochanger.c b/bacula/src/stored/autochanger.c index 1d9cad0eba..d04171d28a 100644 --- a/bacula/src/stored/autochanger.c +++ b/bacula/src/stored/autochanger.c @@ -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) { diff --git a/bacula/src/stored/bcopy.c b/bacula/src/stored/bcopy.c index 5d0e00eeba..33a60d7bb0 100644 --- a/bacula/src/stored/bcopy.c +++ b/bacula/src/stored/bcopy.c @@ -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: "), diff --git a/bacula/src/stored/bextract.c b/bacula/src/stored/bextract.c index 7c5cfada46..45fc89110c 100644 --- a/bacula/src/stored/bextract.c +++ b/bacula/src/stored/bextract.c @@ -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: "), diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index b9cbbfa36a..5efc332669 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -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; diff --git a/bacula/src/stored/bls.c b/bacula/src/stored/bls.c index 0ce876deab..46a824e060 100644 --- a/bacula/src/stored/bls.c +++ b/bacula/src/stored/bls.c @@ -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: "), diff --git a/bacula/src/stored/bscan.c b/bacula/src/stored/bscan.c index fd11d7ff41..2cb3655ad4 100644 --- a/bacula/src/stored/bscan.c +++ b/bacula/src/stored/bscan.c @@ -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"); diff --git a/bacula/src/stored/btape.c b/bacula/src/stored/btape.c index 1a276916d5..d9b6a471fa 100644 --- a/bacula/src/stored/btape.c +++ b/bacula/src/stored/btape.c @@ -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; } diff --git a/bacula/src/stored/dev.c b/bacula/src/stored/dev.c index 28bcc4e803..f525e0924c 100644 --- a/bacula/src/stored/dev.c +++ b/bacula/src/stored/dev.c @@ -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)) { diff --git a/bacula/src/stored/device.c b/bacula/src/stored/device.c index b38b512d0b..50ab5dab1a 100644 --- a/bacula/src/stored/device.c +++ b/bacula/src/stored/device.c @@ -226,6 +226,7 @@ void set_new_volume_parameters(DCR *dcr) } set_new_file_parameters(dcr); jcr->NumWriteVolumes++; + dcr->NewVol = false; } /* diff --git a/bacula/src/stored/dircmd.c b/bacula/src/stored/dircmd.c index 95a05e075a..a7b631a831 100644 --- a/bacula/src/stored/dircmd.c +++ b/bacula/src/stored/dircmd.c @@ -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; } diff --git a/bacula/src/stored/label.c b/bacula/src/stored/label.c index 5e6c75bfca..115f7ae0d1 100644 --- a/bacula/src/stored/label.c +++ b/bacula/src/stored/label.c @@ -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()) { diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index c8beb34a99..0feccef489 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -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) */ diff --git a/bacula/src/stored/protos.h b/bacula/src/stored/protos.h index 7d1b75a3e2..616c1d9c8d 100644 --- a/bacula/src/stored/protos.h +++ b/bacula/src/stored/protos.h @@ -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); diff --git a/bacula/src/stored/read_record.c b/bacula/src/stored/read_record.c index 69707e247d..4190d11848 100644 --- a/bacula/src/stored/read_record.c +++ b/bacula/src/stored/read_record.c @@ -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 */ diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c index 6cd269eeae..33340c1e6e 100644 --- a/bacula/src/stored/reserve.c +++ b/bacula/src/stored/reserve.c @@ -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; } diff --git a/bacula/src/version.h b/bacula/src/version.h index 2dc4c9db7f..91894f78f2 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -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 */ diff --git a/bacula/src/win32/External-mingw32 b/bacula/src/win32/External-mingw32 index 5496d0ef7e..7dbfeb849c 100644 --- a/bacula/src/win32/External-mingw32 +++ b/bacula/src/win32/External-mingw32 @@ -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 # # diff --git a/bacula/src/win32/Makefile.inc.in b/bacula/src/win32/Makefile.inc.in index c5b651b0c0..7b41950ce7 100644 --- a/bacula/src/win32/Makefile.inc.in +++ b/bacula/src/win32/Makefile.inc.in @@ -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 diff --git a/bacula/src/win32/build-depkgs-mingw32 b/bacula/src/win32/build-depkgs-mingw32 index ce132dace7..046813ac6c 100755 --- a/bacula/src/win32/build-depkgs-mingw32 +++ b/bacula/src/win32/build-depkgs-mingw32 @@ -6,26 +6,26 @@ usage() { - echo "usage: $0 [-h] [-C] [] [] ..." - echo " -h Displays this usage" - echo " -C Clobbers (overwrites) the source code by " - echo " reextracting the archive and reapplying the" - echo " patches." - echo "" - echo " 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] [] [] ..." + echo " -h Displays this usage" + echo " -C Clobbers (overwrites) the source code by " + echo " reextracting the archive and reapplying the" + echo " patches." + echo "" + echo " 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 diff --git a/bacula/src/win32/compat/compat.cpp b/bacula/src/win32/compat/compat.cpp index 5f50e3fd11..14a97cf239 100644 --- a/bacula/src/win32/compat/compat.cpp +++ b/bacula/src/win32/compat/compat.cpp @@ -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; } diff --git a/bacula/src/win32/installer/Makefile b/bacula/src/win32/installer/Makefile index f3b904963b..3c0ee400d6 100644 --- a/bacula/src/win32/installer/Makefile +++ b/bacula/src/win32/installer/Makefile @@ -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 diff --git a/bacula/src/win32/installer/build-installer.cmd b/bacula/src/win32/installer/build-installer.cmd index b4faacddfe..385537ea39 100644 --- a/bacula/src/win32/installer/build-installer.cmd +++ b/bacula/src/win32/installer/build-installer.cmd @@ -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 SET BACULA_TOOLS=bcopy.exe bextract.exe bls.exe bscan.exe bsleep.exe bsmtp.exe btape.exe dbcheck.exe scsilist.exe -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 +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 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 SET SCRIPTS=mtx-changer.cmd disk-changer.cmd dvd-handler.cmd diff --git a/bacula/src/win32/installer/winbacula.nsi b/bacula/src/win32/installer/winbacula.nsi index ca5216628d..f360c6dc28 100644 --- a/bacula/src/win32/installer/winbacula.nsi +++ b/bacula/src/win32/installer/winbacula.nsi @@ -787,16 +787,16 @@ Section "Graphical Console" SecWxConsole Call InstallCommonFiles !if "${BUILD_TOOLS}" == "VC8" - File "${SRC_DIR}\wxbase270_vc_bacula.dll" - File "${SRC_DIR}\wxmsw270_core_vc_bacula.dll" + File "${SRC_DIR}\wxbase28_vc_bacula.dll" + File "${SRC_DIR}\wxmsw28_core_vc_bacula.dll" !endif !If "${BUILD_TOOLS}" == "VC8_DEBUG" - File "${SRC_DIR}\wxbase270_vc_bacula.dll" - File "${SRC_DIR}\wxmsw270_core_vc_bacula.dll" + File "${SRC_DIR}\wxbase28_vc_bacula.dll" + File "${SRC_DIR}\wxmsw28_core_vc_bacula.dll" !endif !if "${BUILD_TOOLS}" == "MinGW" - File "${SRC_DIR}\wxbase270_gcc_bacula.dll" - File "${SRC_DIR}\wxmsw270_core_gcc_bacula.dll" + File "${SRC_DIR}\wxbase28_gcc_bacula.dll" + File "${SRC_DIR}\wxmsw28_core_gcc_bacula.dll" !endif File "${SRC_DIR}\bwx-console.exe" diff --git a/bacula/src/win32/wx-console/wx-console.vcproj b/bacula/src/win32/wx-console/wx-console.vcproj index ee93c79d59..bab6aca168 100644 --- a/bacula/src/win32/wx-console/wx-console.vcproj +++ b/bacula/src/win32/wx-console/wx-console.vcproj @@ -1,352 +1,352 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ProjectType="Visual C++" + Version="8.00" + Name="wx-console" + ProjectGUID="{9BA8E10D-0D82-4B25-8543-DE34641FBC10}" + RootNamespace="wx-console" + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bacula/src/wx-console/wxbconfigpanel.cpp b/bacula/src/wx-console/wxbconfigpanel.cpp index 1cfca94661..d71812dc30 100644 --- a/bacula/src/wx-console/wxbconfigpanel.cpp +++ b/bacula/src/wx-console/wxbconfigpanel.cpp @@ -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. @@ -33,6 +25,14 @@ (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); diff --git a/bacula/src/wx-console/wxbconfigpanel.h b/bacula/src/wx-console/wxbconfigpanel.h index e64ec8c063..3f712caae6 100644 --- a/bacula/src/wx-console/wxbconfigpanel.h +++ b/bacula/src/wx-console/wxbconfigpanel.h @@ -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. @@ -33,6 +25,14 @@ (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); diff --git a/bacula/src/wx-console/wxbrestorepanel.cpp b/bacula/src/wx-console/wxbrestorepanel.cpp index f74163bc00..7504bf597e 100644 --- a/bacula/src/wx-console/wxbrestorepanel.cpp +++ b/bacula/src/wx-console/wxbrestorepanel.cpp @@ -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. @@ -33,6 +25,14 @@ (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()) { diff --git a/bacula/src/wx-console/wxbutils.cpp b/bacula/src/wx-console/wxbutils.cpp index 6fccb368bd..daf9d634a6 100644 --- a/bacula/src/wx-console/wxbutils.cpp +++ b/bacula/src/wx-console/wxbutils.cpp @@ -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. @@ -33,6 +25,14 @@ (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. @@ -42,13 +42,9 @@ #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 */ diff --git a/bacula/src/wx-console/wxbutils.h b/bacula/src/wx-console/wxbutils.h index c3f05bf067..d91ff2d35a 100644 --- a/bacula/src/wx-console/wxbutils.h +++ b/bacula/src/wx-console/wxbutils.h @@ -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. @@ -34,6 +25,15 @@ (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 diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index 735cba879a..79e785b632 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -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 -- 2.39.5