Changeset 16611 for trunk/psModules/src/config/pmConfigRecipes.c
- Timestamp:
- Feb 22, 2008, 10:21:52 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/config/pmConfigRecipes.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/config/pmConfigRecipes.c
r15727 r16611 11 11 #include "pmConfigRecipes.h" 12 12 13 static bool loadRecipeS ite(bool *status, pmConfig *config, psMetadata *source);13 static bool loadRecipeSystem(bool *status, pmConfig *config, psMetadata *source); 14 14 static bool loadRecipeCamera(bool *status, pmConfig *config, psMetadata *source); 15 15 static bool loadRecipeFromArguments(bool *status, pmConfig *config); … … 46 46 47 47 // this function may be called several times. it attempts to load the recipe data from one of 48 // three locations: config-> site, config->camera, and argv. We cannot read the recipes48 // three locations: config->complete, config->camera, and argv. We cannot read the recipes 49 49 // from config->camera until a camera has been read BUT, the argv recipes must override the 50 // camera and s iterecipes.50 // camera and system recipes. 51 51 bool pmConfigReadRecipes(pmConfig *config, pmRecipeSource source) 52 52 { … … 58 58 } 59 59 60 // Read the recipe file names from the s iteconfiguration and camera configuration61 // It is an error for config-> site:recipes not to exist. all programs install their62 // master recipe files in the s ite:recipe location when they are built.63 if (config-> site && (source & PM_RECIPE_SOURCE_SITE)) {64 if (!loadRecipeS ite(&status, config, config->site)) {65 psError(PS_ERR_IO, false, "Failed to read recipes from s iteconfig");66 return false; 67 } 68 psTrace ("psModules.config", 3, "read recipes from s iteconfig");60 // Read the recipe file names from the system configuration and camera configuration 61 // It is an error for config->complete:recipes not to exist. all programs install their 62 // master recipe files in the system:recipe location when they are built. 63 if (config->complete && (source & PM_RECIPE_SOURCE_SYSTEM)) { 64 if (!loadRecipeSystem(&status, config, config->complete)) { 65 psError(PS_ERR_IO, false, "Failed to read recipes from system config"); 66 return false; 67 } 68 psTrace ("psModules.config", 3, "read recipes from system config"); 69 69 } 70 70 … … 283 283 } 284 284 285 // Load the recipe files for S ITE: REQUIRED286 static bool loadRecipeS ite(bool *status,285 // Load the recipe files for SYSTEM : REQUIRED 286 static bool loadRecipeSystem(bool *status, 287 287 pmConfig *config, // The configuration into which to read the recipes 288 288 psMetadata *source // The source configuration, from which to read the filenames … … 294 294 295 295 if (!source) { 296 psError(PS_ERR_IO, true, "The s iteconfiguration has not been read --- cannot read recipes from this location.\n");297 config->recipesRead &= ~PM_RECIPE_SOURCE_S ITE;296 psError(PS_ERR_IO, true, "The system configuration has not been read --- cannot read recipes from this location.\n"); 297 config->recipesRead &= ~PM_RECIPE_SOURCE_SYSTEM; 298 298 return false; 299 299 } … … 301 301 psMetadata *recipes = psMetadataLookupMetadata(NULL, source, "RECIPES"); // The list of recipes 302 302 if (!recipes) { 303 psError(PS_ERR_IO, false, "RECIPES not found in the s iteconfiguration\n");303 psError(PS_ERR_IO, false, "RECIPES not found in the system configuration\n"); 304 304 return false; 305 305 } … … 313 313 // type mismatch is a serious error 314 314 if (fileItem->type != PS_DATA_STRING) { 315 psError(PS_ERR_IO, true, "%s in s iteconfiguration RECIPES is not of type STR", fileItem->name);315 psError(PS_ERR_IO, true, "%s in system configuration RECIPES is not of type STR", fileItem->name); 316 316 return false; 317 317 } … … 320 320 psMetadata *recipe = NULL; 321 321 if (!pmConfigFileRead(&recipe, fileItem->data.str, "recipe")) { 322 psError(PS_ERR_IO, false, "Failed to read recipe file %s listed in s iteconfiguration\n",322 psError(PS_ERR_IO, false, "Failed to read recipe file %s listed in system configuration\n", 323 323 fileItem->data.str); 324 324 return false; … … 331 331 } 332 332 psFree(recipesIter); 333 config->recipesRead |= PM_RECIPE_SOURCE_S ITE;333 config->recipesRead |= PM_RECIPE_SOURCE_SYSTEM; 334 334 335 335 *status = true; … … 337 337 } 338 338 339 // Load the recipe files (valid for S ITE| CAMERA)339 // Load the recipe files (valid for SYSTEM | CAMERA) 340 340 // each time we load a specific recipe, it overrides the existing metadata for that recipe 341 // for sourceType == S ITE| CAMERA, RECIPES contains a list of files to be read (pmConfigFileRead)341 // for sourceType == SYSTEM | CAMERA, RECIPES contains a list of files to be read (pmConfigFileRead) 342 342 static bool loadRecipeCamera(bool *status, // status variable 343 343 pmConfig *config, // The configuration into which to read the recipes
Note:
See TracChangeset
for help on using the changeset viewer.
