From 8480357fb7935c36a09a6bafa8da0981b0179461 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 26 Aug 2008 14:18:50 +0000 Subject: [PATCH] Tweak git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7510 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/bsr.c | 47 ++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/bacula/src/dird/bsr.c b/bacula/src/dird/bsr.c index 2e9d73df81..28574282b9 100644 --- a/bacula/src/dird/bsr.c +++ b/bacula/src/dird/bsr.c @@ -268,6 +268,7 @@ void display_bsr_info(UAContext *ua, RESTORE_CTX &rx) POOL_MEM volmsg(PM_MESSAGE); JobId_t JobId; char Device[MAX_NAME_LENGTH]; + RBSR *bsr; /* Tell the user what he will need to mount */ ua->send_msg("\n"); @@ -276,41 +277,41 @@ void display_bsr_info(UAContext *ua, RESTORE_CTX &rx) "===========================================================================\n")); /* Create Unique list of Volumes using prompt list */ start_prompt(ua, ""); - if (*rx.JobIds) { + if (*rx.JobIds == 0) { + /* Print Volumes in any order */ + for (bsr=rx.bsr; bsr; bsr=bsr->next) { + for (int i=0; i < bsr->VolCount; i++) { + if (bsr->VolParams[i].VolumeName[0]) { + if (!get_storage_device(Device, bsr->VolParams[i].Storage)) { + Device[0] = 0; + } + Mmsg(volmsg, "%-25.25s %-25.25s %-25.25s", + bsr->VolParams[i].VolumeName, + bsr->VolParams[i].Storage, Device); + add_prompt(ua, volmsg.c_str()); + } + } + } + } else { /* Ensure that the volumes are printed in JobId order */ for (p=rx.JobIds; get_next_jobid_from_list(&p, &JobId) > 0; ) { - for (RBSR *nbsr=rx.bsr; nbsr; nbsr=nbsr->next) { - if (JobId != nbsr->JobId) { + for (bsr=rx.bsr; bsr; bsr=bsr->next) { + if (JobId != bsr->JobId) { continue; } - for (int i=0; i < nbsr->VolCount; i++) { - if (nbsr->VolParams[i].VolumeName[0]) { - if (!get_storage_device(Device, nbsr->VolParams[i].Storage)) { + for (int i=0; i < bsr->VolCount; i++) { + if (bsr->VolParams[i].VolumeName[0]) { + if (!get_storage_device(Device, bsr->VolParams[i].Storage)) { Device[0] = 0; } Mmsg(volmsg, "%-25.25s %-25.25s %-25.25s", - nbsr->VolParams[i].VolumeName, - nbsr->VolParams[i].Storage, Device); + bsr->VolParams[i].VolumeName, + bsr->VolParams[i].Storage, Device); add_prompt(ua, volmsg.c_str()); } } } } - } else { - /* Print Volumes in any order */ - for (RBSR *nbsr=rx.bsr; nbsr; nbsr=nbsr->next) { - for (int i=0; i < nbsr->VolCount; i++) { - if (nbsr->VolParams[i].VolumeName[0]) { - if (!get_storage_device(Device, nbsr->VolParams[i].Storage)) { - Device[0] = 0; - } - Mmsg(volmsg, "%-25.25s %-25.25s %-25.25s", - nbsr->VolParams[i].VolumeName, - nbsr->VolParams[i].Storage, Device); - add_prompt(ua, volmsg.c_str()); - } - } - } } for (int i=0; i < ua->num_prompts; i++) { ua->send_msg(" %s\n", ua->prompt[i]); -- 2.39.5