mirror of https://github.com/acidanthera/audk.git
fix the bug in revision 1746
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1747 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
f337986f8e
commit
f15e135965
|
@ -94,9 +94,15 @@ public class ParseParameter {
|
||||||
//
|
//
|
||||||
if(argstr.length() < 6 && argstr.charAt(3) == '0'){
|
if(argstr.length() < 6 && argstr.charAt(3) == '0'){
|
||||||
curpstr = pstr;
|
curpstr = pstr;
|
||||||
|
npflag = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
curpstr = mergeSetting(curpstr, argstr);
|
if(curpstr == null){
|
||||||
|
curpstr = pstr.concat(argstr.substring(2));
|
||||||
|
}else{
|
||||||
|
curpstr = mergeSetting(curpstr, argstr);
|
||||||
|
}
|
||||||
|
npflag = true;
|
||||||
} else if (argstr.charAt(1) == 't') {
|
} else if (argstr.charAt(1) == 't') {
|
||||||
if(argstr.length() < 4 && argstr.charAt(2) == ' '){
|
if(argstr.length() < 4 && argstr.charAt(2) == ' '){
|
||||||
System.out.printf("%s\n", curtstr);
|
System.out.printf("%s\n", curtstr);
|
||||||
|
@ -108,9 +114,15 @@ public class ParseParameter {
|
||||||
}
|
}
|
||||||
if(argstr.length() < 6 && argstr.charAt(3) == '0'){
|
if(argstr.length() < 6 && argstr.charAt(3) == '0'){
|
||||||
curtstr = tstr;
|
curtstr = tstr;
|
||||||
|
ntflag = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
curtstr = mergeSetting(curtstr, argstr);
|
if(curtstr == null){
|
||||||
|
curtstr = tstr.concat(argstr.substring(2));
|
||||||
|
}else{
|
||||||
|
curtstr = mergeSetting(curtstr, argstr);
|
||||||
|
}
|
||||||
|
ntflag = true;
|
||||||
} else if (argstr.charAt(1) == 'a') {
|
} else if (argstr.charAt(1) == 'a') {
|
||||||
if(argstr.length() < 4 && argstr.charAt(2) == ' '){
|
if(argstr.length() < 4 && argstr.charAt(2) == ' '){
|
||||||
System.out.printf("%s\n", curastr);
|
System.out.printf("%s\n", curastr);
|
||||||
|
@ -122,9 +134,15 @@ public class ParseParameter {
|
||||||
}
|
}
|
||||||
if(argstr.length() < 6 && argstr.charAt(3) == '0'){
|
if(argstr.length() < 6 && argstr.charAt(3) == '0'){
|
||||||
curastr = astr;
|
curastr = astr;
|
||||||
|
naflag = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
curastr = mergeSetting(curastr, argstr);
|
if(curastr == null){
|
||||||
|
curastr = astr.concat(argstr.substring(2));
|
||||||
|
}else{
|
||||||
|
curastr = mergeSetting(curastr, argstr);
|
||||||
|
}
|
||||||
|
naflag = true;
|
||||||
} else if (argstr.charAt(1) == 'c') {
|
} else if (argstr.charAt(1) == 'c') {
|
||||||
if(argstr.length() < 4 && argstr.charAt(2) == ' '){
|
if(argstr.length() < 4 && argstr.charAt(2) == ' '){
|
||||||
System.out.printf("%s\n", curcstr);
|
System.out.printf("%s\n", curcstr);
|
||||||
|
@ -136,9 +154,15 @@ public class ParseParameter {
|
||||||
}
|
}
|
||||||
if(argstr.length() < 6 && argstr.charAt(3) == '0'){
|
if(argstr.length() < 6 && argstr.charAt(3) == '0'){
|
||||||
curcstr = cstr;
|
curcstr = cstr;
|
||||||
|
ncflag = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
curcstr = mergeSetting(curcstr, argstr);
|
if(curcstr == null){
|
||||||
|
curcstr = pstr.concat(argstr.substring(2));
|
||||||
|
}else{
|
||||||
|
curcstr = mergeSetting(curcstr, argstr);
|
||||||
|
}
|
||||||
|
ncflag = true;
|
||||||
} else if (argstr.charAt(1) == 'n') {
|
} else if (argstr.charAt(1) == 'n') {
|
||||||
if(argstr.length() < 4 && argstr.charAt(2) == ' '){
|
if(argstr.length() < 4 && argstr.charAt(2) == ' '){
|
||||||
System.out.printf("%s\n", curnstr);
|
System.out.printf("%s\n", curnstr);
|
||||||
|
@ -150,9 +174,15 @@ public class ParseParameter {
|
||||||
}
|
}
|
||||||
if(argstr.length() < 6 && argstr.charAt(3) == '0'){
|
if(argstr.length() < 6 && argstr.charAt(3) == '0'){
|
||||||
curnstr = nstr;
|
curnstr = nstr;
|
||||||
|
nnflag = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
curnstr = mergeSetting(curnstr, argstr);
|
if(curnstr == null){
|
||||||
|
curnstr = nstr.concat(argstr.substring(2));
|
||||||
|
}else{
|
||||||
|
curnstr = mergeSetting(curnstr, argstr);
|
||||||
|
}
|
||||||
|
nnflag = true;
|
||||||
} else if (argstr.charAt(1) == 'm') {
|
} else if (argstr.charAt(1) == 'm') {
|
||||||
if(argstr.length() < 4 && argstr.charAt(2) == ' '){
|
if(argstr.length() < 4 && argstr.charAt(2) == ' '){
|
||||||
System.out.printf("%s\n", curmstr);
|
System.out.printf("%s\n", curmstr);
|
||||||
|
@ -164,12 +194,14 @@ public class ParseParameter {
|
||||||
}
|
}
|
||||||
mstr += argstr.substring(2);
|
mstr += argstr.substring(2);
|
||||||
curmstr = mstr;
|
curmstr = mstr;
|
||||||
|
nmflag = true;
|
||||||
if (argstr.charAt(3) == '0'){
|
if (argstr.charAt(3) == '0'){
|
||||||
mestr += " Disable";
|
mestr += " Disable";
|
||||||
} else {
|
} else {
|
||||||
mestr += " Enable";
|
mestr += " Enable";
|
||||||
}
|
}
|
||||||
curmestr = mestr;
|
curmestr = mestr;
|
||||||
|
nmeflag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -180,13 +212,10 @@ public class ParseParameter {
|
||||||
public static String mergeSetting( String S1, String S2){
|
public static String mergeSetting( String S1, String S2){
|
||||||
|
|
||||||
String[] S = S2.split(" ");
|
String[] S = S2.split(" ");
|
||||||
if(S1 == null){
|
|
||||||
S1 = tstr.concat(S2.substring(2));
|
for(int i = 1; i < S.length; i++){
|
||||||
}else{
|
if(S1.contains(S[i]) == false){
|
||||||
for(int i = 1; i < S.length; i++){
|
S1 = S1.concat(" ").concat(S[i]);
|
||||||
if( S1.contains(S[i]) == false ){
|
|
||||||
S1 = S1.concat(S[i]).concat(" ");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,5 +260,13 @@ public class ParseParameter {
|
||||||
public static int nlength = 0;
|
public static int nlength = 0;
|
||||||
public static int mlength = 0;
|
public static int mlength = 0;
|
||||||
public static int melength = 0;
|
public static int melength = 0;
|
||||||
|
|
||||||
|
public static boolean npflag = false;
|
||||||
|
public static boolean ntflag = false;
|
||||||
|
public static boolean naflag = false;
|
||||||
|
public static boolean ncflag = false;
|
||||||
|
public static boolean nnflag = false;
|
||||||
|
public static boolean nmflag = false;
|
||||||
|
public static boolean nmeflag = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,14 +157,16 @@ public class TargetFile {
|
||||||
if (textLine.indexOf("ACTIVE_PLATFORM") != -1) {
|
if (textLine.indexOf("ACTIVE_PLATFORM") != -1) {
|
||||||
if(pflag == true){
|
if(pflag == true){
|
||||||
if(textLine.trim().charAt(0) == '#'){
|
if(textLine.trim().charAt(0) == '#'){
|
||||||
if(ParseParameter.curpstr.length() >= ParseParameter.plength) {
|
if(ParseParameter.npflag == true) {
|
||||||
bw.write(ParseParameter.curpstr);
|
bw.write(ParseParameter.curpstr);
|
||||||
bw.newLine();
|
}else{
|
||||||
pflag = false;
|
bw.write(textLine);
|
||||||
}
|
}
|
||||||
|
bw.newLine();
|
||||||
|
pflag = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(ParseParameter.curpstr.length() >= ParseParameter.plength) {
|
if(ParseParameter.npflag == true) {
|
||||||
bw.write(ParseParameter.curpstr);
|
bw.write(ParseParameter.curpstr);
|
||||||
} else {
|
} else {
|
||||||
bw.write(textLine);
|
bw.write(textLine);
|
||||||
|
@ -175,14 +177,16 @@ public class TargetFile {
|
||||||
} else if (textLine.indexOf("TARGET_ARCH") != -1) {
|
} else if (textLine.indexOf("TARGET_ARCH") != -1) {
|
||||||
if(aflag == true){
|
if(aflag == true){
|
||||||
if(textLine.trim().charAt(0) == '#'){
|
if(textLine.trim().charAt(0) == '#'){
|
||||||
if(ParseParameter.curastr.length() >= ParseParameter.alength) {
|
if(ParseParameter.naflag == true) {
|
||||||
bw.write(ParseParameter.curastr);
|
bw.write(ParseParameter.curastr);
|
||||||
bw.newLine();
|
}else{
|
||||||
aflag = false;
|
bw.write(textLine);
|
||||||
}
|
}
|
||||||
|
bw.newLine();
|
||||||
|
aflag = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(ParseParameter.curastr.length() >= ParseParameter.alength) {
|
if(ParseParameter.naflag == true) {
|
||||||
bw.write(ParseParameter.curastr);
|
bw.write(ParseParameter.curastr);
|
||||||
} else {
|
} else {
|
||||||
bw.write(textLine);
|
bw.write(textLine);
|
||||||
|
@ -193,14 +197,16 @@ public class TargetFile {
|
||||||
} else if (textLine.indexOf("TARGET") != -1) {
|
} else if (textLine.indexOf("TARGET") != -1) {
|
||||||
if(tflag == true){
|
if(tflag == true){
|
||||||
if(textLine.trim().charAt(0) == '#'){
|
if(textLine.trim().charAt(0) == '#'){
|
||||||
if(ParseParameter.curtstr.length() >= ParseParameter.tlength) {
|
if(ParseParameter.ntflag == true) {
|
||||||
bw.write(ParseParameter.curtstr);
|
bw.write(ParseParameter.curtstr);
|
||||||
bw.newLine();
|
}else{
|
||||||
tflag = false;
|
bw.write(textLine);
|
||||||
}
|
}
|
||||||
|
bw.newLine();
|
||||||
|
tflag = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(ParseParameter.curtstr.length() >= ParseParameter.tlength) {
|
if(ParseParameter.ntflag == true) {
|
||||||
bw.write(ParseParameter.curtstr);
|
bw.write(ParseParameter.curtstr);
|
||||||
} else {
|
} else {
|
||||||
bw.write(textLine);
|
bw.write(textLine);
|
||||||
|
@ -211,14 +217,16 @@ public class TargetFile {
|
||||||
} else if (textLine.indexOf("TOOL_CHAIN_CONF") != -1) {
|
} else if (textLine.indexOf("TOOL_CHAIN_CONF") != -1) {
|
||||||
if(cflag == true){
|
if(cflag == true){
|
||||||
if(textLine.trim().charAt(0) == '#'){
|
if(textLine.trim().charAt(0) == '#'){
|
||||||
if(ParseParameter.curcstr.length() >= ParseParameter.clength) {
|
if(ParseParameter.ncflag == true) {
|
||||||
bw.write(ParseParameter.curcstr);
|
bw.write(ParseParameter.curcstr);
|
||||||
bw.newLine();
|
}else{
|
||||||
cflag = false;
|
bw.write(textLine);
|
||||||
}
|
}
|
||||||
|
bw.newLine();
|
||||||
|
cflag = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(ParseParameter.curcstr.length() >= ParseParameter.clength) {
|
if(ParseParameter.ncflag == true) {
|
||||||
bw.write(ParseParameter.curcstr);
|
bw.write(ParseParameter.curcstr);
|
||||||
} else {
|
} else {
|
||||||
bw.write(textLine);
|
bw.write(textLine);
|
||||||
|
@ -229,14 +237,16 @@ public class TargetFile {
|
||||||
} else if (textLine.indexOf("TOOL_CHAIN_TAG") != -1) {
|
} else if (textLine.indexOf("TOOL_CHAIN_TAG") != -1) {
|
||||||
if(nflag == true){
|
if(nflag == true){
|
||||||
if(textLine.trim().charAt(0) == '#'){
|
if(textLine.trim().charAt(0) == '#'){
|
||||||
if(ParseParameter.curnstr.length() >= ParseParameter.nlength) {
|
if(ParseParameter.nnflag == true) {
|
||||||
bw.write(ParseParameter.curnstr);
|
bw.write(ParseParameter.curnstr);
|
||||||
bw.newLine();
|
}else{
|
||||||
nflag = false;
|
bw.write(textLine);
|
||||||
}
|
}
|
||||||
|
bw.newLine();
|
||||||
|
nflag = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(ParseParameter.curnstr.length() >= ParseParameter.nlength) {
|
if(ParseParameter.nnflag == true) {
|
||||||
bw.write(ParseParameter.curnstr);
|
bw.write(ParseParameter.curnstr);
|
||||||
} else {
|
} else {
|
||||||
bw.write(textLine);
|
bw.write(textLine);
|
||||||
|
@ -247,14 +257,16 @@ public class TargetFile {
|
||||||
} else if (textLine.indexOf("MAX_CONCURRENT_THREAD_NUMBER") != -1) {
|
} else if (textLine.indexOf("MAX_CONCURRENT_THREAD_NUMBER") != -1) {
|
||||||
if(mflag == true){
|
if(mflag == true){
|
||||||
if(textLine.trim().charAt(0) == '#'){
|
if(textLine.trim().charAt(0) == '#'){
|
||||||
if(ParseParameter.curmstr.length() >= ParseParameter.mlength) {
|
if(ParseParameter.nmflag == true) {
|
||||||
bw.write(ParseParameter.curmstr);
|
bw.write(ParseParameter.curmstr);
|
||||||
bw.newLine();
|
}else{
|
||||||
mflag = false;
|
bw.write(textLine);
|
||||||
}
|
}
|
||||||
|
bw.newLine();
|
||||||
|
mflag = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(ParseParameter.curmstr.length() >= ParseParameter.mlength) {
|
if(ParseParameter.nmflag == true) {
|
||||||
bw.write(ParseParameter.curmstr);
|
bw.write(ParseParameter.curmstr);
|
||||||
} else {
|
} else {
|
||||||
bw.write(textLine);
|
bw.write(textLine);
|
||||||
|
@ -265,14 +277,16 @@ public class TargetFile {
|
||||||
}else if (textLine.indexOf("MULTIPLE_THREAD") != -1) {
|
}else if (textLine.indexOf("MULTIPLE_THREAD") != -1) {
|
||||||
if(meflag == true){
|
if(meflag == true){
|
||||||
if(textLine.trim().charAt(0) == '#'){
|
if(textLine.trim().charAt(0) == '#'){
|
||||||
if(ParseParameter.curmestr.length() >= ParseParameter.melength) {
|
if(ParseParameter.nmeflag == true) {
|
||||||
bw.write(ParseParameter.curmestr);
|
bw.write(ParseParameter.curmestr);
|
||||||
bw.newLine();
|
}else{
|
||||||
meflag = false;
|
bw.write(textLine);
|
||||||
}
|
}
|
||||||
|
bw.newLine();
|
||||||
|
meflag = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(ParseParameter.curmestr.length() >= ParseParameter.melength) {
|
if(ParseParameter.nmeflag == true) {
|
||||||
bw.write(ParseParameter.curmestr);
|
bw.write(ParseParameter.curmestr);
|
||||||
} else {
|
} else {
|
||||||
bw.write(textLine);
|
bw.write(textLine);
|
||||||
|
@ -286,25 +300,25 @@ public class TargetFile {
|
||||||
//
|
//
|
||||||
//user maybe delete the line *ACTIVE_PLATFORM*=*
|
//user maybe delete the line *ACTIVE_PLATFORM*=*
|
||||||
//
|
//
|
||||||
if( (pflag == true) && (ParseParameter.curpstr.length() >= ParseParameter.plength) ){
|
if( (pflag == true) && (ParseParameter.npflag == true) ){
|
||||||
bw.write(ParseParameter.curpstr);
|
bw.write(ParseParameter.curpstr);
|
||||||
bw.newLine();
|
bw.newLine();
|
||||||
} else if ( (tflag == true) && (ParseParameter.curtstr.length() >= ParseParameter.tlength) ){
|
} else if ( (tflag == true) && (ParseParameter.ntflag == true) ){
|
||||||
bw.write(ParseParameter.curtstr);
|
bw.write(ParseParameter.curtstr);
|
||||||
bw.newLine();
|
bw.newLine();
|
||||||
} else if ( (aflag == true) && (ParseParameter.curastr.length() >= ParseParameter.alength) ){
|
} else if ( (aflag == true) && (ParseParameter.naflag == true) ){
|
||||||
bw.write(ParseParameter.curastr);
|
bw.write(ParseParameter.curastr);
|
||||||
bw.newLine();
|
bw.newLine();
|
||||||
} else if ( (cflag == true) && (ParseParameter.curcstr.length() >= ParseParameter.clength) ){
|
} else if ( (cflag == true) && (ParseParameter.ncflag == true) ){
|
||||||
bw.write(ParseParameter.curcstr);
|
bw.write(ParseParameter.curcstr);
|
||||||
bw.newLine();
|
bw.newLine();
|
||||||
} else if ( (nflag == true) && (ParseParameter.curnstr.length() >= ParseParameter.nlength) ){
|
} else if ( (nflag == true) && (ParseParameter.nnflag == true) ){
|
||||||
bw.write(ParseParameter.curnstr);
|
bw.write(ParseParameter.curnstr);
|
||||||
bw.newLine();
|
bw.newLine();
|
||||||
} else if ( (meflag == true) && (ParseParameter.curmestr.length() >= ParseParameter.melength) ){
|
} else if ( (meflag == true) && (ParseParameter.nmeflag == true) ){
|
||||||
bw.write(ParseParameter.curmestr);
|
bw.write(ParseParameter.curmestr);
|
||||||
bw.newLine();
|
bw.newLine();
|
||||||
} else if ( (mflag == true) && (ParseParameter.curmstr.length() >= ParseParameter.mlength) ){
|
} else if ( (mflag == true) && (ParseParameter.nmflag == true) ){
|
||||||
bw.write(ParseParameter.curmstr);
|
bw.write(ParseParameter.curmstr);
|
||||||
bw.newLine();
|
bw.newLine();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue