Ignore:
Timestamp:
May 13, 2006, 8:47:23 PM (18 years ago)
Author:
bcornec
Message:

Stable is reverted to r436 (2.0.7) to put it in line with 2.0.8 and start from there over

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/mondo/mondoarchive/mondo-cli.c

    r538 r541  
    247247        flag_set[i] = FALSE;
    248248    }
     249    //  strcpy (bkpinfo->tmpdir, "/root/images/mondo");
     250    //  strcpy (bkpinfo->scratchdir, "/home");
    249251    for (j = 1; j <= MAX_NOOF_MEDIA; j++) {
    250252        bkpinfo->media_size[j] = 650;
     
    354356    /*@ buffers ** */
    355357    char *tmp;
    356     char *tmp1;
    357358    char *psz;
    358359
     
    376377    if (i == 0) {
    377378        retval++;
    378         log_to_screen(_("You must specify the media type\n"));
     379        log_to_screen("You must specify the media type\n");
    379380    }
    380381    if (i > 1) {
    381382        retval++;
    382         log_to_screen(_("Please specify only one media type\n"));
     383        log_to_screen("Please specify only one media type\n");
    383384    }
    384385    if (flag_set['K']) {
     
    390391    if (flag_set['L'] && flag_set['0']) {
    391392        retval++;
    392         log_to_screen(_("You cannot have 'no compression' _and_ LZOP.\n"));
     393        log_to_screen("You cannot have 'no compression' _and_ LZOP.\n");
    393394    }
    394395    bkpinfo->backup_data = flag_set['O'];
    395396    bkpinfo->verify_data = flag_set['V'];
    396397    if (flag_set['I'] && !bkpinfo->backup_data) {
    397         log_to_screen(_("-I switch is ignored if just verifying"));
     398        log_to_screen("-I switch is ignored if just verifying");
    398399    }
    399400    if (flag_set['E'] && !bkpinfo->backup_data) {
    400         log_to_screen(_("-E switch is ignored if just verifying"));
     401        log_to_screen("-E switch is ignored if just verifying");
    401402    }
    402403
     
    426427        if (flag_set['f'] || flag_set['l']) {
    427428            log_to_screen
    428                 (_("You don't need to specify bootloader or bootdevice"));
     429                ("You don't need to specify bootloader or bootdevice");
    429430        }
    430431    }
     
    441442            strcat(bkpinfo->include_paths, " ");
    442443        }
    443         asprintf(&tmp1, flag_val['I']);
    444         char *p = tmp1;
    445         char *q = tmp1;
    446 
    447         /* Cut the flag_val['I'] in parts containing all paths to test them */
    448         while (p != NULL) {
    449             q = strchr(p, ' ');
    450             if (q != NULL) {
    451                 *q = '\0';
    452                 p = q+1 ;
    453                 if (stat(p, &buf) != 0) {
    454                     log_msg(1, "ERROR ! %s doesn't exist", p);
    455                     fatal_error("ERROR ! You specified a directory to include which doesn't exist");
    456                 }
    457             } else {
    458                 if (stat(p, &buf) != 0) {
    459                     log_msg(1, "ERROR ! %s doesn't exist", p);
    460                     fatal_error("ERROR ! You specified a directory to include which doesn't exist");
    461                 }
    462                 p = NULL;
    463             }
    464         }
    465         paranoid_free(tmp1);
    466 
     444        if (stat(flag_val['I'], &buf) != 0) {
     445            log_msg(1, "ERROR ! %s doesn't exist", flag_val['I']);
     446            fatal_error("ERROR ! You specified a directory to include which doesn't exist");
     447        }
    467448        strncpy(bkpinfo->include_paths + strlen(bkpinfo->include_paths),
    468449                flag_val['I'],
    469                 4*MAX_STR_LEN - strlen(bkpinfo->include_paths));
     450                MAX_STR_LEN - strlen(bkpinfo->include_paths));
    470451        log_msg(1, "include_paths is now '%s'", bkpinfo->include_paths);
    471452        if (bkpinfo->include_paths[0] == '-') {
    472453            retval++;
    473             log_to_screen(_("Please supply a sensible value with '-I'\n"));
     454            log_to_screen("Please supply a sensible value with '-I'\n");
    474455        }
    475456    }
     
    486467            retval++;
    487468            log_to_screen
    488                 (_("Please do not use -J in combination with -I. If you want to make a list of files to backup, that's fine, use -J <filename> but please don't combine -J with -I. Thanks. :-)"));
     469                ("Please do not use -J in combination with -I. If you want to make a list of files to backup, that's fine, use -J <filename> but please don't muddy the waters by combining -J with -I. Thanks. :-)");
    489470        }
    490471        bkpinfo->make_filelist = FALSE;
     
    504485        if (g_kernel_version >= 2.6 && !strstr(flag_val['d'], "/dev/")) {
    505486            log_to_screen
    506                 (_("Linus says 2.6 has a broken ide-scsi module. Proceed at your own risk..."));
     487                ("Linus says 2.6 has a broken ide-scsi module. Proceed at your own risk...");
    507488        }
    508489
     
    520501            if (!flag_set['L']) {
    521502                log_to_screen
    522                     (_("You must use -L with -C. Therefore I am setting it for you."));
     503                    ("You must use -L with -C. Therefore I am setting it for you.");
    523504                flag_set['L'] = 1;
    524505                flag_val['L'][0] = '\0';
     
    550531        flag_set['d'] = TRUE;
    551532        sprintf(tmp,
    552                 _("You didn't specify a tape streamer device. I'm assuming %s"),
     533                "You didn't specify a tape streamer device. I'm assuming %s",
    553534                flag_val['d']);
    554535        log_to_screen(tmp);
     
    565546            if (!find_dvd_device(flag_val['d'], FALSE)) {
    566547                flag_set['d'] = TRUE;
    567                 log_to_screen(_("I guess DVD drive is at %s"), flag_val['d']);
     548                log_to_screen("I guess DVD drive is at %s", flag_val['d']);
    568549            }
    569550        }
     
    584565            strcat(flag_val['s'], "m");
    585566            log_to_screen
    586                 (_("You did not specify a size (-s) for DVD. I'm guessing %s."),
     567                ("You did not specify a size (-s) for DVD. I'm guessing %s.",
    587568                 flag_val['s']);
    588569            flag_set['s'] = 1;
     
    640621        if (strlen(bkpinfo->isodir) < 3) {
    641622            retval++;
    642             log_to_screen(_("NFS share is not mounted. Please mount it.\n"));
     623            log_to_screen("NFS share is not mounted. Please mount it.\n");
    643624        }
    644625        log_msg(3, "mount = %s", bkpinfo->nfs_mount);
     
    678659            strcat(bkpinfo->exclude_paths, " ");
    679660        }
    680         asprintf(&tmp1, flag_val['E']);
    681         char *p = tmp1;
    682         char *q = tmp1;
    683 
    684         /* Cut the flag_val['E'] in parts containing all paths to test them */
    685         while (p != NULL) {
    686             q = strchr(p, ' ');
    687             if (q != NULL) {
    688                 *q = '\0';
    689                 p = q+1 ;
    690                 if (stat(p, &buf) != 0) {
    691                     log_msg(1, "WARNING ! %s doesn't exist", p);
    692                 }
    693             } else {
    694                 if (stat(p, &buf) != 0) {
    695                     log_msg(1, "WARNING ! %s doesn't exist", p);
    696                 }
    697                 p = NULL;
    698             }
    699         }
    700         paranoid_free(tmp1);
    701 
     661        if (stat(flag_val['E'], &buf) != 0) {
     662            log_msg(1, "WARNING ! %s doesn't exist", flag_val['E']);
     663        }
    702664        strncpy(bkpinfo->exclude_paths + strlen(bkpinfo->exclude_paths),
    703665                flag_val['E'],
    704                 4*MAX_STR_LEN - strlen(bkpinfo->exclude_paths));
     666                MAX_STR_LEN - strlen(bkpinfo->exclude_paths));
    705667    }
    706668    if (flag_set['e']) {
     
    765727            retval++;
    766728            sprintf(tmp,
    767                     _("You specified kernel '%s', which does not exist\n"),
     729                    "You specified kernel '%s', which does not exist\n",
    768730                    bkpinfo->kernel_path);
    769731            log_to_screen(tmp);
     
    797759            retval++;
    798760            sprintf(tmp,
    799                     _("Are you sure directory '%s' exists in remote dir '%s'?\nIf so, do you have rights to write to it?\n"),
     761                    "Are you sure directory '%s' exists in remote dir '%s'?\nIf so, do you have rights to write to it?\n",
    800762                    bkpinfo->nfs_remote_dir, bkpinfo->nfs_mount);
    801763            log_to_screen(tmp);
     
    807769        if (g_kernel_version >= 2.6) {
    808770            if (popup_and_get_string
    809                 (_("Device"), _("Please specify the device"),
     771                ("Device", "Please specify the device",
    810772                 bkpinfo->media_device, MAX_STR_LEN / 4)) {
    811773                retval++;
    812                 log_to_screen(_("User opted to cancel."));
     774                log_to_screen("User opted to cancel.");
    813775            }
    814776        } else if (find_cdrw_device(bkpinfo->media_device)) {
    815777            retval++;
    816778            log_to_screen
    817                 (_("Tried and failed to find CD-R[W] drive automatically.\n"));
     779                ("Tried and failed to find CD-R[W] drive automatically.\n");
    818780        } else {
    819781            flag_set['d'] = TRUE;
     
    824786    if (!flag_set['d'] && !flag_set['n'] && !flag_set['C']) {
    825787        retval++;
    826         log_to_screen(_("Please specify the backup device/directory.\n"));
     788        log_to_screen("Please specify the backup device/directory.\n");
    827789        fatal_error
    828790            ("You didn't use -d to specify the backup device/directory.");
     
    845807            retval++;
    846808            log_to_screen
    847                 (_("Please specify a tempdir which I can write to. :)"));
     809                ("Please specify a tempdir which I can write to. :)");
    848810            fatal_error("I cannot write to the tempdir you specified.");
    849811        }
     
    853815            retval++;
    854816            log_to_screen
    855                 (_("Please don't specify a SAMBA or VFAT or NFS tmpdir."));
     817                ("Please don't specify a SAMBA or VFAT or NFS tmpdir.");
    856818            fatal_error("I cannot write to the tempdir you specified.");
    857819        }
     
    901863        i = which_boot_loader(tmp);
    902864        log_msg(3, "boot loader is %c, residing at %s", i, tmp);
    903         printf(_("boot loader is %c, residing at %s\n"), i, tmp);
     865        printf("boot loader is %c, residing at %s\n", i, tmp);
    904866        finish(0);
    905867    }
     
    909871            retval++;
    910872            log_to_screen
    911                 (_("Please install LZOP. You can't use '-L' until you do.\n"));
     873                ("Please install LZOP. You can't use '-L' until you do.\n");
    912874        }
    913875    }
     
    916878        &&
    917879        !run_program_and_log_output
    918         ("egrep -i suse /etc/issue.net | egrep '9.0' | grep 64", TRUE)) {
     880        ("grep -i suse /etc/issue.net | grep 64", TRUE)) {
    919881        bkpinfo->make_cd_use_lilo = TRUE;
    920882        log_to_screen
    921             (_("Forcing you to use LILO. SuSE 9.0 (64-bit) has a broken mkfs.vfat binary."));
     883            ("Forcing you to use LILO. SuSE 9.0 (64-bit) has a broken mkfs.vfat binary.");
    922884    }
    923885    if (flag_set['o']) {
     
    929891            bkpinfo->make_cd_use_lilo = TRUE;
    930892            log_to_screen
    931                 (_("Your kernel appears not to support vfat filesystems. I am therefore"));
    932             log_to_screen
    933                 (_("using LILO instead of SYSLINUX as the CD/floppy's boot loader."));
     893                ("Your kernel appears not to support vfat filesystems. I am therefore");
     894            log_to_screen
     895                ("using LILO instead of SYSLINUX as the CD/floppy's boot loader.");
    934896        }
    935897        if (run_program_and_log_output("which mkfs.vfat", FALSE)) {
     
    937899#ifdef __IA32__
    938900            log_to_screen
    939                 (_("Your filesystem is missing 'mkfs.vfat', so I cannot use SYSLINUX as"));
    940             log_to_screen
    941                 (_("your boot loader. I shall therefore use LILO instead."));
     901                ("Your filesystem is missing 'mkfs.vfat', so I cannot use SYSLINUX as");
     902            log_to_screen
     903                ("your boot loader. I shall therefore use LILO instead.");
    942904#endif
    943905#ifdef __IA64__
    944906            log_to_screen
    945                 (_("Your filesystem is missing 'mkfs.vfat', so I cannot prepare the EFI"));
    946             log_to_screen(_("environment correctly. Please install it."));
     907                ("Your filesystem is missing 'mkfs.vfat', so I cannot prepare the EFI");
     908            log_to_screen("environment correctly. Please install it.");
    947909            fatal_error("Aborting");
    948910#endif
     
    962924    if (i == 0) {
    963925        retval++;
    964         log_to_screen(_("Specify backup (-O), verify (-V) or both (-OV).\n"));
     926        log_to_screen("Specify backup (-O), verify (-V) or both (-OV).\n");
    965927    }
    966928
     
    1016978            if (flag_set[optopt]) {
    1017979                bad_switches = TRUE;
    1018                 sprintf(tmp, _("Switch -%c previously defined as %s\n"), opt,
     980                sprintf(tmp, "Switch -%c previously defined as %s\n", opt,
    1019981                        flag_val[i]);
    1020982                log_to_screen(tmp);
     
    1026988                        optarg[--len] = '\0';
    1027989                        log_to_screen
    1028                             (_("Warning - param '%s' should not have trailing slash!"),
     990                            ("Warning - param '%s' should not have trailing slash!",
    1029991                             optarg);
    1030992                    }
     
    1033995                            && flag_val[opt][0] != '/') {
    1034996                            sprintf(tmp,
    1035                                     _("-%c flag --- must be absolute path --- '%s' isn't absolute"),
     997                                    "-%c flag --- must be absolute path --- '%s' isn't absolute",
    1036998                                    opt, flag_val[opt]);
    1037999                            log_to_screen(tmp);
     
    10461008    for (i = optind; i < argc; i++) {
    10471009        bad_switches = TRUE;
    1048         sprintf(tmp, _("Invalid arg -- %s\n"), argv[i]);
     1010        sprintf(tmp, "Invalid arg -- %s\n", argv[i]);
    10491011        log_to_screen(tmp);
    10501012    }
     
    10791041    case SIGINT:
    10801042        sprintf(tmp, "SIGINT");
    1081         strcpy(tmp2, _("You interrupted me :-)"));
     1043        strcpy(tmp2, "You interrupted me :-)");
    10821044        break;
    10831045    case SIGKILL:
    10841046        sprintf(tmp, "SIGKILL");
    10851047        strcpy(tmp2,
    1086                _("I seriously have no clue how this signal even got to me. Something's wrong with your system."));
     1048               "I seriously have no clue how this signal even got to me. Something's wrong with your system.");
    10871049        break;
    10881050    case SIGTERM:
    10891051        sprintf(tmp, "SIGTERM");
    1090         strcpy(tmp2, _("Got terminate signal"));
     1052        strcpy(tmp2, "Got terminate signal");
    10911053        break;
    10921054    case SIGHUP:
    10931055        sprintf(tmp, "SIGHUP");
    1094         strcpy(tmp2, _("Hangup on line"));
     1056        strcpy(tmp2, "Hangup on line");
    10951057        break;
    10961058    case SIGSEGV:
    10971059        sprintf(tmp, "SIGSEGV");
    10981060        strcpy(tmp2,
    1099                _("Internal programming error. Please send a backtrace as well as your log."));
     1061               "Internal programming error. Please send a backtrace as well as your log.");
    11001062        break;
    11011063    case SIGPIPE:
    11021064        sprintf(tmp, "SIGPIPE");
    1103         strcpy(tmp2, _("Pipe was broken"));
     1065        strcpy(tmp2, "Pipe was broken");
    11041066        break;
    11051067    case SIGABRT:
    11061068        sprintf(tmp, "SIGABRT");
    11071069        sprintf(tmp2,
    1108                 _("Abort - probably failed assertion. I'm sleeping for a few seconds so you can read the message."));
     1070                "Abort - probably failed assertion. I'm sleeping for a few seconds so you can read the message.");
    11091071        break;
    11101072    default:
    1111         sprintf(tmp, _("(Unknown)"));
    1112     }
    1113 
    1114     strcat(tmp, _(" signal received from OS"));
     1073        sprintf(tmp, "(Unknown)");
     1074    }
     1075
     1076    strcat(tmp, " signal received from OS");
    11151077    log_to_screen(tmp);
    11161078    log_to_screen(tmp2);
Note: See TracChangeset for help on using the changeset viewer.