IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 31, 2012, 11:38:18 AM (14 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20120627/ippTools/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120627/ippTools/src

  • branches/eam_branches/ipp-20120627/ippTools/src/disttool.c

    r34081 r34241  
    743743
    744744    query = "DELETE FROM distComponent where dist_id = %" PRId64;
     745    char *query2 =  "DELETE from rcDSFileset using distRun, rcDSFileset WHERE distRun.dist_id = rcDSFileset.dist_id AND rcDSFileset.state ='cleaned' AND dist_id = %" PRId64;
    745746   
    746747    for (long i=0; i < psArrayLength(output); i++) {
     
    753754        }
    754755
     756        // delete any existing distComponents
    755757        if (!p_psDBRunQueryF(config->dbh, query, dist_id)) {
     758            psError(PS_ERR_UNKNOWN, false, "database error");
     759            psFree(query);
     760            if (!psDBRollback(config->dbh)) {
     761                psError(PS_ERR_UNKNOWN, false, "database error");
     762            }
     763            return false;
     764        }
     765        // delete any exisiting fileset
     766        if (!p_psDBRunQueryF(config->dbh, query2, dist_id)) {
    756767            psError(PS_ERR_UNKNOWN, false, "database error");
    757768            psFree(query);
  • branches/eam_branches/ipp-20120627/ippTools/src/magictool.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20120627/ippTools/src/pxtools.c

    r32565 r34241  
    301301    PXOPT_LOOKUP_STR(note, config->args,        "-set_note", false, false);
    302302
     303#ifdef DISALLOW_CHANGE_TO_UPDATE
     304    // Back in the days of magic we didn't allow state changes of Run's
     305    // to update because the interaction with destreaking was problematic
     306    // With the death of magic we can allow this now.
    303307    if ((state)&&(!strcmp(state, "update"))) {
    304308        fprintf(stderr, "'-updaterun -set_state update' is not supported.");
     
    310314        exit(1);
    311315    }
    312 
     316#endif
    313317    psString dist_group = NULL;
    314318    if (has_dist_group) {
     
    350354    psString joinHook = psStringCopy("");
    351355    psString fileWhere = NULL;
     356
     357#ifdef DISALLOW_CHANGE_TO_UPDATE
    352358    if (state && !strcmp(state, "update")) {
    353359        psStringAppend(&joinHook, "\n JOIN %s USING(%s)", fileTable, idColumn);
     
    355361        psStringAppend(&fileWhere, "AND %s.data_state = 'cleaned'", fileTable);
    356362    }
     363#endif
    357364
    358365    psString whereClause =  psDBGenerateWhereSQL(where, NULL);
  • branches/eam_branches/ipp-20120627/ippTools/src/staticskytool.c

    r34081 r34241  
    11441144static bool updateskycalrunMode(pxConfig *config)
    11451145{
    1146 #ifdef notyet
    11471146    PS_ASSERT_PTR_NON_NULL(config, false);
    11481147
    11491148    psMetadata *where = psMetadataAlloc();
    1150     PXOPT_COPY_S64(config->args, where, "-sky_id",  "sky_id",   "==");
     1149    PXOPT_COPY_S64(config->args, where, "-skycal_id",  "skycal_id",   "==");
    11511150    PXOPT_COPY_STR(config->args, where, "-label",   "label",    "==");
    11521151    PXOPT_COPY_STR(config->args, where, "-state",   "state",    "==");
     
    11571156    }
    11581157
    1159     psString query = psStringCopy("UPDATE staticskyRun");
     1158    psString query = psStringCopy("UPDATE skycalRun");
    11601159
    11611160    // pxUpdateRun gets parameters from config->args and updates
    1162     bool result = pxUpdateRun(config, where, &query, "staticskyRun", "sky_id", "staticskyResult", true, false);
     1161    bool result = pxUpdateRun(config, where, &query, "skycalRun", "skycal_id", "skycalResult", true, false);
    11631162    psFree(query);
    11641163    psFree(where);
    11651164
    11661165    return result;
    1167 #endif
    1168     return false;
    1169 }
     1166}
     1167
    11701168static bool pendingskycalrunMode(pxConfig *config)
    11711169{
     
    13701368    PXOPT_COPY_S64(config->args, where, "-skycal_id",  "skycalRun.skycal_id", "==");
    13711369    PXOPT_COPY_S64(config->args, where, "-sky_id",     "skycalRun.sky_id", "==");
    1372     PXOPT_COPY_S64(config->args, where, "-stack_id",   "skycalRun.stack_id", "==");
     1370    PXOPT_COPY_S64(config->args, where, "-stack_id",   "stackRun.stack_id", "==");
    13731371    PXOPT_COPY_STR(config->args, where, "-tess_id",    "stackRun.tess_id", "LIKE");
    13741372    PXOPT_COPY_STR(config->args, where, "-skycell_id", "stackRun.skycell_id", "LIKE");
     
    14471445
    14481446    psMetadata *where = psMetadataAlloc();
    1449     PXOPT_COPY_S64(config->args, where, "-skycal_id", "staticskyResult.sky_id", "==");
    1450     pxAddLabelSearchArgs(config, where, "-label", "staticskyRun.label", "==");
    1451     pxAddLabelSearchArgs(config, where, "-data_group", "staticskyRun.data_group", "==");
     1447    PXOPT_COPY_S64(config->args, where, "-skycal_id", "skycalResult.skycal_id", "==");
     1448    pxAddLabelSearchArgs(config, where, "-label", "skycalRun.label", "==");
     1449    pxAddLabelSearchArgs(config, where, "-data_group", "skycalRun.data_group", "==");
    14521450    pxAddLabelSearchArgs(config, where, "-filter", "stackRun.filter", "==");
    1453     PXOPT_COPY_S16(config->args, where, "-fault", "staticskyResult.fault", "==");
     1451    PXOPT_COPY_S16(config->args, where, "-fault", "skycalResult.fault", "==");
    14541452
    14551453    if (!psListLength(where->list) && !psMetadataLookupBool(NULL, config->args, "-all")) {
  • branches/eam_branches/ipp-20120627/ippTools/src/staticskytoolConfig.c

    r33919 r34241  
    171171    // -updateskycalrun
    172172    psMetadata *updateskycalrunArgs = psMetadataAlloc();
    173     psMetadataAddS64(updateskycalrunArgs, PS_LIST_TAIL, "-sky_id", 0, "search by stack ID", 0);
     173    psMetadataAddS64(updateskycalrunArgs, PS_LIST_TAIL, "-skycal_id", 0, "search by skycal ID", 0);
    174174    psMetadataAddStr(updateskycalrunArgs, PS_LIST_TAIL, "-state", 0, "search by state", NULL);
    175175    psMetadataAddStr(updateskycalrunArgs, PS_LIST_TAIL, "-label", 0, "search by label", 0);
     
    218218    // -revertskycal
    219219    psMetadata *revertskycalArgs= psMetadataAlloc();
    220     psMetadataAddS64(revertskycalArgs, PS_LIST_TAIL, "-skycal_id", 0, "search by staticsky ID", 0);
     220    psMetadataAddS64(revertskycalArgs, PS_LIST_TAIL, "-skycal_id", 0, "search by skycal ID", 0);
    221221    psMetadataAddStr(revertskycalArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by label", 0);
    222222    psMetadataAddStr(revertskycalArgs, PS_LIST_TAIL, "-data_group", PS_META_DUPLICATE_OK, "search by data_group", 0);
Note: See TracChangeset for help on using the changeset viewer.