- Timestamp:
- Mar 5, 2012, 5:19:48 PM (14 years ago)
- Location:
- branches/meh_branches/ppstack_test
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ippTools/src (modified) (2 props)
-
ippTools/src/magicdstool.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/meh_branches/ppstack_test
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/ippTools/src
- Property svn:ignore
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20110710/ippTools/src (added) merged: 32337 /branches/eam_branches/ipp-20110906/ippTools/src (added) merged: 32630 /branches/eam_branches/ipp-20111110/ippTools/src (added) merged: 32694 /branches/haf_add201112/ippTools/src (added) merged: 32980,32986,33003,33023,33027
-
branches/meh_branches/ppstack_test/ippTools/src/magicdstool.c
r30854 r33415 53 53 54 54 static bool setmagicDSRunState(pxConfig *config, psS64 magic_id, psString extraSetString, psMetadata *where, const char *state); 55 static bool validDSRunState(const char *state); 55 56 56 57 # define MODECASE(caseName, func) \ … … 350 351 PXOPT_LOOKUP_STR(stage, config->args, "-stage", true, false); 351 352 PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false); 353 PXOPT_LOOKUP_STR(set_label, config->args, "-set_label", true, false); 352 354 353 355 // Optional 354 356 PXOPT_LOOKUP_STR(recoveryroot, config->args, "-recoveryroot", false, false); 355 357 PXOPT_LOOKUP_BOOL(noreplace, config->args, "-noreplace", false); 356 PXOPT_LOOKUP_STR(set_label, config->args, "-set_label", false, false);357 358 PXOPT_LOOKUP_STR(set_data_group, config->args, "-set_data_group", false, false); 358 359 PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false); … … 374 375 pxAddLabelSearchArgs (config, where, "-magic_label", "magicRun.label", "=="); // define magic label 375 376 psString labelName = NULL; // Name of label 376 psStringAppend(&labelName, "%sRun.label", stage); 377 if (strcmp(stage, "camera")) { 378 psStringAppend(&labelName, "%sRun.label", stage); 379 } else { 380 psStringAppend(&labelName, "camRun.label"); 381 } 377 382 pxAddLabelSearchArgs (config, where, "-stage_label", labelName, "=="); // define stageRun label 378 383 psFree(labelName); … … 392 397 break; 393 398 case IPP_STAGE_CAMERA: 399 query = pxDataGet("magicdstool_definecopy_camera.sql"); 400 break; 394 401 case IPP_STAGE_DIFF: 395 402 case IPP_STAGE_FAKE: … … 1206 1213 1207 1214 psMetadata *where = psMetadataAlloc(); 1208 // new state (required1209 PXOPT_LOOKUP_STR(new_state, config->args, "-set_state", true, false);1215 // new state 1216 PXOPT_LOOKUP_STR(new_state, config->args, "-set_state", false, false); 1210 1217 // old state (required) 1211 1218 PXOPT_LOOKUP_STR(state, config->args, "-state", true, false); … … 1231 1238 if (!strcmp(state, "failed_revert")) { 1232 1239 new_state = "new"; 1240 } else if (!strcmp(state, "failed_revert_ud")) { 1241 new_state = "update"; 1233 1242 } else if (!strcmp(state, "failed_cleanup")) { 1234 1243 new_state = "goto_cleaned"; … … 1237 1246 return false; 1238 1247 } 1248 } else { 1249 if (!validDSRunState(new_state)) { 1250 psError(PS_ERR_UNKNOWN, true, "unexpected value for new state: %s", new_state); 1251 return false; 1252 } 1239 1253 } 1240 1254 if (!p_psDBRunQueryF(config->dbh, query, new_state)) { 1241 psError(PS_ERR_UNKNOWN, false, "failed to revert");1255 psError(PS_ERR_UNKNOWN, false, "failed to clear state faults"); 1242 1256 psFree(query); 1243 1257 return false; … … 1397 1411 (strcmp(state, "wait") == 0) || 1398 1412 (strcmp(state, "failed_revert") == 0) || 1413 (strcmp(state, "failed_revert_ud") == 0) || 1399 1414 (strcmp(state, "error_cleaned") == 0) || 1400 1415 (strcmp(state, "restored") == 0) ||
Note:
See TracChangeset
for help on using the changeset viewer.
