[Esbox-commits] r1054 - in branches/work_Petr: org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk

baranov at garage.maemo.org baranov at garage.maemo.org
Mon Dec 8 11:59:40 EET 2008


Author: baranov
Date: 2008-12-08 11:59:39 +0200 (Mon, 08 Dec 2008)
New Revision: 1054

Modified:
   branches/work_Petr/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchbox2SDK.java
   branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListAvailableMaemoRootstrapsSb2Command.java
   branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDK.java
   branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDKTarget.java
   branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/MaemoRootstrapContentLabelProvider.java
   branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/TargetWizardRootstrapSb2Page.java
   branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/MaemoRootstrap.java
Log:
remove 'description' column from the sb2 intall rootstrap wizard page

Modified: branches/work_Petr/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchbox2SDK.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchbox2SDK.java	2008-12-05 22:12:15 UTC (rev 1053)
+++ branches/work_Petr/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchbox2SDK.java	2008-12-08 09:59:39 UTC (rev 1054)
@@ -26,12 +26,15 @@
 	public void setUp() throws Exception {
 		super.setUp();
 		possibleRootstraps = new HashSet<String>();
-		possibleRootstraps.add("diablo41_armel");
+		possibleRootstraps.add("diablo4.1_armel");
+		possibleRootstraps.add("diablo4.1_i386l");
 		possibleRootstraps.add("diablo4.1.1_i386");
+		possibleRootstraps.add("diablo4.1.1_armel");
 		possibleRootstraps.add("chinook40_armel");
 		possibleRootstraps.add("bora31_armel");
-		possibleRootstraps.add("scirocco22_armel");
-		possibleRootstraps.add("mistral20_armel");
+		possibleRootstraps.add("scirocco2.2_armel");
+		possibleRootstraps.add("scirocco2.2_i386");
+		possibleRootstraps.add("mistral2.0_armel");
 	}
 	@Override
 	protected void tearDown() throws Exception {
@@ -73,6 +76,11 @@
 		platform = sb2Sdk.getPlatform("diablo41_i386");
 		assertEquals("Diablo", platform.getName());
 		assertEquals("4.1", platform.getVersion());
+		
+		platform = sb2Sdk.getPlatform("diablo4.1.1_armel");
+		assertEquals("Diablo", platform.getName());
+		assertEquals("4.1.1", platform.getVersion());
+		
 	}
 	
 	

Modified: branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListAvailableMaemoRootstrapsSb2Command.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListAvailableMaemoRootstrapsSb2Command.java	2008-12-05 22:12:15 UTC (rev 1053)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/ListAvailableMaemoRootstrapsSb2Command.java	2008-12-08 09:59:39 UTC (rev 1054)
@@ -12,6 +12,7 @@
 package org.maemo.esbox.internal.scratchbox.sb2.command;
 
 import org.maemo.esbox.internal.api.scratchbox.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.internal.scratchbox.sb2.core.Scratchbox2SDK;
 import org.maemo.esbox.scratchbox.core.command.ScratchboxInvalidParameterException;
 import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
 import org.maemo.esbox.scratchbox.sb2.sdk.MaemoRootstrap;
@@ -21,6 +22,7 @@
 import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
 
 import java.util.*;
+import java.util.regex.Matcher;
 
 /**
  * List the maemo rootstraps available for installation.
@@ -71,23 +73,16 @@
 
 		// the output is in the form "target_arch, arch, description" for each line 
 		for (String line : available) {
-			if (line.contains("Nickname,")) {
-				gotHeader = true;
+			Matcher matcher = Scratchbox2SDK.TARGET_PLATFORM_VERSION_ARCHITECTURE_PATTERN.matcher(line);
+			if(!matcher.matches()){
 				continue;
 			}
-			if (line.trim().length() == 0) {
-				continue;
+			
+			String[] tokens = line.split("_");
+			if (tokens.length == 2) {
+				targetsAvailable.add(new MaemoRootstrap(line, tokens[1]));
 			}
-			if (!gotHeader) {
-				continue;
-			}
 
-			String[] tokens = line.split(",\\s*");
-			if (tokens.length == 3) {
-				targetsAvailable.add(new MaemoRootstrap(tokens[0], tokens[1],
-						tokens[2]));
-			}
-
 		}
 
 		return targetsAvailable;

Modified: branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDK.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDK.java	2008-12-05 22:12:15 UTC (rev 1053)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDK.java	2008-12-08 09:59:39 UTC (rev 1054)
@@ -263,6 +263,8 @@
 			if (versionInfo.length() == 2)
 				version = versionInfo.substring(0, 1) + "."
 						+ versionInfo.substring(1, 2);
+			else if(version!=null)
+				version=versionInfo;
 			return new BaseSDKPlatform(platformName, version);
 		} else {
 			return new BaseSDKPlatform(ISDKPlatform.NAME_UNKNOWN,

Modified: branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDKTarget.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDKTarget.java	2008-12-05 22:12:15 UTC (rev 1053)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDKTarget.java	2008-12-08 09:59:39 UTC (rev 1054)
@@ -108,17 +108,6 @@
 		return targetRoot;
 	}
 
-	
-	
-//	/*
-//	 * (non-Javadoc)
-//	 * 
-//	 * @see
-//	 * org.maemo.mica.internal.api.common.core.sdk.BaseSDKTarget#getArchitecture()
-//	 */
-//	public String getArchitecture() {
-//		return super.getName().split("_")[1];
-//	}
 
 	/**
 	 * Get the command template for launching qemu under gdb with this target

Modified: branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/MaemoRootstrapContentLabelProvider.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/MaemoRootstrapContentLabelProvider.java	2008-12-05 22:12:15 UTC (rev 1053)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/MaemoRootstrapContentLabelProvider.java	2008-12-08 09:59:39 UTC (rev 1054)
@@ -37,7 +37,6 @@
 		IFontProvider {
 	static final int COLUMN_NAME = 0;
 	static final int COLUMN_ARCHITECTURE = 1;
-	static final int COLUMN_DESCRIPTION = 2;
 
 	public static Object LOADING_LABEL = new Object();
 
@@ -140,13 +139,6 @@
 			} else {
 				return ((MaemoRootstrap) element).getArchitecture();
 			}
-
-		case COLUMN_DESCRIPTION:
-			if (element == LOADING_LABEL) {
-				return null;
-			} else {
-				return ((MaemoRootstrap) element).getDescription();
-			}
 		}
 		return null;
 	}

Modified: branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/TargetWizardRootstrapSb2Page.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/TargetWizardRootstrapSb2Page.java	2008-12-05 22:12:15 UTC (rev 1053)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/TargetWizardRootstrapSb2Page.java	2008-12-08 09:59:39 UTC (rev 1054)
@@ -123,12 +123,6 @@
 		archColumn.setWidth(100);
 		archColumn.setResizable(true);
 
-		TreeColumn descColumn = new TreeColumn(rootstrapTargetViewer.getTree(),
-				SWT.LEFT);
-		descColumn.setText("Description");
-		descColumn.setWidth(200);
-		descColumn.setResizable(true);
-
 		rootstrapTargetViewer.setInput(new Object());
 
 		rootstrapTargetViewer.setSelection(StructuredSelection.EMPTY);

Modified: branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/MaemoRootstrap.java
===================================================================
--- branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/MaemoRootstrap.java	2008-12-05 22:12:15 UTC (rev 1053)
+++ branches/work_Petr/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/MaemoRootstrap.java	2008-12-08 09:59:39 UTC (rev 1054)
@@ -20,12 +20,10 @@
 public class MaemoRootstrap {
 	private final String name;
 	private final String architecture;
-	private final String description;
 
-	public MaemoRootstrap(String name, String architecture, String description) {
+	public MaemoRootstrap(String name, String architecture) {
 		this.name = name;
 		this.architecture = architecture;
-		this.description = description;
 
 	}
 
@@ -37,9 +35,7 @@
 		return architecture;
 	}
 
-	public String getDescription() {
-		return description;
-	}
+	
 
 	public String getTarget(){
 		return name+"_"+architecture;
@@ -50,8 +46,6 @@
 		int result = 1;
 		result = prime * result
 				+ ((architecture == null) ? 0 : architecture.hashCode());
-		result = prime * result
-				+ ((description == null) ? 0 : description.hashCode());
 		result = prime * result + ((name == null) ? 0 : name.hashCode());
 		return result;
 	}
@@ -70,11 +64,6 @@
 				return false;
 		} else if (!architecture.equals(other.architecture))
 			return false;
-		if (description == null) {
-			if (other.description != null)
-				return false;
-		} else if (!description.equals(other.description))
-			return false;
 		if (name == null) {
 			if (other.name != null)
 				return false;



More information about the Esbox-commits mailing list