Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2009-04-29 16:18:46 -0400
committerPascal Rapicault2009-04-29 16:18:46 -0400
commitd1530272e01fcaba3091cd9dc8227902e27ed6be (patch)
treed53c841f26596a0626297a4656371cd22df621a4 /bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse
parent2a5b06a2595ae120f04ab89b5bf34330309ba13c (diff)
downloadrt.equinox.p2-d1530272e01fcaba3091cd9dc8227902e27ed6be.tar.gz
rt.equinox.p2-d1530272e01fcaba3091cd9dc8227902e27ed6be.tar.xz
rt.equinox.p2-d1530272e01fcaba3091cd9dc8227902e27ed6be.zip
Bug 264110 - Input format consistency for application and tasks
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CompositeRepositoryTask.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/Repo2RunnableTask.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/SlicingOption.java22
4 files changed, 25 insertions, 8 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CompositeRepositoryTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CompositeRepositoryTask.java
index ec674dcc4..f1e8e9e9c 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CompositeRepositoryTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CompositeRepositoryTask.java
@@ -62,4 +62,8 @@ public class CompositeRepositoryTask extends AbstractRepositoryTask {
public void setFailOnExists(boolean value) {
((CompositeRepositoryApplication) application).setFailOnExists(value);
}
+
+ public void setValidate(String value) {
+ ((CompositeRepositoryApplication) application).setComparator(value);
+ }
}
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java
index 5fdb90312..8be3de90d 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java
@@ -95,7 +95,7 @@ public class IUDescription extends DataType {
queries.add(new InstallableUnitQuery(id));
queries.add(new LatestIUVersionQuery());
} else {
- Version iuVersion = new Version(version);
+ Version iuVersion = Version.parseVersion(version);
queries.add(new InstallableUnitQuery(id, iuVersion));
}
}
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/Repo2RunnableTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/Repo2RunnableTask.java
index d3fb10cdb..5d03cb48d 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/Repo2RunnableTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/Repo2RunnableTask.java
@@ -14,6 +14,7 @@ import java.util.List;
import org.apache.tools.ant.BuildException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
+import org.eclipse.equinox.p2.internal.repository.tools.Messages;
import org.eclipse.equinox.p2.internal.repository.tools.Repo2Runnable;
/**
@@ -45,13 +46,13 @@ public class Repo2RunnableTask extends AbstractRepositoryTask {
application.initializeRepos(null);
List ius = prepareIUs();
if ((ius == null || ius.size() == 0) && !(application.hasArtifactSources() || application.hasMetadataSources()))
- throw new BuildException("Need to specify either a non-empty source metadata repository or a valid list of IUs.");
+ throw new BuildException(Messages.exception_needIUsOrNonEmptyRepo);
application.setSourceIUs(ius);
IStatus result = application.run(null);
if (result.matches(IStatus.ERROR))
throw new ProvisionException(result);
} catch (ProvisionException e) {
- throw new BuildException("Error occurred while transforming repository.", e);
+ throw new BuildException(Messages.Repo2RunnableTask_errorTransforming, e);
}
}
}
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/SlicingOption.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/SlicingOption.java
index c7ff268f6..79b79ae30 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/SlicingOption.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/SlicingOption.java
@@ -10,7 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.p2.internal.repository.tools.tasks;
-import java.util.*;
+import java.util.Dictionary;
+import java.util.StringTokenizer;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.eclipse.equinox.p2.internal.repository.tools.Messages;
@@ -56,8 +57,6 @@ public class SlicingOption extends Task {
if (tok.countTokens() != 3)
throw new BuildException(NLS.bind(Messages.SlicingOption_invalid_platform, platformFilter));
Dictionary filter = options.getFilter();
- if (filter == null)
- filter = new Properties();
filter.put("osgi.os", tok.nextToken().trim()); //$NON-NLS-1$
filter.put("osgi.ws", tok.nextToken().trim()); //$NON-NLS-1$
filter.put("osgi.arch", tok.nextToken().trim()); //$NON-NLS-1$
@@ -70,12 +69,25 @@ public class SlicingOption extends Task {
public void setIncludeFeatures(boolean includeFeatures) {
Dictionary filter = options.getFilter();
- if (filter == null)
- filter = new Properties();
filter.put("org.eclipse.update.install.features", String.valueOf(includeFeatures)); //$NON-NLS-1$
options.setFilter(filter);
}
+ public void setFilter(String filterString) {
+ if (filterString == null || filterString.trim().equals("")) //$NON-NLS-1$
+ return;
+ Dictionary filter = options.getFilter();
+ StringTokenizer tok = new StringTokenizer(filterString, ","); //$NON-NLS-1$
+ while (tok.hasMoreTokens()) {
+ String rule = tok.nextToken().trim();
+ int eqIndex = rule.indexOf('=');
+ if (eqIndex == -1)
+ throw new BuildException(NLS.bind(Messages.SlicingOption_invalidFilterFormat, rule));
+ filter.put(rule.substring(0, eqIndex), rule.substring(eqIndex + 1));
+ }
+ options.setFilter(filter);
+ }
+
/**
* Set this property to true if only strict dependencies must be followed. A strict dependency is defined by a version range only including one version (e.g. [1.0.0.v2009, 1.0.0.v2009])
* The default value is false.

Back to the top