Changeset 1170 in MondoRescue for branches


Ignore:
Timestamp:
Feb 15, 2007, 1:07:22 AM (17 years ago)
Author:
Bruno Cornec
Message:

Includes are now also taken temporarily in common (to allow for ../common removal in files which is a bad practice)

Location:
branches/stable/mondo/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/mondoarchive/Makefile.am

    r1054 r1170  
    44## Process with Automake to generate Makefile.in
    55##
    6 AM_CPPFLAGS = -DMONDO_CONF_DIR=\"$(sysconfdir)\" -I${top_builddir}/src/include
     6AM_CPPFLAGS = -DMONDO_CONF_DIR=\"$(sysconfdir)\" -I${top_builddir}/src/include -I${top_builddir}/src/common
    77
    88## Headers
  • branches/stable/mondo/src/mondorestore/Makefile.am

    r1054 r1170  
    44## Process with Automake to generate Makefile.in
    55##
    6 AM_CPPFLAGS = -DMONDO_CONF_DIR=\"$(sysconfdir)\" -I${top_builddir}/src/include
     6AM_CPPFLAGS = -DMONDO_CONF_DIR=\"$(sysconfdir)\" -I${top_builddir}/src/include -I${top_builddir}/src/common
    77
    88## Headers
  • branches/stable/mondo/src/mondorestore/mondo-prep.c

    r1124 r1170  
    588588  }
    589589  // create device list from normal disks followed by spare ones
    590   asprintf(&devices, raidlist->el[i].data_disks.el[0].device);
     590  mr_asprintf(&devices, raidlist->el[i].data_disks.el[0].device);
    591591  for (j = 1; j < raidlist->el[i].data_disks.entries; j++) {
    592     asprintf(&strtmp, "%s", devices);
     592    mr_asprintf(&strtmp, "%s", devices);
    593593    mr_free(devices);
    594     asprintf(&devices, "%s %s", strtmp,
     594    mr_asprintf(&devices, "%s %s", strtmp,
    595595         raidlist->el[i].data_disks.el[j].device);
    596596    mr_free(strtmp);
    597597  }
    598598  for (j = 0; j < raidlist->el[i].spare_disks.entries; j++) {
    599     asprintf(&strtmp, "%s", devices);
     599    mr_asprintf(&strtmp, "%s", devices);
    600600    mr_free(devices);
    601     asprintf(&devices, "%s %s", strtmp,
     601    mr_asprintf(&devices, "%s %s", strtmp,
    602602         raidlist->el[i].spare_disks.el[j].device);
    603603    mr_free(strtmp);
     
    605605  // translate RAID level
    606606  if (raidlist->el[i].raid_level == -2) {
    607     asprintf(&level, "multipath");
     607    mr_asprintf(&level, "multipath");
    608608  } else if (raidlist->el[i].raid_level == -1) {
    609     asprintf(&level, "linear");
     609    mr_asprintf(&level, "linear");
    610610  } else {
    611     asprintf(&level, "raid%d", raidlist->el[i].raid_level);
     611    mr_asprintf(&level, "raid%d", raidlist->el[i].raid_level);
    612612  }
    613613  // create RAID device:
     
    616616  // - faulty devices ignored
    617617  // - persistent superblock always used as this is recommended
    618   asprintf(&program,
     618  mr_asprintf(&program,
    619619       "mdadm --create --force --run --auto=yes %s --level=%s --raid-devices=%d",
    620620       raidlist->el[i].raid_device, level,
    621621       raidlist->el[i].data_disks.entries);
    622622  if (raidlist->el[i].parity != -1) {
    623     asprintf(&strtmp, "%s", program);
     623    mr_asprintf(&strtmp, "%s", program);
    624624    mr_free(program);
    625625    switch(raidlist->el[i].parity) {
    626626    case 0:
    627       asprintf(&program, "%s --parity=%s", strtmp, "la");
     627      mr_asprintf(&program, "%s --parity=%s", strtmp, "la");
    628628      break;
    629629    case 1:
    630       asprintf(&program, "%s --parity=%s", strtmp, "ra");
     630      mr_asprintf(&program, "%s --parity=%s", strtmp, "ra");
    631631      break;
    632632    case 2:
    633       asprintf(&program, "%s --parity=%s", strtmp, "ls");
     633      mr_asprintf(&program, "%s --parity=%s", strtmp, "ls");
    634634      break;
    635635    case 3:
    636       asprintf(&program, "%s --parity=%s", strtmp, "rs");
     636      mr_asprintf(&program, "%s --parity=%s", strtmp, "rs");
    637637      break;
    638638    default:
     
    643643  }
    644644  if (raidlist->el[i].chunk_size != -1) {
    645     asprintf(&strtmp, "%s", program);
     645    mr_asprintf(&strtmp, "%s", program);
    646646    mr_free(program);
    647     asprintf(&program, "%s --chunk=%d", strtmp, raidlist->el[i].chunk_size);
     647    mr_asprintf(&program, "%s --chunk=%d", strtmp, raidlist->el[i].chunk_size);
    648648    mr_free(strtmp);
    649649  }
    650650  if (raidlist->el[i].spare_disks.entries > 0) {
    651     asprintf(&strtmp, "%s", program);
     651    mr_asprintf(&strtmp, "%s", program);
    652652    mr_free(program);
    653     asprintf(&program, "%s --spare-devices=%d", strtmp,
     653    mr_asprintf(&program, "%s --spare-devices=%d", strtmp,
    654654         raidlist->el[i].spare_disks.entries);
    655655    mr_free(strtmp);
    656656  }
    657   asprintf(&strtmp, "%s", program);
     657  mr_asprintf(&strtmp, "%s", program);
    658658  mr_free(program);
    659   asprintf(&program, "%s %s", strtmp, devices);
     659  mr_asprintf(&program, "%s %s", strtmp, devices);
    660660  mr_free(strtmp);
    661661  res = run_program_and_log_output(program, 1);
  • branches/stable/mondo/src/mondorestore/mondo-restore.c

    r1168 r1170  
    15801580restore_a_tarball_from_CD(char *tarball_fname,
    15811581                          long current_tarball_number,
    1582                           struct s_node *filelist, struct s_bkpinfo *)
     1582                          struct s_node *filelist, struct s_bkpinfo *bkpinfo)
    15831583{
    15841584    int retval = 0;
Note: See TracChangeset for help on using the changeset viewer.