]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/bscan.c
- Modify DVD code so that it keeps a state flag that indicates
[bacula/bacula] / bacula / src / stored / bscan.c
index 8de282c633b7392e41a9e6a305f30f3e94ee620a..b46c66c27328a00ff40302cb09ac308210420a1b 100644 (file)
@@ -14,7 +14,7 @@
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
-   version 2 as ammended with additional clauses defined in the
+   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,
@@ -107,7 +107,7 @@ static void usage()
 {
    fprintf(stderr, _(
 "Copyright (C) 2001-2005 Kern Sibbald.\n"
-"\nVersion: " VERSION " (" BDATE ")\n\n"
+"\nVersion: %s (%s)\n\n"
 "Usage: bscan [ options ] <bacula-archive>\n"
 "       -b bootstrap      specify a bootstrap file\n"
 "       -c <file>         specify configuration file\n"
@@ -124,7 +124,7 @@ static void usage()
 "       -v                verbose\n"
 "       -V <Volumes>      specify Volume names (separated by |)\n"
 "       -w <dir>          specify working directory (default from conf file)\n"
-"       -?                print this message\n\n"));
+"       -?                print this message\n\n"), VERSION, BDATE);
    exit(1);
 }
 
@@ -134,6 +134,10 @@ int main (int argc, char *argv[])
    struct stat stat_buf;
    char *VolumeName = NULL;
 
+   setlocale(LC_ALL, "");
+   bindtextdomain("bacula", LOCALEDIR);
+   textdomain("bacula");
+
    my_name_is(argc, argv, "bscan");
    init_msg(NULL, NULL);
 
@@ -278,9 +282,14 @@ int main (int argc, char *argv[])
    }
 
    do_scan();
-   printf("Records %sadded or updated in the catalog:\n%7d Media\n%7d Pool\n%7d Job\n%7d File\n",
-      update_db?"":"would have been ",
-      num_media, num_pools, num_jobs, num_files);
+   if (update_db) {
+      printf("Records added or updated in the catalog:\n%7d Media\n%7d Pool\n%7d Job\n%7d File\n",
+         num_media, num_pools, num_jobs, num_files);
+   }
+   else {
+      printf("Records would have been added or updated in the catalog:\n%7d Media\n%7d Pool\n%7d Job\n%7d File\n",
+         num_media, num_pools, num_jobs, num_files);
+   }
 
    free_jcr(bjcr);
    term_dev(dev);
@@ -369,7 +378,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
       if (showProgress) {
          int pct = (mr.VolBytes * 100) / currentVolumeSize;
          if (pct != last_pct) {
-            fprintf(stdout, "done: %d%%\n", pct);
+            fprintf(stdout, _("done: %d%%\n"), pct);
             fflush(stdout);
             last_pct = pct;
          }
@@ -494,6 +503,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
          update_db = save_update_db;
 
          jr.PoolId = pr.PoolId;
+#ifdef xxx
          /* Set start positions into JCR */
          if (dev->is_tape()) {
             /*
@@ -506,6 +516,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
             dcr->StartBlock = (uint32_t)dev->file_addr;
             dcr->StartFile = (uint32_t)(dev->file_addr >> 32);
          }
+#endif
          mjcr->start_time = jr.StartTime;
          mjcr->JobLevel = jr.JobLevel;
 
@@ -1213,7 +1224,7 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr)
       offline_dev(dev);
    }
    force_close_device(dev);
-   fprintf(stderr, "Mount Volume \"%s\" on device %s and press return when ready: ",
+   fprintf(stderr, _("Mount Volume \"%s\" on device %s and press return when ready: "),
          dcr->VolumeName, dev->print_name());
    getchar();
    return true;