IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32593


Ignore:
Timestamp:
Oct 28, 2011, 12:23:29 PM (15 years ago)
Author:
bills
Message:

add -set_ignored and -clear_ignored to regtool

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/regtool.c

    r32532 r32593  
    891891    PXOPT_LOOKUP_STR(set_md5sum, config->args, "-set_md5sum", false, false);
    892892    PXOPT_LOOKUP_STR(set_state, config->args, "-set_state", false, false);
     893    PXOPT_LOOKUP_BOOL(set_ignored, config->args, "-set_ignored", false);
     894    PXOPT_LOOKUP_BOOL(clear_ignored, config->args, "-clear_ignored", false);
    893895    PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false);
    894896   
    895     if ((fault == INT16_MAX) && (burntool_state == INT16_MAX) && !set_state) {
    896         psError(PS_ERR_UNKNOWN, false, "one of -fault or -burntool_state or -set_state must be selected");
     897    if ((fault == INT16_MAX) && (burntool_state == INT16_MAX) && !set_state && !set_ignored && !clear_ignored) {
     898        psError(PS_ERR_UNKNOWN, false, "at least one of -fault or -burntool_state -set_ignored -clear_ignored or -set_state must be selected");
    897899        return false;
    898900    }
    899901    if ((fault != INT16_MAX) && (burntool_state != INT16_MAX)) {
    900902        psError(PS_ERR_UNKNOWN, false, "only one of -fault or -burntool_state must be selected");
     903        return false;
     904    }
     905    if (set_ignored && clear_ignored) {
     906        psError(PS_ERR_UNKNOWN, true, "only one of -set_ignored or -clear_ignored may be selected");
    901907        return false;
    902908    }
     
    907913
    908914    if (fault != INT16_MAX) {
    909         // this is fairly dangerous : can set all if the where is not set...
     915        // this is fairly dangerous : can set all if the where is not set... but since exp_id and class_id
     916        // were required above this is safe
    910917        if (!pxSetFaultCode(config->dbh, "rawImfile", where, fault, 0)) {
    911918            psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag");
     
    939946      }
    940947      psStringAppend(&setvalues,"rawImfile.data_state = '%s'",set_state);
     948    }
     949    if (set_ignored) {
     950      if (setvalues) {
     951        psStringAppend(&setvalues,",");
     952      }
     953      psStringAppend(&setvalues,"rawImfile.ignored = 1");
     954    }
     955    if (clear_ignored) {
     956      if (setvalues) {
     957        psStringAppend(&setvalues,",");
     958      }
     959      psStringAppend(&setvalues,"rawImfile.ignored = 0");
    941960    }
    942961    if (hostname) {
  • trunk/ippTools/src/regtoolConfig.c

    r31938 r32593  
    194194    ADD_OPT(Str, updateprocessedimfileArgs, "-set_md5sum",     "set md5sum", NULL);
    195195    ADD_OPT(Str, updateprocessedimfileArgs, "-set_state",      "set data state", NULL);
     196    psMetadataAddBool(updateprocessedimfileArgs, PS_LIST_TAIL, "-set_ignored",  0,        "set imfile to be ignored for processing", false);
     197    psMetadataAddBool(updateprocessedimfileArgs, PS_LIST_TAIL, "-clear_ignored",  0,        "set imfile to not be ignored for processing", false);
    196198
    197199   
Note: See TracChangeset for help on using the changeset viewer.