Ignore:
Timestamp:
Feb 2, 2007, 11:31:00 PM (17 years ago)
Author:
Bruno Cornec
Message:

WARNING: Not tested yet ! Will be stabilized in next hours.
this patch changes the interface between mindi and mondo.
Everything is now managed through either MONDO_CACHE/mondo-restore.cfg
and MONDO_CACHE/mindi.conf (an additional configuration file)
This removes all the one line files NFS-*, ... that where used
in an anarchic way. Now everything computed by mondo is
under mondo-restore.cfg and everything related to mindi in mindi.conf

Still needed are the removal of the 2 parameters to mindi,
but that will be done after when a clear line is drawn between
where files are put by each tool.

MONDO_TMP and MINDI_TMP should be reserved for temporary files
MONDO_CACHE and MINDI_CACHE for end results and communication
between tools.
These changes were made in order to prepare the USB support in mondo

A first step in the right direction, but still some work to do
before it's working again.
Testers please be warned.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-tools.c

    r1080 r1087  
    1111#include "my-stuff.h"
    1212#include "mr_mem.h"
     13#include "mr_file.h"
    1314#include "mondostructures.h"
    1415#include "lib-common-externs.h"
     
    409410    char *iso_tmp;
    410411    char *iso_path;
     412    FILE *fd1 = NULL;
    411413
    412414    assert(bkpinfo != NULL);
     
    643645                bkpinfo->isodir);
    644646        log_it("command = %s", command);
    645         log_it("res of it = %s",
    646                call_program_and_get_last_line_of_output(command));
    647647        sprintf(iso_dev, "%s",
    648648                call_program_and_get_last_line_of_output(command));
    649         sprintf(tmp, "%s/ISO-DEV", bkpinfo->tmpdir);
    650         write_one_liner_data_file(tmp,
    651                                   call_program_and_get_last_line_of_output
    652                                   (command));
     649        log_it("res of it = %s", iso_dev);
     650
     651        fd1 = mr_fopen(MONDORESTORECFG, "a");
     652        mr_fprintf(fd1, "iso-dev %s\n", iso_dev);
    653653
    654654        sprintf(command, "mount | grep -w %s | tail -n1 | cut -d' ' -f3",
    655655                iso_dev);
    656656        log_it("command = %s", command);
    657         log_it("res of it = %s",
    658                call_program_and_get_last_line_of_output(command));
    659657        sprintf(iso_mnt, "%s",
    660658                call_program_and_get_last_line_of_output(command));
    661         sprintf(tmp, "%s/ISO-MNT", bkpinfo->tmpdir);
    662         write_one_liner_data_file(tmp,
    663                                   call_program_and_get_last_line_of_output
    664                                   (command));
     659
     660        log_it("res of it = %s", iso_mnt);
     661        mr_fprintf(fd1, "iso-mnt %s\n", iso_mnt);
    665662        log_it("isomnt: %s, %d", iso_mnt, strlen(iso_mnt));
     663
    666664        sprintf(iso_tmp, "%s", bkpinfo->isodir);
    667665        if (strlen(iso_tmp) < strlen(iso_mnt)) {
     
    670668            sprintf(iso_path, "%s", iso_tmp + strlen(iso_mnt));
    671669        }
    672         sprintf(tmp, "%s/ISODIR", bkpinfo->tmpdir);
    673         write_one_liner_data_file(tmp, iso_path);
    674670        log_it("isodir: %s", iso_path);
    675         sprintf(tmp, "%s/ISO-PREFIX", bkpinfo->tmpdir);
    676         write_one_liner_data_file(tmp, bkpinfo->prefix);
     671        mr_fprintf(fd1, "isodir %s\n", iso_path);
     672
    677673        log_it("iso-prefix: %s",  bkpinfo->prefix);
    678 
    679 /* End patch */
     674        mr_fprintf(fd1, "iso-prefix %s\n", bkpinfo->prefix);
     675
     676        mr_flcose(fd1);
    680677    }                           // end of iso code
    681678
Note: See TracChangeset for help on using the changeset viewer.