Changeset 1434


Ignore:
Timestamp:
May 10, 2007, 1:38:43 AM (12 years ago)
Author:
bruno
Message:

Fix the function process_the_s_switch
Still improving conf file handling

Location:
branches/stable/mondo
Files:
4 edited

Legend:

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

    r1331 r1434  
    3131#
    3232#  ISO Burning CLI command options
    33 mondo_iso_burning_options="-eject dev=%s speed=%d fs=24m driveropts=burnfree"
     33mondo_iso_burning_options="-eject dev=_DEVICE_ speed=_SPEED_ fs=24m driveropts=burnfree"
    3434
    3535#
  • branches/stable/mondo/src/lib/mr_conf.c

    r1429 r1434  
    392392        switch (error_code) {
    393393        case MRCONF_BAD_FILE:
    394             mr_msg_int(0,line,file,"%s %s %s\n", MRCONF_STR_ERROR, MRCONF_STR_BAD_FILE,
     394            mr_msg_int(1,line,file,"%s %s %s\n", MRCONF_STR_ERROR, MRCONF_STR_BAD_FILE,
    395395                   add_line);
    396396            break;
    397397
    398398        case MRCONF_READING_FAILED:
    399             mr_msg_int(0,line,file,"%s %s\n", MRCONF_STR_ERROR, MRCONF_STR_READING_FAILED);
     399            mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_ERROR, MRCONF_STR_READING_FAILED);
    400400            break;
    401401
    402402        case MRCONF_FIELD_NOT_FOUND:
    403             mr_msg_int(0,line,file,"%s %s \"%s\"\n", MRCONF_STR_ERROR, MRCONF_STR_FIELD_NOT_FOUND, add_line);
    404             mr_msg_int(0,line,file,"%s %s\n", MRCONF_STR_WARNING, MRCONF_STR_SET_TO_ZERO);
     403            mr_msg_int(1,line,file,"%s %s \"%s\"\n", MRCONF_STR_ERROR, MRCONF_STR_FIELD_NOT_FOUND, add_line);
     404            mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_WARNING, MRCONF_STR_SET_TO_ZERO);
    405405            break;
    406406
    407407        case MRCONF_FIELD_NO_VALUE:
    408             mr_msg_int(0,line,file,"%s %s \"%s\"\n", MRCONF_STR_ERROR, MRCONF_STR_FIELD_NO_VALUE, add_line);
    409             mr_msg_int(0,line,file,"%s %s\n", MRCONF_STR_WARNING, MRCONF_STR_IGNORE);
     408            mr_msg_int(1,line,file,"%s %s \"%s\"\n", MRCONF_STR_ERROR, MRCONF_STR_FIELD_NO_VALUE, add_line);
     409            mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_WARNING, MRCONF_STR_IGNORE);
    410410            break;
    411411
    412412        case MRCONF_CLOSE_BUT_NOT_OPEN:
    413             mr_msg_int(0,line,file,"%s %s\n", MRCONF_STR_WARNING, MRCONF_STR_CLOSE_BUT_NOT_OPEN);
     413            mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_WARNING, MRCONF_STR_CLOSE_BUT_NOT_OPEN);
    414414            break;
    415415
    416416        case MRCONF_CALL_BUT_NOT_OPEN:
    417             mr_msg_int(0,line,file,"%s %s\n", MRCONF_STR_WARNING, MRCONF_STR_CALL_BUT_NOT_OPEN);
     417            mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_WARNING, MRCONF_STR_CALL_BUT_NOT_OPEN);
    418418            break;
    419419
    420420        case MRCONF_OPEN_OPENED:
    421             mr_msg_int(0,line,file,"%s %s\n", MRCONF_STR_ERROR, MRCONF_STR_OPEN_OPENED);
     421            mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_ERROR, MRCONF_STR_OPEN_OPENED);
    422422            break;
    423423
    424424        case MRCONF_STRING_QUOTE:
    425             mr_msg_int(0,line,file,"%s %s\n", MRCONF_STR_ERROR, MRCONF_STR_STRING_QUOTE);
     425            mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_ERROR, MRCONF_STR_STRING_QUOTE);
    426426            break;
    427427
    428428        default:
    429             mr_msg_int(0,line,file,"%s %s\n", MRCONF_STR_ERROR, MRCONF_STR_DEFAULT_ERROR);
    430             break;
    431         }
    432     }
    433 }
     429            mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_ERROR, MRCONF_STR_DEFAULT_ERROR);
     430            break;
     431        }
     432    }
     433}
  • branches/stable/mondo/src/mondoarchive/mondo-cli.c

    r1378 r1434  
    146146{
    147147    char *tmp = NULL;
    148     char *p = NULL;
    149148    char *q = NULL;
    150149
     
    153152
    154153    bkpinfo->media_size = 0L;   /* dummy value */
    155     for ( p = value; strchr(p, ','); p = strchr(p, ',') + 1) {
    156         mr_asprintf(&tmp, p);
    157         q = strchr(tmp, ',');
    158         if (q != NULL) {
    159             *q = '\0';
    160         }
    161         bkpinfo->media_size = friendly_sizestr_to_sizelong(tmp);
    162         mr_free(tmp);
    163 
    164         mr_msg(3, "media_size = %ld", bkpinfo->media_size);
    165     }
     154    mr_asprintf(&tmp, value);
     155    q = strchr(tmp, ',');
     156    if (q != NULL) {
     157        *q = '\0';
     158    }
     159    bkpinfo->media_size = friendly_sizestr_to_sizelong(tmp);
     160    mr_free(tmp);
     161
     162    mr_msg(3, "media_size = %ld", bkpinfo->media_size);
    166163    if (bkpinfo->media_size <= 0L) {
    167164        mr_msg(1, "You gave media an invalid size\n");
  • branches/stable/mondo/src/mondoarchive/mondoarchive.c

    r1422 r1434  
    136136   
    137137    char *p = NULL;
    138     char *s = NULL;
    139 
    140     s = mr_conf_sread("mondo_iso_creation_cmd");
    141     fprintf(stderr,"s: %s\n",s);
    142     mr_asprintf(&p, s);
     138
     139    mr_asprintf(&p, mr_conf_sread("mondo_iso_creation_cmd"));
    143140    mr_cnf->iso_creation_cmd = p;
    144141    p = NULL;
Note: See TracChangeset for help on using the changeset viewer.