Changeset 1917


Ignore:
Timestamp:
Apr 17, 2008, 1:29:45 AM (11 years ago)
Author:
bruno
Message:

mondo.libmondo-cli.patch (Mark Pinkerton <Mark.Pinkerton_at_emageon.com>) modified to not duplicate the newt initialization stuff (we should rather remove them in mondoarchive)

Location:
branches/2.2.6/mondo/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.6/mondo/src/common/Makefile.am

    r831 r1917  
    1111                       libmondo-mountlist.c libmondo-raid.c \
    1212                       libmondo-stream.c libmondo-string.c libmondo-tools.c \
    13                        libmondo-verify.c newt-specific.c \
     13                       libmondo-verify.c newt-specific.c libmondo-cli.c \
    1414                       libmondo-archive.h libmondo-devices.h \
    1515                       libmondo-filelist.h libmondo-files.h libmondo-fork.h \
    1616                       libmondo-gui.h libmondo-mountlist.h libmondo-raid.h \
    1717                       libmondo-stream.h libmondo-string.h libmondo-tools.h \
    18                        libmondo-verify.h libmondo-fifo.h \
     18                       libmondo-verify.h libmondo-fifo.h libmondo-cli.h \
    1919                       libmondo-archive-EXT.h my-stuff.h mondostructures.h \
    2020                       libmondo-devices-EXT.h libmondo-fifo-EXT.h \
     
    2323                       libmondo-mountlist-EXT.h libmondo-raid-EXT.h  \
    2424                       libmondo-string-EXT.h libmondo-tools-EXT.h \
    25                        libmondo-verify-EXT.h  libmondo-stream-EXT.h \
     25                       libmondo-verify-EXT.h  libmondo-stream-EXT.h libmondo-cli-EXT.h \
    2626                       newt-specific.h \
    2727                       mr_string.c mr_string.h
  • branches/2.2.6/mondo/src/common/libmondo-cli-EXT.h

    r1915 r1917  
    1 /* mondo-cli-EXT.h */
     1/* libmondo-cli-EXT.h */
    22
    33extern int handle_incoming_parameters(int argc, char *argv[]);
  • branches/2.2.6/mondo/src/common/libmondo-cli.c

    r1915 r1917  
    162162
    163163#include <pthread.h>
    164 #include "../common/my-stuff.h"
    165 #include "../common/mondostructures.h"
    166 #include "mondo-cli-EXT.h"
    167 #include "../common/libmondo.h"
    168 
    169 //static char cvsid[] = "$Id$";
     164#include "my-stuff.h"
     165#include "mondostructures.h"
     166#include "libmondo-cli-EXT.h"
     167#include "libmondo.h"
    170168
    171169extern int g_loglevel;
    172170extern bool g_text_mode;
    173 extern bool g_skip_floppies;    ///< Whether to skip the creation of boot disks
     171bool g_skip_floppies;   ///< Whether to skip the creation of boot disks
    174172extern char g_startdir[MAX_STR_LEN];    ///< ????? @bug ?????
    175173extern bool g_sigpipe;
     174extern char *MONDO_OPTIONS;
    176175
    177176/*@ file pointer **************************************************/
     
    190189
    191190extern void setup_tmpdir(char *path);
    192 
    193 /**
    194  * Whether we're restoring from ISOs. Obviously not, since this is the
    195  * backup program.
    196  * @note You @b MUST declare this variable somewhere in your program if
    197  * you use libmondo. Otherwise the link will fail.
    198  * @ingroup globalGroup
    199  */
    200 bool g_ISO_restore_mode = FALSE;
    201 
    202 
    203191extern double g_kernel_version;
    204192extern int g_current_media_number;
     
    208196/* Do we use extended attributes and acl ?
    209197 * By default no, use --acl & --attr options to force their usage */
    210 char *g_getfacl = NULL;
    211 char *g_getfattr = NULL;
     198extern char *g_getfacl;
     199extern char *g_getfattr;
    212200
    213201/* Reference to global bkpinfo */
     
    239227
    240228    tmp = malloc(9*MAX_STR_LEN);
    241     sensibly_set_tmpdir_and_scratchdir();
    242229    for (i = 0; i < 128; i++) {
    243230        flag_val[i][0] = '\0';
     
    378365    if (flag_set['K']) {
    379366        g_loglevel = atoi(flag_val['K']);
     367            log_msg(1,"Loglevel forced to %s",g_loglevel);
    380368        if (g_loglevel < 3) {
    381369            g_loglevel = 3;
     
    997985    }
    998986
    999     i = flag_set['O'] + flag_set['V'];
    1000     if (i == 0) {
    1001         retval++;
    1002         log_to_screen("Specify backup (-O), verify (-V) or both (-OV).\n");
     987    if ( ! bkpinfo->restore_data ) {
     988        i = flag_set['O'] + flag_set['V'];
     989        if (i == 0) {
     990            retval++;
     991            log_to_screen("Specify backup (-O), verify (-V) or both (-OV).\n");
     992        }
    1003993    }
    1004994
     
    10451035    }
    10461036    while ((opt =
    1047             getopt(argc, argv,
    1048                    "0123456789A:B:C:DE:FGHI:J:K:LNOP:QRS:T:UVWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z"))
     1037            getopt(argc, argv, MONDO_OPTIONS))
    10491038           != -1) {
    10501039        if (opt == '?') {
  • branches/2.2.6/mondo/src/common/libmondo-cli.h

    r1915 r1917  
    1 /* mondo-cli.h
     1/* libmondo-cli.h
    22 * $Id$
    33 */
  • branches/2.2.6/mondo/src/common/libmondo-devices.c

    r1916 r1917  
    21772177                }
    21782178            } else {
    2179                 sz_size = 0;
     2179                strcpy(sz_size, "0");
    21802180            }
    21812181            for (i = 0; i <= MAX_NOOF_MEDIA; i++) {
    21822182                bkpinfo->media_size[i] = atoi(sz_size);
    21832183            }
    2184             if (bkpinfo->media_size[0] <= 0) {
     2184            if (bkpinfo->media_size[0] < 0) {
    21852185                log_to_screen("User has chosen not to backup the PC");
    21862186                finish(1);
  • branches/2.2.6/mondo/src/common/libmondo-tools-EXT.h

    r1656 r1917  
    33extern void clean_up_KDE_desktop_if_necessary(void);
    44extern long get_time();
     5extern char *mr_date(void);
    56extern void (*log_debug_msg) (int debug_level, const char *szFile,
    67                              const char *szFunction, int nLine,
  • branches/2.2.6/mondo/src/common/libmondo-tools.c

    r1855 r1917  
    180180#include "libmondo-fork-EXT.h"
    181181#include "libmondo-raid-EXT.h"
     182#include "libmondo-devices-EXT.h"
    182183#include <sys/socket.h>
    183184#include <netdb.h>
     
    244245
    245246extern bool am_I_in_disaster_recovery_mode(void);
     247
     248/* Return a string containing the date */
     249char *mr_date(void) {
     250
     251        time_t tcurr;
     252
     253        tcurr = time(NULL);
     254        return(ctime(&tcurr));
     255}
     256
     257/*-----------------------------------------------------------*/
    246258
    247259
     
    10011013    memset((void *) bkpinfo, 0, sizeof(struct s_bkpinfo));
    10021014
    1003     /* special case for tmpdir as used eveywhere after */
    1004     setup_tmpdir(NULL);
     1015    sensibly_set_tmpdir_and_scratchdir();
    10051016
    10061017    bkpinfo->manual_cd_tray = FALSE;
     
    10301041    strcpy(bkpinfo->prefix, STD_PREFIX);
    10311042
    1032     bkpinfo->scratchdir[0] = '\0';
    10331043    bkpinfo->make_filelist = TRUE;  // unless -J supplied to mondoarchive
    10341044    bkpinfo->optimal_set_size = 0;
  • branches/2.2.6/mondo/src/common/libmondo-tools.h

    r1647 r1917  
    66
    77long get_time();
     8char *mr_date(void);
    89extern void (*log_debug_msg) (int debug_level, const char *szFile,
    910                              const char *szFunction, int nLine,
  • branches/2.2.6/mondo/src/common/mr_string.c

    r1552 r1917  
    33 */
    44
     5#include <stdlib.h>
    56#include <stdio.h>
    67#include <string.h>
  • branches/2.2.6/mondo/src/mondoarchive/Makefile.am

    r1315 r1917  
    44
    55## Headers
    6 noinst_HEADERS       = mondo-cli-EXT.h mondo-cli.h mondoarchive.h
     6noinst_HEADERS       = mondoarchive.h
    77
    88## The program
    99sbin_PROGRAMS        = mondoarchive
    10 mondoarchive_SOURCES = main.c mondo-cli.c
     10mondoarchive_SOURCES = main.c
    1111mondoarchive_LDADD   = ${top_builddir}/src/common/libmondo.a
  • branches/2.2.6/mondo/src/mondoarchive/main.c

    r1885 r1917  
    116116#include "../common/mondostructures.h"
    117117#include "../common/libmondo.h"
    118 #include "mondo-cli-EXT.h"
     118#include "../common/libmondo-cli-EXT.h"
    119119#include "../common/libmondo-tools-EXT.h"
    120120#include "mondoarchive.h"
     
    137137
    138138/***************** global vars, used only by main.c ******************/
    139 bool g_skip_floppies;
     139extern bool g_skip_floppies;
    140140long diffs;
    141141
    142142extern t_bkptype g_backup_media_type;
    143143extern int g_loglevel;
     144
     145/**
     146 * Whether we're restoring from ISOs. Obviously not, since this is the
     147 * backup program.
     148 * @note You @b MUST declare this variable somewhere in your program if
     149 * you use libmondo. Otherwise the link will fail.
     150 * @ingroup globalGroup
     151 */
     152bool g_ISO_restore_mode = FALSE;
     153
     154/* Do we use extended attributes and acl ?
     155 *  * By default no, use --acl & --attr options to force their usage */
     156char *g_getfacl = NULL;
     157char *g_getfattr = NULL;
    144158
    145159/* Reference to global bkpinfo */
     
    242256}
    243257
    244 /* Return a string containing the date */
    245 char *mr_date(void) {
    246    
    247     time_t tcurr;
    248 
    249     tcurr = time(NULL);
    250     return(ctime(&tcurr));
    251 }
    252 
    253 /*-----------------------------------------------------------*/
    254 
    255 
    256258
    257259/**
  • branches/2.2.6/mondo/src/mondoarchive/mondoarchive.h

    r1318 r1917  
    99 */
    1010char *MONDO_LOGFILE = "/var/log/mondoarchive.log";
     11char *MONDO_OPTIONS = "0123456789A:B:C:DE:FGHI:J:K:LNOP:QRS:T:UVWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z";
    1112
    1213/* No restriction on ps options */
Note: See TracChangeset for help on using the changeset viewer.