IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 24, 2010, 2:59:09 PM (16 years ago)
Author:
Paul Price
Message:

Merging trunk in advance of reintegrating into trunk.

Location:
branches/pap
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/pap

  • branches/pap/ippTools/src

    • Property svn:ignore
      •  

        old new  
        3939warptool
        4040staticskytool
        41 
        4241bgtool
         42diffphottool
  • branches/pap/ippTools/src/disttool.c

    r27542 r28484  
    148148    PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false);
    149149
    150     if (use_alternate) { 
     150    if (use_alternate) {
    151151        if (strcmp(stage, "raw")) {
    152152            psError(PXTOOLS_ERR_SYS, true, "alternate inputs only supported for raw stage");
     
    299299      query = pxDataGet("disttool_definebyquery_SSdiff.sql");
    300300      if (!query) {
    301         psError(PXTOOLS_ERR_SYS, false, "failed to retrieve SQL statement");
    302         psFree(where);
    303         return(false);
     301        psError(PXTOOLS_ERR_SYS, false, "failed to retrieve SQL statement");
     302        psFree(where);
     303        return(false);
    304304      }
    305305
    306306      if (label) {
    307         psStringAppend(&query, " AND (diffRun.label = '%s') ", label);
     307        psStringAppend(&query, " AND (diffRun.label = '%s') ", label);
    308308      }
    309309      if (dist_group) {
    310         psStringAppend(&query, " AND (diffRun.dist_group = '%s') ", dist_group);
     310        psStringAppend(&query, " AND (diffRun.dist_group = '%s') ", dist_group);
    311311      }
    312312
    313       no_magic = true;   
     313      no_magic = true;
    314314    } else {
    315315        psError(PS_ERR_UNKNOWN, true, "unknown value for stage: %s", stage);
     
    470470    PXOPT_COPY_STR(config->args, where, "-data_group", "distRun.data_group", "LIKE");
    471471    PXOPT_COPY_STR(config->args, where, "-dist_group", "distTarget.dist_group", "==");
    472     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     472    PXOPT_COPY_TIME(config->args, where, "-time_stamp_begin", "distRun.time_stamp", ">=");
     473    PXOPT_COPY_TIME(config->args, where, "-time_stamp_end", "distRun.time_stamp", "<=");
     474
     475    PXOPT_LOOKUP_BOOL(clean, config->args, "-clean", false);
     476    PXOPT_LOOKUP_BOOL(full, config->args, "-full", false);
     477    if (clean && full) {
     478        psFree(where);
     479        psError(PXTOOLS_ERR_CONFIG, true, "-clean and -full are contradictory parameters");
     480        return false;
     481    }
    473482
    474483    if (!psListLength(where->list)) {
     
    491500    }
    492501
     502    psString extraWhere = NULL;
    493503    psString query = psStringCopy("UPDATE distRun join distTarget using(target_id, stage) SET distRun.time_stamp = UTC_TIMESTAMP()");
    494504
     
    498508    if (state) {
    499509        psStringAppend(&query, " , distRun.state = '%s'", state);
     510        if (!strcmp(state, "goto_cleaned")) {
     511            // don't queue for clean up if run has already already cleaned
     512            psStringAppend(&extraWhere, " AND (distRun.state != 'cleaned' AND distRun.state != 'goto_cleaned')");
     513        }
    500514    }
    501515
     
    521535    psFree(whereClause);
    522536    psFree(where);
     537
     538    if (extraWhere) {
     539        psStringAppend(&query, "%s", extraWhere);
     540    }
     541    if (clean) {
     542        psStringAppend(&query, " AND (distRun.clean)");
     543    } else if (full) {
     544        psStringAppend(&query, " AND (!distRun.clean)");
     545    }
    523546
    524547    if (!p_psDBRunQuery(config->dbh, query)) {
     
    16801703        return false;
    16811704    }
    1682        
     1705
    16831706
    16841707    PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false);
Note: See TracChangeset for help on using the changeset viewer.