Changeset 25835 for trunk/ippTools/src/stacktool.c
- Timestamp:
- Oct 14, 2009, 11:06:18 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/stacktool.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/stacktool.c
r25800 r25835 48 48 49 49 static bool setstackRunState(pxConfig *config, psS64 stack_id, const char *state); 50 static bool setstackRunStateByLabel(pxConfig *config, const char *label, const char *state);51 50 52 51 # define MODECASE(caseName, func) \ … … 110 109 111 110 // required options 112 PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false); 113 PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); 114 PXOPT_LOOKUP_STR(reduction, config->args, "-reduction", false, false); 115 PXOPT_LOOKUP_STR(dvodb, config->args, "-dvodb", false, false); 111 PXOPT_LOOKUP_STR(workdir, config->args, "-set_workdir", true, false); 112 113 // optional 114 PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false); 115 PXOPT_LOOKUP_STR(data_group, config->args, "-set_data_group", false, false); 116 PXOPT_LOOKUP_STR(dist_group, config->args, "-set_dist_group", false, false); 117 PXOPT_LOOKUP_STR(reduction, config->args, "-set_reduction", false, false); 118 PXOPT_LOOKUP_STR(dvodb, config->args, "-set_dvodb", false, false); 119 PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false); 120 PXOPT_LOOKUP_TIME(registered, config->args, "-set_registered", false, false); 116 121 117 122 psMetadata *where = psMetadataAlloc(); … … 161 166 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 162 167 PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false); 163 PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false); 164 165 if (!psListLength(where->list) && 166 !psMetadataLookupBool(NULL, config->args, "-all")) { 168 169 if (!psListLength(where->list)) { 167 170 psFree(where); 168 171 psError(PXTOOLS_ERR_DATA, false, "search parameters are required"); … … 346 349 workdir, 347 350 label, 351 data_group ? data_group : label, 352 dist_group, 348 353 reduction, 349 354 dvodb, … … 351 356 skycell_id, 352 357 tess_id, 353 filter); 358 filter, 359 note); 354 360 355 361 if (!stackRunInsertObject(config->dbh, run)) { … … 469 475 470 476 // required options 471 PXOPT_LOOKUP_STR(workdir, config->args, "- workdir", true, false);477 PXOPT_LOOKUP_STR(workdir, config->args, "-set_workdir", true, false); 472 478 PXOPT_LOOKUP_STR(skycell_id, config->args, "-skycell_id", true, false); 473 479 PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", true, false); … … 476 482 // default 477 483 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 478 PXOPT_LOOKUP_TIME(registered, config->args, "- registered", false, false);484 PXOPT_LOOKUP_TIME(registered, config->args, "-set_registered", false, false); 479 485 480 486 // options 481 PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); 482 PXOPT_LOOKUP_STR(reduction, config->args, "-reduction", false, false); 483 PXOPT_LOOKUP_STR(dvodb, config->args, "-dvodb", false, false); 487 PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false); 488 PXOPT_LOOKUP_STR(data_group, config->args, "-set_data_group", false, false); 489 PXOPT_LOOKUP_STR(dist_group, config->args, "-set_dist_group", false, false); 490 PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false); 491 PXOPT_LOOKUP_STR(reduction, config->args, "-set_reduction", false, false); 492 PXOPT_LOOKUP_STR(dvodb, config->args, "-set_dvodb", false, false); 484 493 485 494 // we have to support multipe exp_ids … … 496 505 workdir, 497 506 label, 507 data_group ? data_group : label, 508 dist_group, 498 509 reduction, 499 510 dvodb, … … 501 512 skycell_id, 502 513 tess_id, 503 filter); 514 filter, 515 note); 504 516 505 517 if (!run) { … … 570 582 PS_ASSERT_PTR_NON_NULL(config, false); 571 583 584 #ifdef notdef 572 585 PXOPT_LOOKUP_S64(stack_id, config->args, "-stack_id", false, false); 573 586 PXOPT_LOOKUP_STR(state, config->args, "-state", true, false); 574 587 PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); 575 588 #endif 589 psMetadata *where = psMetadataAlloc(); 590 PXOPT_COPY_S64(config->args, where, "-stack_id", "stack_id", "=="); 591 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 592 PXOPT_COPY_STR(config->args, where, "-state", "state", "=="); 593 if (!psListLength(where->list)) { 594 psFree(where); 595 psError(PXTOOLS_ERR_DATA, false, "search parameters are required"); 596 return false; 597 } 598 599 psString query = psStringCopy("UPDATE stackRun"); 600 601 // pxUpdateRun gets parameters from config->args and updates 602 bool result = pxUpdateRun(config, where, &query, true); 603 604 psFree(query); 605 psFree(where); 606 607 return result; 608 609 #ifdef notdef 576 610 // Hack-y work around to make stacktool more like the other tools, without breaking other stuff (hopefully). 577 611 … … 587 621 psError(PS_ERR_UNKNOWN, false, "Required options not found."); 588 622 return false; 623 #endif 589 624 } 590 625 … … 1015 1050 } 1016 1051 1052 #ifdef notdef 1017 1053 static bool setstackRunStateByLabel(pxConfig *config, const char *label, const char *state) 1018 1054 { … … 1034 1070 return true; 1035 1071 } 1072 #endif 1036 1073 1037 1074 static bool pendingcleanuprunMode(pxConfig *config)
Note:
See TracChangeset
for help on using the changeset viewer.
