- Timestamp:
- Jul 17, 2014, 12:30:45 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-ops-20130712/psModules
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/config/pmConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-ops-20130712/psModules
- Property svn:mergeinfo deleted
-
branches/eam_branches/ipp-ops-20130712/psModules/src/config/pmConfig.c
r34234 r37066 965 965 "Original replaced by -R option", newRule); 966 966 } 967 psFree(camerasIter); 968 } 969 970 // Look for command-line options for files to replace 971 while ((argNum = psArgumentGet(*argc, argv, "-photcode-rule")) > 0) { 972 psArgumentRemove(argNum, argc, argv); 973 if (argNum >= *argc) { 974 psError(PM_ERR_CONFIG, true, 975 "-photcode-rule provided without new rule."); 976 psFree(config); 977 return NULL; 978 } 979 980 psString newrule = psStringCopy(argv[argNum]); // The filerule, to be modified 981 psArgumentRemove(argNum, argc, argv); 982 983 psMetadata *cameras = psMetadataLookupMetadata(NULL, config->system, "CAMERAS"); // List of cameras 984 if (!cameras) { 985 psError(PM_ERR_CONFIG, false, "Unable to find CAMERAS in the site configuration.\n"); 986 return false; 987 } 988 989 psMetadataIterator *camerasIter = psMetadataIteratorAlloc(cameras, PS_LIST_HEAD, NULL); // Iterator 990 psMetadataItem *cameraItem; // Item from iteration 991 while ((cameraItem = psMetadataGetAndIncrement(camerasIter))) { 992 // Silently ignore problems --- they will be caught later, because if the user wants the nominated 993 // file and it's not available for that camera, then they will know. 994 995 if (cameraItem->type != PS_DATA_METADATA) { 996 psTrace("psModules.config", 2, 997 "Entry %s in CAMERAS is not of type METADATA --- ignored.", cameraItem->name); 998 continue; 999 } 1000 psMetadata *camera = cameraItem->data.md; // Camera configuration 1001 1002 psMetadataAddStr (camera, PS_LIST_TAIL, "PHOTCODE.RULE", PS_META_REPLACE, "original replaced by -photcode-rule option", newrule); 1003 } 1004 psFree(newrule); 967 1005 psFree(camerasIter); 968 1006 } … … 1860 1898 } 1861 1899 1862 return psMetadataLookupMetadata( NULL, filerules, realname);1900 return psMetadataLookupMetadata(&mdok, filerules, realname); 1863 1901 } 1864 1902
Note:
See TracChangeset
for help on using the changeset viewer.
