summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-28 05:22:00 +0000
committerwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-28 05:22:00 +0000
commit53d853a683b47ad9dc2aed3f55166d8b66c899d2 (patch)
tree68362abbebf80f7fd51de6ef20d5ef71ba81a7b1
parenta929458e6682db26d87d4ebe80150e13820d3e50 (diff)
downloadedk2-platforms-53d853a683b47ad9dc2aed3f55166d8b66c899d2.tar.xz
Remove additional / or \ in relative path.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1134 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java6
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java6
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java12
3 files changed, 15 insertions, 9 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java b/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java
index 9371c7e6d5..2d8ed0b023 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java
@@ -14,13 +14,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
package org.tianocore.build;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
import java.util.Vector;
import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
@@ -32,9 +28,7 @@ import org.tianocore.build.global.SurfaceAreaQuery;
import org.tianocore.build.id.FpdModuleIdentification;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
/**
<p><code>FfsProcess</code> is a class to find the corresponding FFS layout. </p>
diff --git a/Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java b/Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java
index 530e4e7907..815fd44528 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java
@@ -68,7 +68,11 @@ public class PackageIdentification extends Identification{
public String getPackageRelativeDir(){
prepareSpdFile();
- return spdFile.getParent().substring(GlobalData.getWorkspacePath().length() + 1);
+ String relativeDir =spdFile.getParent().substring(GlobalData.getWorkspacePath().length());
+ if(relativeDir.startsWith("\\") || relativeDir.startsWith("/")) {
+ relativeDir = relativeDir.substring(1);
+ }
+ return relativeDir;
}
private void prepareSpdFile(){
diff --git a/Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java b/Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java
index 39a13d92d6..c5c2f1e030 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java
@@ -51,10 +51,18 @@ public class PlatformIdentification extends Identification{
}
public String getRelativeFpdFile (){
- return fpdFile.getPath().substring(GlobalData.getWorkspacePath().length() + 1);
+ String relativeDir = fpdFile.getPath().substring(GlobalData.getWorkspacePath().length());
+ if(relativeDir.startsWith("\\") || relativeDir.startsWith("/")) {
+ relativeDir = relativeDir.substring(1);
+ }
+ return relativeDir;
}
public String getPlatformRelativeDir(){
- return fpdFile.getParent().substring(GlobalData.getWorkspacePath().length() + 1);
+ String relativeDir = fpdFile.getParent().substring(GlobalData.getWorkspacePath().length());
+ if(relativeDir.startsWith("\\") || relativeDir.startsWith("/")) {
+ relativeDir = relativeDir.substring(1);
+ }
+ return relativeDir;
}
} \ No newline at end of file