ce5fb4ee78a01179f2f53114b6eb52ca77811eb6 kate Wed Jan 23 10:08:41 2013 -0800 1. hgFileUi now only prints data restriction warning if the composite has a restricted object. 2. Add -cv option to mdbPrint to allow alternate CV file. 2. 3. A step toward modularizing restriction timestamp handling. #10006 Mute File UI loud warnings when they are not applicable. diff --git src/hg/lib/cv.c src/hg/lib/cv.c index e244b9f..b159eea 100644 --- src/hg/lib/cv.c +++ src/hg/lib/cv.c @@ -157,30 +157,31 @@ const char *cvFile() // return default location of cv.ra { static char filePath[PATH_LEN]; if (cvFileRequested != NULL) { safecpy(filePath, sizeof(filePath), cvFileRequested); } else { char *root = hCgiRoot(); if (root == NULL || *root == 0) root = "/usr/local/apache/cgi-bin/"; // Make this check out sandboxes? safef(filePath, sizeof(filePath), "%s/encode/%s", root,CV_FILE_NAME); } +verbose(3, "CV file: %s\n", filePath); if (!fileExists(filePath)) errAbort("Error: can't locate %s; %s doesn't exist\n", CV_FILE_NAME, filePath); return filePath; } const struct hash *cvTermHash(const char *term) // returns a hash of hashes of a term which should be defined in cv.ra // NOTE: in static memory: DO NOT FREE { static struct hash *cvHashOfHashesOfHashes = NULL; if (cvHashOfHashesOfHashes == NULL) // gets them all at once. cvHashOfHashesOfHashes = raReadThreeLevels((char *)cvFile(), CV_TERM,CV_TYPE); if (sameString(term,CV_TERM_CELL)) term = CV_UGLY_TERM_CELL_LINE; @@ -527,31 +528,31 @@ safef(reason,len,"ERROR in %s: Term '%s' says validate in cv but not " "found as a cv term.",CV_FILE_NAME,CV_TERM_CONTROL); return FALSE; } if (hashFindVal(cvHashForTerm,(char *)val) != NULL) return TRUE; } if (reason != NULL) safef(reason,len,"INVALID cv lookup: %s = '%s' %s",(char *)term,(char *)val, (cvHashForVal?"DEPRECATED.":"not found.")); return FALSE; } } else if (startsWithWord(CV_VALIDATE_DATE,validationRule)) { - if (dateToSeconds((char *)val,"%F") == 0) + if (dateToSeconds((char *)val, MDB_ENCODE_DATE_FORMAT) == 0) { if (reason != NULL) safef(reason,len,"INVALID date: %s = %s",(char *)term,(char *)val); return FALSE; } } else if (startsWithWord(CV_VALIDATE_EXISTS,validationRule)) { return TRUE; // (e.g. fileName exists) Nothing to be done at this time. } else if (startsWithWord(CV_VALIDATE_FLOAT,validationRule)) { // Don't want float, just error (However, casting to void resulted in // a compile error on Ubuntu Maveric and Lucid) char* end;