IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 15, 2009, 9:33:58 AM (17 years ago)
Author:
bills
Message:

add -clean argument to the exportrun modes. If set switch
state and data state from 'full' to 'cleaned'.
If no rows are found in -exportrun return error status for
the command

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/difftool.c

    r23740 r23873  
    17481748  PXOPT_LOOKUP_STR(outfile, config->args, "-outfile", true,  false);
    17491749  PXOPT_LOOKUP_U64(limit,   config->args, "-limit",   false, false);
     1750  PXOPT_LOOKUP_BOOL(clean, config->args, "-clean", false);
    17501751
    17511752  FILE *f = fopen (outfile, "w");
     
    17931794    psArray *output = p_psDBFetchResult(config->dbh);
    17941795    if (!output) {
    1795       psError(PS_ERR_UNKNOWN, false, "database error");
    17961796      return false;
    17971797    }
    17981798    if (!psArrayLength(output)) {
    1799       psTrace("regtool", PS_LOG_INFO, "no rows found");
     1799      psError(PS_ERR_UNKNOWN, true, "no rows found");
    18001800      psFree(output);
    1801       return true;
     1801      return false;
     1802    }
     1803
     1804    if (clean) {
     1805        bool success = true;
     1806        if (!strcmp(tables[i].tableName, "diffRun")) {
     1807            success = pxSetStateCleaned("diffRun", "state", output);
     1808#ifdef notyet
     1809        // diffSkyfile doesn't have dataState yet
     1810        } else if (!strcmp(tables[i].tableName, "diffSkyfile")) {
     1811            success = pxSetStateCleaned("diffSkyfile", "data_state", output);
     1812#endif
     1813        }
     1814        if (!success) {
     1815            psFree(output);
     1816            psError(PS_ERR_UNKNOWN, false, "pxSetStateClean failed for table %s",  tables[i].tableName);
     1817            return false;
     1818        }
    18021819    }
    18031820
Note: See TracChangeset for help on using the changeset viewer.