Changeset 25870 for branches/eam_branches/20090820/ippTools/src/stacktool.c
- Timestamp:
- Oct 18, 2009, 10:23:28 AM (17 years ago)
- Location:
- branches/eam_branches/20090820
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippTools/src/stacktool.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090820
-
branches/eam_branches/20090820/ippTools/src/stacktool.c
r25766 r25870 109 109 110 110 // required options 111 PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false); 112 PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); 113 PXOPT_LOOKUP_STR(reduction, config->args, "-reduction", false, false); 114 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); 115 121 116 122 psMetadata *where = psMetadataAlloc(); … … 160 166 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 161 167 PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false); 162 PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false); 163 164 if (!psListLength(where->list) && 165 !psMetadataLookupBool(NULL, config->args, "-all")) { 168 169 if (!psListLength(where->list)) { 166 170 psFree(where); 167 171 psError(PXTOOLS_ERR_DATA, false, "search parameters are required"); … … 345 349 workdir, 346 350 label, 351 data_group ? data_group : label, 352 dist_group, 347 353 reduction, 348 354 dvodb, … … 350 356 skycell_id, 351 357 tess_id, 352 filter); 358 filter, 359 note); 353 360 354 361 if (!stackRunInsertObject(config->dbh, run)) { … … 468 475 469 476 // required options 470 PXOPT_LOOKUP_STR(workdir, config->args, "- workdir", true, false);477 PXOPT_LOOKUP_STR(workdir, config->args, "-set_workdir", true, false); 471 478 PXOPT_LOOKUP_STR(skycell_id, config->args, "-skycell_id", true, false); 472 479 PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", true, false); … … 475 482 // default 476 483 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 477 PXOPT_LOOKUP_TIME(registered, config->args, "- registered", false, false);484 PXOPT_LOOKUP_TIME(registered, config->args, "-set_registered", false, false); 478 485 479 486 // options 480 PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); 481 PXOPT_LOOKUP_STR(reduction, config->args, "-reduction", false, false); 482 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); 483 493 484 494 // we have to support multipe exp_ids … … 495 505 workdir, 496 506 label, 507 data_group ? data_group : label, 508 dist_group, 497 509 reduction, 498 510 dvodb, … … 500 512 skycell_id, 501 513 tess_id, 502 filter); 514 filter, 515 note); 503 516 504 517 if (!run) { … … 569 582 PS_ASSERT_PTR_NON_NULL(config, false); 570 583 571 PXOPT_LOOKUP_S64(stack_id, config->args, "-stack_id", true, false); 584 #ifdef notdef 585 PXOPT_LOOKUP_S64(stack_id, config->args, "-stack_id", false, false); 572 586 PXOPT_LOOKUP_STR(state, config->args, "-state", true, false); 573 574 if (state) { 587 PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); 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, "stackRun", true); 603 604 psFree(query); 605 psFree(where); 606 607 return result; 608 609 #ifdef notdef 610 // Hack-y work around to make stacktool more like the other tools, without breaking other stuff (hopefully). 611 612 if ((state)&&(stack_id)) { 575 613 // set detRun.state to state 576 614 return setstackRunState(config, stack_id, state); 577 615 } 578 616 579 return true; 617 if ((state)&&(label)) { 618 return setstackRunStateByLabel(config, label, state); 619 } 620 621 psError(PS_ERR_UNKNOWN, false, "Required options not found."); 622 return false; 623 #endif 580 624 } 581 625 … … 1006 1050 } 1007 1051 1052 #ifdef notdef 1053 static bool setstackRunStateByLabel(pxConfig *config, const char *label, const char *state) 1054 { 1055 PS_ASSERT_PTR_NON_NULL(state, false); 1056 1057 // check that state is a valid string value 1058 if (!pxIsValidState(state)) { 1059 psError(PS_ERR_UNKNOWN, false, "invalid stackRun state: %s", state); 1060 return false; 1061 } 1062 1063 char *query = "UPDATE stackRun SET state = '%s' WHERE label = '%s'"; 1064 if (!p_psDBRunQueryF(config->dbh, query, state, label)) { 1065 psError(PS_ERR_UNKNOWN, false, 1066 "failed to change state for label %s", label); 1067 return false; 1068 } 1069 1070 return true; 1071 } 1072 #endif 1073 1008 1074 static bool pendingcleanuprunMode(pxConfig *config) 1009 1075 { … … 1231 1297 } 1232 1298 1299 if (!pxExportVersion(config, f)) { 1300 psError(PS_ERR_UNKNOWN, false, "failed to write dbversion output file"); 1301 return false; 1302 } 1233 1303 psMetadata *where = psMetadataAlloc(); 1234 1304 PXOPT_COPY_S64(config->args, where, "-stack_id", "stack_id", "=="); … … 1317 1387 psMetadata *input = psMetadataConfigRead (NULL, &nFail, infile, false); 1318 1388 1319 fprintf (stdout, "---- input ----\n"); 1389 #ifdef notdef 1390 fprintf (stderr, "---- input ----\n"); 1320 1391 psMetadataPrint (stderr, input, 1); 1321 1392 #endif 1393 1394 if (!pxCheckImportVersion(config, input)) { 1395 psError(PS_ERR_UNKNOWN, false, "pxCheckImportVersion failed"); 1396 return false; 1397 } 1322 1398 psMetadataItem *item = psMetadataLookup (input, "stackRun"); 1323 1399 psAssert (item, "entry not in input?");
Note:
See TracChangeset
for help on using the changeset viewer.
