aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Gilmer <kgilmer@gmail.com>2011-07-01 18:43:37 +0900
committerKen Gilmer <kgilmer@gmail.com>2011-07-01 18:43:37 +0900
commit26c8f3d57ff23246545b65b87d679534a9423210 (patch)
tree77a24e9631a8c89075bf6dad68df50253323bbf9
parent4c892e2bef2f65a92ec24defd224e1c91ce844c5 (diff)
downloadeclipsetools-26c8f3d57ff23246545b65b87d679534a9423210.zip
eclipsetools-26c8f3d57ff23246545b65b87d679534a9423210.tar.gz
eclipsetools-26c8f3d57ff23246545b65b87d679534a9423210.tar.bz2
OTE: all actions against bitbake now use package name-version instead of
directly referencing the recipe file.
-rw-r--r--org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/AbstractBitbakeCommandAction.java29
-rw-r--r--org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeBuildRecipeAction.java30
-rw-r--r--org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeCleanRecipeAction.java2
-rw-r--r--org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeImportAction.java3
-rw-r--r--org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeRebuildRecipeAction.java2
5 files changed, 33 insertions, 33 deletions
diff --git a/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/AbstractBitbakeCommandAction.java b/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/AbstractBitbakeCommandAction.java
index 406c887..484c8a6 100644
--- a/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/AbstractBitbakeCommandAction.java
+++ b/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/AbstractBitbakeCommandAction.java
@@ -205,5 +205,34 @@ public abstract class AbstractBitbakeCommandAction implements IWorkbenchWindowAc
action.setEnabled(false);
}
+
+ /**
+ * @param path Path to recipe file
+ * @return The recipe name that bitbake will understand, based on a full path to a recipe file.
+ */
+ protected static String getRecipeFromIFile(IFile path) {
+ String bbRecipeExtension = ".bb";
+ if (!path.getName().endsWith(bbRecipeExtension))
+ throw new RuntimeException("File is not a bitbake recipe: " + path.getName());
+
+ //Extract the filename without the extension.
+ String name = path.getName().substring(0, path.getName().length() - bbRecipeExtension.length());
+
+ String [] nvp = name.split("_");
+
+ if (nvp.length == 0)
+ throw new RuntimeException("Unable to parse recipe name from filename: " + name);
+
+ //No version information embedded in the filename
+ if (nvp.length == 1)
+ return nvp[0];
+
+ //Use bitbake's convention for specifying the version with a "-"
+ if (nvp.length == 2)
+ return nvp[0] + "-" + nvp[1];
+
+ //Unknown format, just return the name
+ return nvp[0];
+ }
} \ No newline at end of file
diff --git a/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeBuildRecipeAction.java b/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeBuildRecipeAction.java
index 073ee8b..cb08a5d 100644
--- a/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeBuildRecipeAction.java
+++ b/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeBuildRecipeAction.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.openembedded.bc.ui.actions;
-import org.eclipse.core.resources.IFile;
public class BitbakeBuildRecipeAction extends AbstractBitbakeCommandAction {
@@ -23,33 +22,4 @@ public class BitbakeBuildRecipeAction extends AbstractBitbakeCommandAction {
public String getJobTitle() {
return "Building " + recipe.getName();
}
-
- /**
- * @param path Path to recipe file
- * @return The recipe name that bitbake will understand, based on a full path to a recipe file.
- */
- private static String getRecipeFromIFile(IFile path) {
- String bbRecipeExtension = ".bb";
- if (!path.getName().endsWith(bbRecipeExtension))
- throw new RuntimeException("File is not a bitbake recipe: " + path.getName());
-
- //Extract the filename without the extension.
- String name = path.getName().substring(0, path.getName().length() - bbRecipeExtension.length());
-
- String [] nvp = name.split("_");
-
- if (nvp.length == 0)
- throw new RuntimeException("Unable to parse recipe name from filename: " + name);
-
- //No version information embedded in the filename
- if (nvp.length == 1)
- return nvp[0];
-
- //Use bitbake's convention for specifying the version with a "-"
- if (nvp.length == 2)
- return nvp[0] + "-" + nvp[1];
-
- //Unknown format, just return the name
- return nvp[0];
- }
} \ No newline at end of file
diff --git a/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeCleanRecipeAction.java b/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeCleanRecipeAction.java
index a0f41c8..fc6f364 100644
--- a/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeCleanRecipeAction.java
+++ b/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeCleanRecipeAction.java
@@ -14,7 +14,7 @@ public class BitbakeCleanRecipeAction extends AbstractBitbakeCommandAction {
@Override
public String [] getCommands() {
- return new String[] {"bitbake -c clean -b " + recipe.getLocationURI().getPath()};
+ return new String[] {"bitbake -c clean " + getRecipeFromIFile(recipe)};
}
@Override
diff --git a/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeImportAction.java b/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeImportAction.java
index e8e093f..92caba1 100644
--- a/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeImportAction.java
+++ b/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeImportAction.java
@@ -60,7 +60,8 @@ public class BitbakeImportAction extends AbstractBitbakeCommandAction {
}
if (!workdir.exists()) {
- execCommands(new String[] {"bitbake -c patch -b " + recipe.getLocationURI().getPath()}, monitor);
+ String packageName = getRecipeFromIFile(recipe);
+ execCommands(new String[] {"bitbake -c patch " + packageName}, monitor);
}
if (!workdir.exists()) {
diff --git a/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeRebuildRecipeAction.java b/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeRebuildRecipeAction.java
index f968b12..0840228 100644
--- a/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeRebuildRecipeAction.java
+++ b/org.openembedded.bc.ui/src/org/openembedded/bc/ui/actions/BitbakeRebuildRecipeAction.java
@@ -19,7 +19,7 @@ public class BitbakeRebuildRecipeAction extends AbstractBitbakeCommandAction {
@Override
public String [] getCommands() {
- return new String[] {"bitbake -c rebuild -b " + recipe.getLocationURI().getPath()};
+ return new String[] {"bitbake -c rebuild " + getRecipeFromIFile(recipe)};
}
@Override