- Timestamp:
- Dec 21, 2013, 7:41:34 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mondo/src/common/libmondo-devices.c
r3207 r3212 489 489 490 490 if (!dev[0] || (res = mount_CDROM_here(dev, mountpoint))) { 491 if (!popup_and_get_string 492 ("CD-ROM device", "Please enter your CD-ROM's /dev device", 493 dev, MAX_STR_LEN / 4)) { 491 if (!popup_and_get_string("CD-ROM device", "Please enter your CD-ROM's /dev device", dev, MAX_STR_LEN / 4)) { 494 492 res = 1; 495 493 } else { … … 2133 2131 char *tmp1 = NULL; 2134 2132 char *mds = NULL; 2133 char *oldtmp = NULL; 2135 2134 char *q = NULL; 2136 2135 char p[16*MAX_STR_LEN]; … … 2287 2286 if (!bkpinfo->media_device[0]) { 2288 2287 if (bkpinfo->backup_media_type == usb) { 2289 i = popup_and_get_string("/dev entry?", 2290 "What is the /dev entry of your USB Disk/Key, please?", 2291 bkpinfo->media_device, 2292 MAX_STR_LEN / 4); 2288 i = popup_and_get_string("/dev entry?", "What is the /dev entry of your USB Disk/Key, please?", bkpinfo->media_device, MAX_STR_LEN / 4); 2293 2289 } else { 2294 2290 if (g_kernel_version < 2.6) { 2295 i = popup_and_get_string("Device node?", 2296 "What is the SCSI node of your CD (re)writer, please?", 2297 bkpinfo->media_device, 2298 MAX_STR_LEN / 4); 2291 i = popup_and_get_string("Device node?", "What is the SCSI node of your CD (re)writer, please?", bkpinfo->media_device, MAX_STR_LEN / 4); 2299 2292 } else { 2300 i = popup_and_get_string("/dev entry?", 2301 "What is the /dev entry of your CD (re)writer, please?", 2302 bkpinfo->media_device, 2303 MAX_STR_LEN / 4); 2293 i = popup_and_get_string("/dev entry?", "What is the /dev entry of your CD (re)writer, please?", bkpinfo->media_device, MAX_STR_LEN / 4); 2304 2294 } 2305 2295 } … … 2350 2340 } 2351 2341 if (!bkpinfo->media_device[0]) { 2352 if (!popup_and_get_string 2353 ("Device name?", 2354 "What is the /dev entry of your tape streamer?", 2355 bkpinfo->media_device, MAX_STR_LEN / 4)) { 2342 if (!popup_and_get_string("Device name?", "What is the /dev entry of your tape streamer?", bkpinfo->media_device, MAX_STR_LEN / 4)) { 2356 2343 log_to_screen("User has chosen not to backup the PC"); 2357 2344 finish(1); … … 2365 2352 mr_free(tmp); 2366 2353 2367 if (!popup_and_get_string 2368 ("Tape block size?", 2369 "What is the block size of your tape streamer?", 2370 sz_size, 15)) { 2354 if (!popup_and_get_string("Tape block size?", "What is the block size of your tape streamer?", sz_size, 15)) { 2371 2355 log_to_screen("User has chosen not to backup the PC"); 2372 2356 finish(1); … … 2420 2404 #endif 2421 2405 { 2422 if (!popup_and_get_string 2423 ("Network shared dir.", 2424 "Please enter path and directory where archives are stored remotely. (Mondo has taken a guess at the correct value. If it is incorrect, delete it and type the correct one.)", 2425 p, MAX_STR_LEN / 4)) { 2406 if (!popup_and_get_string("Network shared dir.", "Please enter path and directory where archives are stored remotely. (Mondo has taken a guess at the correct value. If it is incorrect, delete it and type the correct one.)", p, MAX_STR_LEN / 4)) { 2426 2407 log_to_screen("User has chosen not to backup the PC"); 2427 2408 finish(1); … … 2564 2545 } 2565 2546 strcpy(tmp1, bkpinfo->netfs_remote_dir); 2566 if (!popup_and_get_string 2567 ("Directory", "Which directory within that mountpoint?", tmp1, 2568 MAX_STR_LEN)) { 2547 if (!popup_and_get_string ("Directory", "Which directory within that mountpoint?", tmp1, MAX_STR_LEN)) { 2569 2548 log_to_screen("User has chosen not to backup the PC"); 2570 2549 finish(1); … … 2576 2555 mr_strip_spaces(bkpinfo->netfs_remote_dir); 2577 2556 2578 if (!popup_and_get_string 2579 ("Prefix.", 2580 "Please enter the prefix that will be prepended to your ISO filename. Example: machine1 to obtain machine1-[1-9]*.iso files", 2581 bkpinfo->prefix, MAX_STR_LEN / 4)) { 2557 if (!popup_and_get_string("Prefix.", "Please enter the prefix that will be prepended to your ISO filename. Example: machine1 to obtain machine1-[1-9]*.iso files", bkpinfo->prefix, MAX_STR_LEN / 4)) { 2582 2558 log_to_screen("User has chosen not to backup the PC"); 2583 2559 finish(1); … … 2590 2566 case iso: 2591 2567 if (!bkpinfo->disaster_recovery) { 2592 if (!popup_and_get_string 2593 ("Storage dir.", 2594 "Please enter the full path name to the directory for your ISO images. Example: /mnt/raid0_0", 2595 bkpinfo->isodir, MAX_STR_LEN / 4)) { 2568 if (!popup_and_get_string("Storage dir.", "Please enter the full path name to the directory for your ISO images. Example: /mnt/raid0_0", bkpinfo->isodir, MAX_STR_LEN / 4)) { 2596 2569 log_to_screen("User has chosen not to backup the PC"); 2597 2570 finish(1); … … 2607 2580 } 2608 2581 sprintf(tmp1, "%d", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4482 MB 2609 if (!popup_and_get_string 2610 ("ISO size.", 2611 "Please enter how big you want each ISO image to be (in megabytes). This should be less than or equal to the size of the CD-R[W]'s (700) or DVD's (4480) you plan to backup to.", 2612 tmp1, 16)) { 2582 if (!popup_and_get_string("ISO size.", "Please enter how big you want each ISO image to be (in megabytes). This should be less than or equal to the size of the CD-R[W]'s (700) or DVD's (4480) you plan to backup to.", tmp1, 16)) { 2613 2583 log_to_screen("User has chosen not to backup the PC"); 2614 2584 finish(1); … … 2619 2589 } 2620 2590 } 2621 if (!popup_and_get_string 2622 ("Prefix.", 2623 "Please enter the prefix that will be prepended to your ISO filename. Example: machine1 to obtain machine1-[1-9]*.iso files", 2624 bkpinfo->prefix, MAX_STR_LEN / 4)) { 2591 if (!popup_and_get_string("Prefix.", "Please enter the prefix that will be prepended to your ISO filename. Example: machine1 to obtain machine1-[1-9]*.iso files", bkpinfo->prefix, MAX_STR_LEN / 4)) { 2625 2592 log_to_screen("User has chosen not to backup the PC"); 2626 2593 finish(1); … … 2648 2615 2649 2616 #ifdef __FreeBSD__ 2650 if (!popup_and_get_string 2651 ("Boot device", 2652 "What is your boot device? (e.g. /dev/ad0)", 2653 bkpinfo->boot_device, MAX_STR_LEN / 4)) { 2617 if (!popup_and_get_string("Boot device", "What is your boot device? (e.g. /dev/ad0)", bkpinfo->boot_device, MAX_STR_LEN / 4)) { 2654 2618 log_to_screen("User has chosen not to backup the PC"); 2655 2619 finish(1); … … 2657 2621 i = which_boot_loader(bkpinfo->boot_device); 2658 2622 #else 2659 if (!popup_and_get_string 2660 ("Boot device", 2661 "What is your boot device? (e.g. /dev/hda)", 2662 bkpinfo->boot_device, MAX_STR_LEN / 4)) { 2623 if (!popup_and_get_string("Boot device", "What is your boot device? (e.g. /dev/hda)", bkpinfo->boot_device, MAX_STR_LEN / 4)) { 2663 2624 log_to_screen("User has chosen not to backup the PC"); 2664 2625 finish(1); … … 2693 2654 strcpy(tmp1, "/"); 2694 2655 } 2695 if (!popup_and_get_string 2696 ("Backup paths", 2697 "Please enter paths (separated by '|') which you want me to backup. The default is '/' (i.e. everything).", 2698 tmp1, MAX_STR_LEN)) { 2656 if (!popup_and_get_string("Backup paths", "Please enter paths (separated by '|') which you want me to backup. The default is '/' (i.e. everything).", tmp1, MAX_STR_LEN)) { 2699 2657 log_to_screen("User has chosen not to backup the PC"); 2700 2658 finish(1); … … 2710 2668 strcpy(tmp1, call_program_and_get_last_line_of_output("parted2fdisk -l | grep -i ntfs | awk '{ print $1};' | tr -s '\\n' ' ' | awk '{ print $0};'")); 2711 2669 if (strlen(tmp1) > 2) { 2712 if (!popup_and_get_string 2713 ("NTFS partitions", 2714 "Please enter/confirm the NTFS partitions you wish to backup as well.", 2715 tmp1, MAX_STR_LEN / 4)) { 2670 if (!popup_and_get_string("NTFS partitions", "Please enter/confirm the NTFS partitions you wish to backup as well.", tmp1, MAX_STR_LEN / 4)) { 2716 2671 log_to_screen("User has chosen not to backup the PC"); 2717 2672 finish(1); … … 2734 2689 bkpinfo->exclude_paths = tmp; 2735 2690 2736 if (!popup_and_get_string 2737 ("Temporary directory", 2738 "Please enter your temporary directory.", 2739 bkpinfo->tmpdir, (4*MAX_STR_LEN)-1)) { 2691 mr_asprintf(oldtmp, "%s", bkpinfo->tmpdir); 2692 if (bkpinfo->tmpdir != NULL ) { 2693 strncpy(p,bkpinfo->tmpdir,(16*MAX_STR_LEN)-1); 2694 } else { 2695 p[0] = '\0'; 2696 } 2697 if (!popup_and_get_string("Temporary directory", "Please enter your temporary directory.", p, (4*MAX_STR_LEN)-1)) { 2740 2698 log_to_screen("User has chosen not to backup the PC"); 2741 2699 finish(1); 2742 2700 } 2743 2701 /* if modified to another path */ 2744 if (strstr(bkpinfo->tmpdir,"mondo.tmp.") == NULL) { 2745 setup_tmpdir(bkpinfo->tmpdir); 2746 } 2747 if (!popup_and_get_string 2748 ("Scratch directory", 2749 "Please enter your scratch directory.", 2750 bkpinfo->scratchdir, (4*MAX_STR_LEN)-1)) { 2702 if (strcmp(p,oldtmp) != 0) { 2703 setup_tmpdir(p); 2704 } 2705 mr_free(oldtmp); 2706 2707 mr_asprintf(oldtmp, "%s", bkpinfo->scratchdir); 2708 if (bkpinfo->scratchdir != NULL ) { 2709 strncpy(p,bkpinfo->scratchdir,(16*MAX_STR_LEN)-1); 2710 } else { 2711 p[0] = '\0'; 2712 } 2713 if (!popup_and_get_string("Scratch directory", "Please enter your scratch directory.", p, (4*MAX_STR_LEN)-1)) { 2751 2714 log_to_screen("User has chosen not to backup the PC"); 2752 2715 finish(1); 2753 2716 } 2754 2717 /* if modified to another path */ 2755 if (strstr(bkpinfo->scratchdir,"mondo.scratch.") == NULL) { 2756 setup_scratchdir(bkpinfo->scratchdir); 2757 } 2718 if (strcmp(p,oldtmp) != 0) { 2719 setup_scratchdir(p); 2720 } 2721 mr_free(oldtmp); 2722 2758 2723 if (ask_me_yes_or_no("Do you want to backup extended attributes?")) { 2759 2724 if (find_home_of_exe("getfattr")) {
Note:
See TracChangeset
for help on using the changeset viewer.