Changeset 7791
- Timestamp:
- Jul 3, 2006, 11:18:30 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/config/pmConfig.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/config/pmConfig.c
r7754 r7791 3 3 * @author PAP, IfA 4 4 * 5 * @version $Revision: 1. 29$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-0 6-29 20:39:56$5 * @version $Revision: 1.30 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-07-03 21:18:30 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 666 666 config->recipesRead |= sourceType; 667 667 668 // Having read that, we now need to check to see if any symbolic links need to be resolved 669 recipesIter = psMetadataIteratorAlloc(config->recipesSource, PS_LIST_HEAD, NULL); 670 psMetadataItem *sourceItem = NULL; // Item containing source, from iteration 671 while ((sourceItem = psMetadataGetAndIncrement(recipesIter))) { 672 assert(sourceItem->type == PS_TYPE_S32); // It should be this type: we put it in ourselves 673 if (sourceItem->data.S32 == P_PM_RECIPE_SOURCE_SYMBOLIC) { 674 const char *linkName = sourceItem->comment; // The name of the link 675 psMetadata *linkSource = psMetadataLookupMD(&mdok, config->recipes, linkName); // The source 676 if (!mdok || !linkSource) { 677 psLogMsg(__func__, PS_LOG_WARN, "Unable to resolve symbolic link for recipe %s to %s " 678 "--- ignored.\n", sourceItem->name, linkName); 679 continue; 680 } 681 psMetadataItem *target = psMetadataLookup(config->recipes, sourceItem->name); // The target item 682 assert(target); // It had better be here: it's in the "sourcesRead" metadata 683 psFree(target->data.V); // Free old copy 684 target->data.V = psMetadataCopy(NULL, linkSource); 685 } 686 } 687 psFree(recipesIter); 668 688 return true; 669 689 } … … 709 729 710 730 // Command-line has the highest priority, so we don't have to check to see if it's already there 711 psMetadataAddS32(config->recipesSource, PS_LIST_TAIL, recipeName, PS_META_REPLACE,712 "Recipe added from command line", P_PM_RECIPE_SOURCE_CL);713 731 714 732 // Is the source a symbolic reference? … … 720 738 comment, extant); 721 739 psFree(comment); 740 // Put the source in the comment, so we can retrieve it again if we need it 741 psMetadataAddS32(config->recipesSource, PS_LIST_TAIL, recipeName, PS_META_REPLACE, 742 recipeSource, P_PM_RECIPE_SOURCE_SYMBOLIC); 743 722 744 } else { 723 745 // Otherwise, treat the source as a filename … … 730 752 psFree(comment); 731 753 psFree(recipe); // Drop reference 754 psMetadataAddS32(config->recipesSource, PS_LIST_TAIL, recipeName, PS_META_REPLACE, 755 "Recipe added from command line", P_PM_RECIPE_SOURCE_CL); 732 756 } 733 757 }
Note:
See TracChangeset
for help on using the changeset viewer.
