]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/read_record.c
This commit was manufactured by cvs2svn to create tag
[bacula/bacula] / bacula / src / stored / read_record.c
index 98242e83fa36f5e1eaedcb839b72e6405181b895..a3cdbbfbe0e541d9e8e36aefb8951f2168c48f9c 100644 (file)
    Copyright (C) 2000-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   modify it under the terms of the GNU General Public License
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-   MA 02111-1307, USA.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
@@ -70,10 +65,10 @@ bool read_records(DCR *dcr,
       if (!read_block_from_device(dcr, CHECK_BLOCK_NUMBERS)) {
          if (dev->at_eot()) {
             DEV_RECORD *trec = new_record();
-            Jmsg(jcr, M_INFO, 0, "End of Volume at file %u on device %s, Volume \"%s\"\n",
+            Jmsg(jcr, M_INFO, 0, _("End of Volume at file %u on device %s, Volume \"%s\"\n"),
                  dev->file, dev->print_name(), dcr->VolumeName);
             if (!mount_cb(dcr)) {
-               Jmsg(jcr, M_INFO, 0, "End of all volumes.\n");
+               Jmsg(jcr, M_INFO, 0, _("End of all volumes.\n"));
                ok = false;            /* Stop everything */
                /*
                 * Create EOT Label so that Media record may
@@ -107,10 +102,10 @@ bool read_records(DCR *dcr,
 
          } else if (dev->at_eof()) {
             if (verbose) {
-               Jmsg(jcr, M_INFO, 0, "Got EOF at file %u  on device %s, Volume \"%s\"\n",
+               Jmsg(jcr, M_INFO, 0, _("End of file %u  on device %s, Volume \"%s\"\n"),
                   dev->file, dev->print_name(), dcr->VolumeName);
             }
-            Dmsg3(200, "Got EOF at file %u  on device %s, Volume \"%s\"\n",
+            Dmsg3(200, "End of file %u  on device %s, Volume \"%s\"\n",
                   dev->file, dev->print_name(), dcr->VolumeName);
             continue;
          } else if (dev->is_short_block()) {
@@ -121,7 +116,7 @@ bool read_records(DCR *dcr,
             display_tape_error_status(jcr, dev);
             if (forge_on || jcr->ignore_label_errors) {
                dev->fsr(1);       /* try skipping bad record */
-               Pmsg0(000, "Did fsr\n");
+               Pmsg0(000, _("Did fsr\n"));
                continue;              /* try to continue */
             }
             ok = false;               /* stop everything */
@@ -162,7 +157,7 @@ bool read_records(DCR *dcr,
       record = 0;
       rec->state = 0;
       Dmsg1(300, "Block empty %d\n", is_block_empty(rec));
-      for (rec->state=0; !is_block_empty(rec); ) {
+      for (rec->state=0; ok && !is_block_empty(rec); ) {
          if (!read_record_from_block(block, rec)) {
             Dmsg3(400, "!read-break. state=%s blk=%d rem=%d\n", rec_state_to_str(rec),
                   block->BlockNumber, rec->remainder);
@@ -220,6 +215,7 @@ bool read_records(DCR *dcr,
                continue;              /* we don't want record, read next one */
             }
          }
+         dcr->VolLastIndex = rec->FileIndex;  /* let caller know where we are */
          if (is_partial_record(rec)) {
             Dmsg6(300, "Partial, break. recno=%d state=%s blk=%d SI=%d ST=%d FI=%d\n", record,
                rec_state_to_str(rec), block->BlockNumber,
@@ -277,7 +273,7 @@ static bool try_repositioning(JCR *jcr, DEV_RECORD *rec, DEVICE *dev)
    }
    if (bsr) {
       if (verbose) {
-         Jmsg(jcr, M_INFO, 0, "Reposition from (file:block) %u:%u to %u:%u\n",
+         Jmsg(jcr, M_INFO, 0, _("Reposition from (file:block) %u:%u to %u:%u\n"),
             dev->file, dev->block_num, bsr->volfile->sfile,
             bsr->volblock->sblock);
       }
@@ -323,28 +319,28 @@ static void handle_session_record(DEVICE *dev, DEV_RECORD *rec, SESSION_LABEL *s
    memset(sessrec, 0, sizeof(sessrec));
    switch (rec->FileIndex) {
    case PRE_LABEL:
-      rtype = "Fresh Volume Label";
+      rtype = _("Fresh Volume Label");
       break;
    case VOL_LABEL:
-      rtype = "Volume Label";
+      rtype = _("Volume Label");
       unser_volume_label(dev, rec);
       break;
    case SOS_LABEL:
-      rtype = "Begin Session";
+      rtype = _("Begin Session");
       unser_session_label(sessrec, rec);
       break;
    case EOS_LABEL:
-      rtype = "End Session";
+      rtype = _("End Session");
       break;
    case EOM_LABEL:
-      rtype = "End of Media";
+      rtype = _("End of Media");
       break;
    default:
-      bsnprintf(buf, sizeof(buf), "Unknown code %d\n", rec->FileIndex);
+      bsnprintf(buf, sizeof(buf), _("Unknown code %d\n"), rec->FileIndex);
       rtype = buf;
       break;
    }
-   Dmsg5(300, "%s Record: VolSessionId=%d VolSessionTime=%d JobId=%d DataLen=%d\n",
+   Dmsg5(300, _("%s Record: VolSessionId=%d VolSessionTime=%d JobId=%d DataLen=%d\n"),
          rtype, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);
 }