mirror of https://github.com/acidanthera/audk.git
Fix a bug in HobLib migration.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1837 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
2679d84f24
commit
4c5f3cc94c
|
@ -261,12 +261,19 @@ public final class SourceFileReplacer implements Common.ForDoAll {
|
||||||
Matcher mtrhobstatus;
|
Matcher mtrhobstatus;
|
||||||
String templine = wholeline;
|
String templine = wholeline;
|
||||||
for (int i = 0; i < specialhoblibfunc.length; i++) {
|
for (int i = 0; i < specialhoblibfunc.length; i++) {
|
||||||
ptnhobstatus = Pattern.compile("(Status\\s*=\\s*)?" + specialhoblibfunc[i] + "(.*?\\)\\s*;)", Pattern.DOTALL);
|
do {
|
||||||
mtrhobstatus = ptnhobstatus.matcher(templine);
|
ptnhobstatus = Pattern.compile("((?:\t| )*)(\\w(?:\\w|\\d)*)\\s*=\\s*" + specialhoblibfunc[i] + "(.*?;)", Pattern.DOTALL);
|
||||||
if (mtrhobstatus.find()) {
|
mtrhobstatus = ptnhobstatus.matcher(templine);
|
||||||
templine = mtrhobstatus.replaceAll(specialhoblibfunc[i] + mtrhobstatus.group(2) + "\n " +
|
if (!mtrhobstatus.find()) {
|
||||||
MigrationTool.MIGRATIONCOMMENT + "R9 Hob-building library functions will assert if build failure.\n Status = EFI_SUCCESS;");
|
break;
|
||||||
}
|
}
|
||||||
|
String captureIndent = mtrhobstatus.group(1);
|
||||||
|
String captureStatus = mtrhobstatus.group(2);
|
||||||
|
String replaceString = captureIndent + specialhoblibfunc[i] + mtrhobstatus.group(3) + "\n";
|
||||||
|
replaceString += captureIndent + MigrationTool.MIGRATIONCOMMENT + "R9 Hob-building library functions will assert if build failure.\n";
|
||||||
|
replaceString += captureIndent + captureStatus + " = EFI_SUCCESS;";
|
||||||
|
templine = mtrhobstatus.replaceFirst(replaceString);
|
||||||
|
} while (true);
|
||||||
}
|
}
|
||||||
return templine;
|
return templine;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue