IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25511 for trunk/ippTools/src


Ignore:
Timestamp:
Sep 23, 2009, 1:45:03 PM (17 years ago)
Author:
bills
Message:

Finish implementing magictool -censorrun

Location:
trunk/ippTools/src
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/Makefile.am

    r25299 r25511  
    2424        pubtool
    2525
    26 
    27 bin_SCRIPTS = \
    28         fakemagic
    29 
    3026pkginclude_HEADERS = \
    3127        pxadd.h \
     
    3632        pxdata.h \
    3733        pxfake.h \
     34        pxmagic.h \
    3835        pxregister.h \
    3936        pxtag.h \
     
    7976        pxfake.c \
    8077        pxfault.c \
     78        pxmagic.c \
    8179        pxregister.c \
    8280        pxtag.c \
  • trunk/ippTools/src/magictool.c

    r24949 r25511  
    13931393}
    13941394
    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 
    14251395static bool censorrunMode(pxConfig *config)
    14261396{
    14271397    PS_ASSERT_PTR_NON_NULL(config, false);
    1428 
    1429     psError(PS_ERR_PROGRAMMING, true, "-censorrun mode not ready yet");
    1430     return false;
    14311398
    14321399    psMetadata *where = psMetadataAlloc();
     
    14341401    // at least one of these required
    14351402    PXOPT_COPY_S64(config->args, where, "-magic_id", "magic_id", "==");
    1436     PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
     1403    PXOPT_COPY_S64(config->args, where, "-exp_id", "magicRun.exp_id", "==");
    14371404
    14381405    if (!psListLength(where->list)) {
     
    14701437    // Now queue any destreaked files to be re-verted
    14711438
    1472     // note: on failure censorStage issues the rollback
    1473     if (!censorStage(config, "raw", whereClause)) {
     1439    // note: on failure magicRestoreStage issues the rollback
     1440    if (!magicRestoreStage(config, "raw", whereClause, "goto_censored")) {
    14741441        psFree(whereClause);
    14751442        return false;
    14761443    }
    1477     if (!censorStage(config, "chip", whereClause)) {
     1444    if (!magicRestoreStage(config, "chip", whereClause, "goto_censored")) {
    14781445        psFree(whereClause);
    14791446        return false;
    14801447    }
    1481     if (!censorStage(config, "camera", whereClause)) {
     1448    if (!magicRestoreStage(config, "camera", whereClause, "goto_censored")) {
    14821449        psFree(whereClause);
    14831450        return false;
    14841451    }
    1485     if (!censorStage(config, "warp", whereClause)) {
     1452    if (!magicRestoreStage(config, "warp", whereClause, "goto_censored")) {
    14861453        psFree(whereClause);
    14871454        return false;
    14881455    }
    1489     if (!censorStage(config, "diff", whereClause)) {
     1456    if (!magicRestoreStage(config, "diff", whereClause, "goto_censored")) {
    14901457        psFree(whereClause);
    14911458        return false;
  • trunk/ippTools/src/pxtools.h

    r25299 r25511  
    4646#include "pxtag.h"
    4747#include "pxtree.h"
     48#include "pxmagic.h"
    4849
    4950# define MAX_ROWS 10e9
Note: See TracChangeset for help on using the changeset viewer.