*/
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) {
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 */
}
} 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 */
/*
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.
/*
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.
} 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;
}
/*
/*
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.
#endif
#ifdef HAVE_AIX_OS
-extern "C" int initgroups(char *,int);
+extern "C" int initgroups(const char *,int);
#endif
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
/* 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 */
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"));
/*
!(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 {
/*
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));
}
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) {
/*
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 */
* 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 */
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).
{
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);
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();
* 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;
* 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(),
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) {
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: "),
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: "),
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);
}
#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;
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: "),
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");
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");
Pmsg2(000, _("End of Volume \"%s\" %d records.\n"), dcr->VolumeName,
quickie_count);
+ volume_unused(dcr);
if (LastBlock != block->BlockNumber) {
VolBytes += block->block_len;
}
/*
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.
/* 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;
}
#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)) {
}
set_new_file_parameters(dcr);
jcr->NumWriteVolumes++;
+ dcr->NewVol = false;
}
/*
/*
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.
if (!dev->is_open()) {
dev->clear_volhdr();
}
+ volume_unused(dcr); /* no longer using volume */
give_back_device_lock(dev, &hold);
return;
}
ok = false;
break;
}
+ volume_unused(dcr);
give_back_device_lock(dev, &hold);
return ok;
}
return VOL_OK;
bail_out:
+ volume_unused(dcr); /* mark volume "released" */
empty_block(block);
dev->rewind(dcr);
Dmsg1(150, "return %d\n", stat);
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, ... */
return true;
bail_out:
+ volume_unused(dcr);
dev->clear_volhdr();
dev->clear_append(); /* remove append since this is PRE_LABEL */
return false;
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());
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()) {
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;
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();
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();
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)
*/
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);
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);
/*
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.
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 */
*/
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");
}
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");
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.
*
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)
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
* 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)
{
Dmsg1(dbglvl, "jid=%u No suitable device found.\n", (int)rctx.jcr->JobId);
}
rctx.have_volume = false;
+ rctx.VolumeName[0] = 0;
}
if (ok) {
break;
}
} /* 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) {
(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));
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,
*/
if (dcr->dev->num_writers != 0) {
if (dcr->VolumeName[0]) {
- volume_unused(dcr);
+ unreserve_device(dcr);
}
goto bail_out;
}
if (!ok) {
goto bail_out;
}
+
if (rctx.notify_dir) {
POOL_MEM dev_name;
BSOCK *dir = rctx.jcr->dir_bsock;
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;
}
*/
#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 */
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
#
#
$(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
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`
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
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()
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()
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
/*
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.
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);
free_pool_memory(pwszBuf);
pdwFileAttributes = &info_w.dwFileAttributes;
+ pdwReserved0 = &info_w.dwReserved0;
pnFileSizeHigh = &info_w.nFileSizeHigh;
pnFileSizeLow = &info_w.nFileSizeLow;
pftLastAccessTime = &info_w.ftLastAccessTime;
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;
/* 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;
return -1;
}
- if (attr & FILE_ATTRIBUTE_DIRECTORY) {
- return statDir(tmpbuf, sb);
- }
h = CreateFileA(tmpbuf, GENERIC_READ,
FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
rval = fstat((int)h, sb);
CloseHandle(h);
+ if (attr & FILE_ATTRIBUTE_DIRECTORY) {
+ return statDir(tmpbuf, sb);
+ }
+
return rval;
}
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;
}
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
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
\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
<?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=""../../../../depkgs-msvc/lib";"../../../../depkgs-msvc/lib/wx_dll""\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=""../../../../depkgs-msvc/lib";"../../../../depkgs-msvc/lib/wx_dll""\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
-/*
- *
- * 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.
return -1;
}
+int wxbConfigParam::GetCount() {
+ if (choicectrl) {
+ return choicectrl->GetCount();
+ }
+ return -1;
+}
+
+
void wxbConfigParam::SetIndex(int ind) {
if (choicectrl) {
choicectrl->SetSelection(ind);
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);
-/*
- *
- * 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
void Clear();
void Add(wxString value);
+ int GetCount();
wxString GetTitle();
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);
-/*
- *
- * 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
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);
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);
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;
}
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;
}
* 11: JobId (no)
*/
-void wxbRestorePanel::CmdConfigApply() {
+void wxbRestorePanel::CmdConfigApply()
+{
if (cfgUpdated == 0) return;
wxbMainFrame::GetInstance()->SetStatusText(_("Applying restore configuration changes..."));
}
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");
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;
}
}
- if (i == dt->GetCount()) {
+ if (i != 0 && i == dt->GetCount()) {
delete dt;
dt = wxbUtils::WaitForEnd(def + wxT("\n"), true);
failed = true;
UpdateSecondConfig(dt); /* TODO: Check result */
EnableConfig(true);
+ restorePanel->EnableApply(false);
if (!failed) {
wxbMainFrame::GetInstance()->SetStatusText(_("Restore configuration changes were applied."));
cfgUpdated = 0;
break;
case listing:
-
break;
case choosing:
start->Enable(true);
centerSizer->Layout();
this->Layout();
restorePanel->EnableApply(false);
+ cancel->Enable(true);
break;
case restoring:
start->SetLabel(_("Restoring..."));
listremove->Enable(false);
}
-void wxbRestorePanel::OnListRefresh(wxCommandEvent& event) {
+void wxbRestorePanel::OnListRefresh(wxCommandEvent& event)
+{
if (IsWorking()) {
return;
}
SetWorking(false);
}
-void wxbRestorePanel::OnConfigUpdated(wxCommandEvent& event) {
+void wxbRestorePanel::OnConfigUpdated(wxCommandEvent& event)
+{
if (status == entered) {
if (event.GetId() == ConfigJobName) {
if (IsWorking()) {
-/*
- *
- * 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 */
choices->Add(wxT("no"));
numerical = false;
}
-
return true;
}
else { /* ended or (dis)connected */
-/*
- *
- * 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
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