Changeset 1817 in MondoRescue for branches


Ignore:
Timestamp:
Nov 20, 2007, 3:36:00 PM (16 years ago)
Author:
Bruno Cornec
Message:

exclude_paths now a configuration item

Location:
branches/stable/mondo
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/distributions/conf/mondo.conf.dist

    r1769 r1817  
    9797mondo_boot_loader="NATIVE"
    9898
    99 # DONE
    10099#
    101100# Default compression tool
     
    115114mondo_compression_level=6
    116115
    117 # IN PROGRESS
    118 
    119116#
    120117# Paths to exclude from backup
     
    123120mondo_exclude_paths=""
    124121
     122# DONE
     123
     124# IN PROGRESS
    125125#
    126126# Paths to include onto the backup
  • branches/stable/mondo/src/common/libmondo-devices.c

    r1770 r1817  
    15551555    char *tmp = NULL;
    15561556    char *tmp1 = NULL;
     1557    char *tmp2 = NULL;
    15571558    char *sz_size = NULL;
    15581559    char *command = NULL;
     
    16991700                    bkpinfo->media_device);
    17001701        } else {
    1701 <<<<<<< .courant
    1702             mr_asprintf(&comment, _("What is your media device ?"));
     1702            if (bkpinfo->backup_media_type == usb) {
     1703                mr_asprintf(&comment, _("What is the /dev entry of your USB Disk/Key, please ?"));
     1704            } else {
     1705                mr_asprintf(&comment, _("What is your media device ?"));
     1706            }
    17031707            mr_asprintf(&tmp, mr_conf->media_device);
    17041708
     
    17061710                log_to_screen(_("User has chosen not to backup the PC"));
    17071711                finish(1);
    1708 =======
    1709             if ((find_cdrw_device(bkpinfo->media_device)) && (bkpinfo->backup_media_type != usb)) {
    1710                 bkpinfo->media_device[0] = '\0';
    1711 >>>>>>> .fusion-droit.r1769
    1712             }
    1713 <<<<<<< .courant
     1712            }
    17141713            mr_free(comment);
    17151714
     
    17251724                if (!popup_and_get_string("Device", comment, tmp, 5)) {
    17261725                    log_to_screen(_("User has chosen not to backup the PC"));
    1727 =======
    1728             if (bkpinfo->media_device[0]) {
    1729                 if (bkpinfo->backup_media_type == usb) {
    1730                     sprintf(tmp,
    1731                         "I think your %s media corresponds to %s. Is this correct?",
    1732                         media_descriptor_string(bkpinfo->backup_media_type),
    1733                         bkpinfo->media_device);
    1734                 } else {
    1735                     sprintf(tmp,
    1736                         "I think I've found your %s burner at SCSI node %s. Is this correct? (Say no if you have an IDE burner and you are running a 2.6 kernel. You will then be prompted for further details.)",
    1737                         media_descriptor_string(bkpinfo->backup_media_type),
    1738                         bkpinfo->media_device);
    1739                 }
    1740                 if (!ask_me_yes_or_no(tmp)) {
    1741                     bkpinfo->media_device[0] = '\0';
    1742                 }
    1743             }
    1744             if (!bkpinfo->media_device[0]) {
    1745                 if (bkpinfo->backup_media_type == usb) {
    1746                     i = popup_and_get_string("/dev entry?",
    1747                                          "What is the /dev entry of your USB Disk/Key, please?",
    1748                                          bkpinfo->media_device,
    1749                                          MAX_STR_LEN / 4);
    1750                 } else {
    1751                     if (g_kernel_version < 2.6) {
    1752                         i = popup_and_get_string("Device node?",
    1753                                              "What is the SCSI node of your CD (re)writer, please?",
    1754                                              bkpinfo->media_device,
    1755                                              MAX_STR_LEN / 4);
    1756                     } else {
    1757                         i = popup_and_get_string("/dev entry?",
    1758                                              "What is the /dev entry of your CD (re)writer, please?",
    1759                                              bkpinfo->media_device,
    1760                                              MAX_STR_LEN / 4);
    1761                     }
    1762                 }
    1763                 if (!i) {
    1764                     log_to_screen("User has chosen not to backup the PC");
    1765 >>>>>>> .fusion-droit.r1769
    17661726                    finish(1);
    17671727                }
     
    21062066        mr_asprintf(&tmp, list_of_NFS_mounts_only());
    21072067        if (strlen(tmp) > 2) {
    2108             if (bkpinfo->exclude_paths[0]) {
    2109                 strcat(bkpinfo->exclude_paths, " ");
    2110             }
    2111             strncpy(bkpinfo->exclude_paths, tmp, MAX_STR_LEN);
     2068            if (bkpinfo->exclude_paths != NULL) {
     2069                mr_strcat(bkpinfo->exclude_paths, " ");
     2070            }
     2071            mr_strcat(bkpinfo->exclude_paths,tmp);
    21122072        }
    21132073        mr_free(tmp);
  • branches/stable/mondo/src/common/libmondo-filelist.c

    r1770 r1817  
    15291529
    15301530    malloc_string(sz_datefile);
    1531     if (!(exclude_paths = malloc(8*MAX_STR_LEN))) {
    1532         fatal_error("Cannot malloc exclude_paths");
    1533     }
    15341531    malloc_string(g_skeleton_filelist);
    15351532    // The pathname to the skeleton filelist, used to give better progress reporting for mondo_makefilelist().
     
    15891586        mr_msg(2, "include_paths = '%s'", include_paths);
    15901587        mr_msg(1, "Calculating filelist");
    1591         snprintf(exclude_paths, (size_t)8*MAX_STR_LEN," %s %s %s %s %s %s %s . .. \
     1588        mr_asprintf(&exclude_paths, " %s %s %s %s %s %s %s . .. \
    15921589" MNT_CDROM " /mnt/floppy /media \
    15931590/proc /sys /tmp /var/log/lastlog /root/images/mondo " MINDI_CACHE " " MONDO_CACHE, excp, call_program_and_get_last_line_of_output("locate /win386.swp 2> /dev/null"), call_program_and_get_last_line_of_output("locate /hiberfil.sys 2> /dev/null"), call_program_and_get_last_line_of_output("locate /pagefile.sys 2> /dev/null"), (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir);
  • branches/stable/mondo/src/common/libmondo-tools.c

    r1770 r1817  
    770770    bkpinfo->backup_media_string[0] = '\0';
    771771    strcpy(bkpinfo->include_paths, "/");
    772     bkpinfo->exclude_paths[0] = '\0';
    773772    bkpinfo->call_before_iso[0] = '\0';
    774773    bkpinfo->call_make_iso[0] = '\0';
  • branches/stable/mondo/src/common/mondostructures.h

    r1769 r1817  
    497497   * the scratchdir, and the tempdir are automatically excluded.
    498498   */
    499     char exclude_paths[MAX_STR_LEN*4];
     499    char *exclude_paths;
    500500
    501501  /**
  • branches/stable/mondo/src/mondoarchive/mondo-cli.c

    r1770 r1817  
    506506
    507507    if (flag_set['E']) {
    508         if (bkpinfo->exclude_paths[0]) {
    509             strcat(bkpinfo->exclude_paths, " ");
     508        if (bkpinfo->exclude_paths != NULL) {
     509            mr_strcat(bkpinfo->exclude_paths, " ");
    510510        }
    511511        mr_asprintf(&tmp1, flag_val['E']);
     
    538538        }
    539539        mr_free(tmp1);
    540 
    541         strncpy(bkpinfo->exclude_paths + strlen(bkpinfo->exclude_paths),
    542                 flag_val['E'],
    543                 4*MAX_STR_LEN - strlen(bkpinfo->exclude_paths));
     540        mr_strcat(bkpinfo->exclude_paths, flag_val['E']);
    544541    }
    545542    if (flag_set['e']) {
     
    549546    {
    550547        mr_asprintf(&psz, list_of_NFS_mounts_only());
    551         if (bkpinfo->exclude_paths[0]) {
    552             strncat(bkpinfo->exclude_paths, " ", 4*MAX_STR_LEN);
    553         }
    554         strncat(bkpinfo->exclude_paths, psz, 4*MAX_STR_LEN);
     548        if (bkpinfo->exclude_paths != NULL) {
     549            mr_strcat(bkpinfo->exclude_paths, " ");
     550        }
     551        mr_strcat(bkpinfo->exclude_paths, psz);
    555552        mr_free(psz);
    556553        mr_msg(3, "-N means we're now excluding %s",
    557554                bkpinfo->exclude_paths);
    558     }
    559     if (strlen(bkpinfo->exclude_paths) >= 4*MAX_STR_LEN) {
    560         fatal_error
    561             ("Your '-E' parameter is too long. Increase MAX_STR_LEN");
    562555    }
    563556    if (flag_set['b']) {
Note: See TracChangeset for help on using the changeset viewer.