IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17506


Ignore:
Timestamp:
May 4, 2008, 1:39:27 PM (18 years ago)
Author:
eugene
Message:

reduce unneeded verbosity; handle REPLACE case for METADATA input item correctly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080430/psLib/src/types/psMetadata.c

    r17498 r17506  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.168.6.2 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2008-05-02 00:10:43 $
     14 *  @version $Revision: 1.168.6.3 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2008-05-04 23:39:27 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    423423    default:
    424424        // Other kinds of pointers
    425         psWarning("Copying a pointer in the metadata item: %s (%x)\n", in->name, in->type);
     425      // XXX EAM : why was this a warning??
     426      // psWarning("Copying a pointer in the metadata item: %s (%x)\n", in->name, in->type);
    426427        newItem = p_psMetadataItemAlloc(file, lineno, func, in->name, in->type, in->comment, in->data.V);
    427428        break;
     
    502503    // save a list of the MULTI entries which has REPLACE turned off?
    503504
    504     psArray *multiItems = psArrayAlloc (128);
     505    psArray *multiItems = psArrayAllocEmpty (128);
    505506
    506507    psMetadataIterator *iter = psMetadataIteratorAlloc(in, PS_LIST_HEAD, NULL);
     
    545546        psMetadataItem *newItem = psMetadataItemCopy(inItem); // Copied item
    546547        if (!psMetadataAddItem(out, newItem, PS_LIST_TAIL, flag)) {
    547             fprintf (stderr, "Error copying %s\n", inItem->name);
     548            psError(PS_ERR_UNKNOWN, false, "Error copying %s\n", inItem->name);
    548549            result = false;
    549550        }
     
    692693
    693694    // special block for items which are METADATA folders
    694     if (item->type == PS_DATA_METADATA) {
     695    if (existingEntry && (item->type == PS_DATA_METADATA)) {
     696        // REPLACE and UPDATE must be mutually exclusive
     697        psAssert ((!((flags & PS_META_REPLACE) && (flags & PS_META_UPDATE_FOLDER))), "cannot have both REPLACE and UPDATE");
     698
     699        # if (0)
     700        // handle the case of replace below
    695701        if (flags & PS_META_REPLACE) {
    696702            // drop the existing entry (skip if we are replacing with same pointer)
    697703            // XXX what if existingEntry is a MULTI?  drop all?
     704            // XXX this segment does not check for matched types
    698705            if (item != existingEntry) {
    699706                psMetadataRemoveKey(md, key);
    700707            }
     708            existingEntry = NULL;
    701709        }
     710        # endif
     711
    702712        if (flags & PS_META_UPDATE_FOLDER) {
    703713            if (existingEntry->type != PS_DATA_METADATA) {
     
    12461256            *status = false;
    12471257        } else {
    1248             psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_DATA_META, as expected.\n", key);
     1258            psLogMsg(__func__, PS_LOG_DETAIL, "%s isn't of type PS_DATA_META, as expected.\n", key);
    12491259        }
    12501260        //        value = NULL;
     
    12811291            *status = false;
    12821292        } else {
    1283             psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_DATA_TIME, as expected.\n", key);
     1293            psLogMsg(__func__, PS_LOG_DETAIL, "%s isn't of type PS_DATA_TIME, as expected.\n", key);
    12841294        }
    12851295        return NULL;
     
    13161326            *status = false;
    13171327        } else {
    1318             psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_DATA_STRING, as expected.\n", key);
     1328            psLogMsg(__func__, PS_LOG_DETAIL, "%s isn't of type PS_DATA_STRING, as expected.\n", key);
    13191329        }
    13201330        //        value = NULL;
Note: See TracChangeset for help on using the changeset viewer.