Changeset 25766 for branches/eam_branches/20090820/ippTools/src/magictool.c
- Timestamp:
- Oct 2, 2009, 5:10:19 PM (17 years ago)
- Location:
- branches/eam_branches/20090820
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ippTools/src (modified) (1 prop)
-
ippTools/src/magictool.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090820
- Property svn:mergeinfo changed
-
branches/eam_branches/20090820/ippTools/src
- Property svn:ignore
-
old new 34 34 disttool 35 35 receivetool 36 36 addtool 37 37 pubtool
-
- Property svn:ignore
-
branches/eam_branches/20090820/ippTools/src/magictool.c
r24949 r25766 1393 1393 } 1394 1394 1395 static bool censorStage(pxConfig *config, psString stage, psString whereClause)1396 {1397 psString queryFile = NULL;1398 psStringAppend(&queryFile, "magictool_censor_%s.sql", stage);1399 psString query = pxDataGet(queryFile);1400 if (!query) {1401 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement from %s", queryFile);1402 psFree(queryFile);1403 if (!psDBRollback(config->dbh)) {1404 psError(PS_ERR_UNKNOWN, false, "database error");1405 }1406 return false;1407 }1408 psFree(queryFile);1409 1410 psStringAppend(&query, " WHERE %s", whereClause);1411 1412 if (!p_psDBRunQuery(config->dbh, query)) {1413 psError(PS_ERR_UNKNOWN, false, "database error");1414 psFree(query);1415 if (!psDBRollback(config->dbh)) {1416 psError(PS_ERR_UNKNOWN, false, "database error");1417 }1418 return false;1419 }1420 psFree(query);1421 1422 return true;1423 }1424 1425 1395 static bool censorrunMode(pxConfig *config) 1426 1396 { 1427 1397 PS_ASSERT_PTR_NON_NULL(config, false); 1428 1398 1429 psError(PS_ERR_PROGRAMMING, true, "-censorrun mode not ready yet");1430 return false;1431 1432 1399 psMetadata *where = psMetadataAlloc(); 1400 1401 PXOPT_LOOKUP_S64(magic_id, config->args, "-magic_id", false, false); 1402 PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", false, false); 1403 PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); 1404 1405 if (!magic_id) { 1406 if (!exp_id && !label) { 1407 psError(PS_ERR_UNKNOWN, true, "either -magic_id or exp_id and label is required"); 1408 return false; 1409 } 1410 } 1433 1411 1434 1412 // at least one of these required 1435 1413 PXOPT_COPY_S64(config->args, where, "-magic_id", "magic_id", "=="); 1436 1414 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 1415 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 1437 1416 1438 1417 if (!psListLength(where->list)) { … … 1470 1449 // Now queue any destreaked files to be re-verted 1471 1450 1472 // note: on failure censorStage issues the rollback1473 if (! censorStage(config, "raw", whereClause)) {1451 // note: on failure magicRestoreStage issues the rollback 1452 if (!magicRestoreStage(config, "raw", whereClause, "goto_censored")) { 1474 1453 psFree(whereClause); 1475 1454 return false; 1476 1455 } 1477 if (! censorStage(config, "chip", whereClause)) {1456 if (!magicRestoreStage(config, "chip", whereClause, "goto_censored")) { 1478 1457 psFree(whereClause); 1479 1458 return false; 1480 1459 } 1481 if (! censorStage(config, "camera", whereClause)) {1460 if (!magicRestoreStage(config, "camera", whereClause, "goto_censored")) { 1482 1461 psFree(whereClause); 1483 1462 return false; 1484 1463 } 1485 if (! censorStage(config, "warp", whereClause)) {1464 if (!magicRestoreStage(config, "warp", whereClause, "goto_censored")) { 1486 1465 psFree(whereClause); 1487 1466 return false; 1488 1467 } 1489 if (! censorStage(config, "diff", whereClause)) {1468 if (!magicRestoreStage(config, "diff", whereClause, "goto_censored")) { 1490 1469 psFree(whereClause); 1491 1470 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
