Add Package-Guid Map.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1745 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8 2006-10-14 07:01:53 +00:00
parent 8c84e1b1ac
commit 9c0e70cb4a
4 changed files with 43 additions and 6 deletions

View File

@ -0,0 +1,3 @@
PackageName,GuidValue
MdePkg,5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec
EdkModulePkg,68169ab0-d41b-4009-9060-292c253ac43d
1 PackageName GuidValue
2 MdePkg 5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec
3 EdkModulePkg 68169ab0-d41b-4009-9060-292c253ac43d

View File

@ -23,6 +23,7 @@ public final class Database {
DatabasePath = path;
try {
importPkgGuid("PkgGuid.csv");
importDBLib("Library.csv");
importDBGuid("Guid.csv", "Guid");
importDBGuid("Ppi.csv", "Ppi");
@ -41,9 +42,32 @@ public final class Database {
private Map<String,Guid> hashguid = new HashMap<String,Guid>();
private Map<String,Func> hashfunc = new HashMap<String,Func>();
private Map<String,Macro> hashmacro = new HashMap<String,Macro>();
private Map<String,String> hashPkgGuid = new HashMap<String,String>();
//-------------------------------------import------------------------------------------//
private void importPkgGuid(String filename) throws Exception {
BufferedReader rd = new BufferedReader(new FileReader(DatabasePath + File.separator + filename));
String line;
String[] linecontext;
Func lf;
if (rd.ready()) {
System.out.println("Found " + filename + ", Importing Package Guid Database.");
//
// Skip the title row.
//
line = rd.readLine();
while ((line = rd.readLine()) != null) {
if (line.length() != 0) {
linecontext = line.split(",");
hashPkgGuid.put(linecontext[0], linecontext[1]);
}
}
}
}
public Iterator<String> dumpAllPkgGuid() {
return hashPkgGuid.values().iterator();
}
private void importDBLib(String filename) throws Exception {
BufferedReader rd = new BufferedReader(new FileReader(DatabasePath + File.separator + filename));
String line;

View File

@ -225,8 +225,14 @@ public class MsaOwner {
}
public final boolean setupPackageDependencies() {
addPackage("5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec");
addPackage("68169ab0-d41b-4009-9060-292c253ac43d");
Iterator<String> it;
//
// For now, simply add all package guids in the database.
//
it = MigrationTool.db.dumpAllPkgGuid();
while (it.hasNext()) {
packagedependencies.addNewPackage().setPackageGuid(it.next());
}
return true;
}

View File

@ -120,9 +120,13 @@ public class MsaWriter {
md.setSupportedArchitectures(arch);
md.setBinaryModule(false);
md.setOutputFileBasename(mi.modulename);
pd.addNewPackage().setPackageGuid("5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec");
pd.addNewPackage().setPackageGuid("68169ab0-d41b-4009-9060-292c253ac43d");
//
// For now, simply add all package guids in the database.
//
it = MigrationTool.db.dumpAllPkgGuid();
while (it.hasNext()) {
pd.addNewPackage().setPackageGuid(it.next());
}
externs.addNewSpecification().setStringValue("EFI_SPECIFICATION_VERSION 0x00020000");
externs.addNewSpecification().setStringValue("EDK_RELEASE_VERSION 0x00020000");
if (mi.entrypoint != null) {