Fix two transition issue:

1) Although current PCD tool's code support use packageName, packageGuid, version, arch to identify a module, but these value can not be got from FPD file, so use null for transition phase.
2) Add transition code to check <TokenSpaceGuid>, In future, the checking work should be done by schema checking tools when change occur of <TokenSpaceGuid> from[0..1] to [1] in schema.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@508 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2 2006-06-14 04:01:11 +00:00
parent d5e51168eb
commit 833b154119
1 changed files with 30 additions and 9 deletions

View File

@ -1485,15 +1485,15 @@ public class CollectPCDAction {
// <ModuleSAs>, It is work around code.
//
primaryKey1 = UsageInstance.getPrimaryKey(modules.get(index).module.getModuleName(),
translateSchemaStringToUUID(modules.get(index).module.getModuleGuid()),
modules.get(index).module.getPackageName(),
translateSchemaStringToUUID(modules.get(index).module.getPackageGuid()),
null,
null,
null,
modules.get(index).module.getArch().toString(),
null);
primaryKey2 = UsageInstance.getPrimaryKey(modules.get(index2).module.getModuleName(),
translateSchemaStringToUUID(modules.get(index2).module.getModuleGuid()),
modules.get(index2).module.getPackageName(),
translateSchemaStringToUUID(modules.get(index2).module.getPackageGuid()),
null,
null,
null,
modules.get(index2).module.getArch().toString(),
null);
if (primaryKey1.equalsIgnoreCase(primaryKey2)) {
@ -1532,6 +1532,17 @@ public class CollectPCDAction {
datum = pcdBuildData.getValue();
maxDatumSize = pcdBuildData.getMaxDatumSize();
//
// Check <TokenSpaceGuid> is exist? In future, because all schema verification will tools
// will check that, following checking code could be removed.
//
if (pcdBuildData.getTokenSpaceGuid() == null) {
exceptionString = String.format("[FPD file error] There is no <TokenSpaceGuid> for PCD %s in module %s! This is required!",
pcdBuildData.getCName(),
moduleName);
throw new EntityException(exceptionString);
}
//
// -------------------------------------------------------------------------------------------
// 2.1.1), Do some necessary checking work for FixedAtBuild, FeatureFlag and PatchableInModule
@ -1676,9 +1687,9 @@ public class CollectPCDAction {
//
usageInstance = new UsageInstance(token,
moduleName,
translateSchemaStringToUUID(modules.get(index).module.getModuleGuid()),
modules.get(index).module.getPackageName(),
translateSchemaStringToUUID(modules.get(index).module.getPackageGuid()),
null,
null,
null,
modules.get(index).type,
pcdType,
modules.get(index).module.getArch().toString(),
@ -1734,6 +1745,16 @@ public class CollectPCDAction {
dynamicPcdBuildDataArray = dynamicPcdBuildDefinitions.getPcdBuildDataList();
for (index = 0; index < dynamicPcdBuildDataArray.size(); index ++) {
//
// Check <TokenSpaceGuid> is exist? In future, because all schema verification will tools
// will check that, following checking code could be removed.
//
if (dynamicPcdBuildDataArray.get(index).getTokenSpaceGuid() == null) {
exceptionString = String.format("[FPD file error] There is no <TokenSpaceGuid> for PCD %s in <DynamicPcdBuildDefinitions>! This is required!",
dynamicPcdBuildDataArray.get(index).getCName());
throw new EntityException(exceptionString);
}
dynamicPrimaryKey = Token.getPrimaryKeyString(dynamicPcdBuildDataArray.get(index).getCName(),
translateSchemaStringToUUID(dynamicPcdBuildDataArray.get(index).getTokenSpaceGuid()));
if (dynamicPrimaryKey.equalsIgnoreCase(token.getPrimaryKeyString())) {