Changeset 28484 for branches/pap/ippTools/src/disttool.c
- Timestamp:
- Jun 24, 2010, 2:59:09 PM (16 years ago)
- Location:
- branches/pap
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ippTools/src (modified) (1 prop)
-
ippTools/src/disttool.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/ippTools/src
- Property svn:ignore
-
old new 39 39 warptool 40 40 staticskytool 41 42 41 bgtool 42 diffphottool
-
- Property svn:ignore
-
branches/pap/ippTools/src/disttool.c
r27542 r28484 148 148 PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false); 149 149 150 if (use_alternate) { 150 if (use_alternate) { 151 151 if (strcmp(stage, "raw")) { 152 152 psError(PXTOOLS_ERR_SYS, true, "alternate inputs only supported for raw stage"); … … 299 299 query = pxDataGet("disttool_definebyquery_SSdiff.sql"); 300 300 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); 304 304 } 305 305 306 306 if (label) { 307 psStringAppend(&query, " AND (diffRun.label = '%s') ", label);307 psStringAppend(&query, " AND (diffRun.label = '%s') ", label); 308 308 } 309 309 if (dist_group) { 310 psStringAppend(&query, " AND (diffRun.dist_group = '%s') ", dist_group);310 psStringAppend(&query, " AND (diffRun.dist_group = '%s') ", dist_group); 311 311 } 312 312 313 no_magic = true; 313 no_magic = true; 314 314 } else { 315 315 psError(PS_ERR_UNKNOWN, true, "unknown value for stage: %s", stage); … … 470 470 PXOPT_COPY_STR(config->args, where, "-data_group", "distRun.data_group", "LIKE"); 471 471 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 } 473 482 474 483 if (!psListLength(where->list)) { … … 491 500 } 492 501 502 psString extraWhere = NULL; 493 503 psString query = psStringCopy("UPDATE distRun join distTarget using(target_id, stage) SET distRun.time_stamp = UTC_TIMESTAMP()"); 494 504 … … 498 508 if (state) { 499 509 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 } 500 514 } 501 515 … … 521 535 psFree(whereClause); 522 536 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 } 523 546 524 547 if (!p_psDBRunQuery(config->dbh, query)) { … … 1680 1703 return false; 1681 1704 } 1682 1705 1683 1706 1684 1707 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false);
Note:
See TracChangeset
for help on using the changeset viewer.
