diff options
author | DJ Houghton | 2009-02-09 14:53:44 +0000 |
---|---|---|
committer | DJ Houghton | 2009-02-09 14:53:44 +0000 |
commit | 1de7f89e2b47f41a0fd568f32e7e20d80c6ffd79 (patch) | |
tree | b7d825577a10ca7638b82b7f79627fe4e7216d8b /bundles/org.eclipse.equinox.p2.repository.tools | |
parent | cbb6559e3de298abc932e0b469ec9982eb758961 (diff) | |
download | rt.equinox.p2-1de7f89e2b47f41a0fd568f32e7e20d80c6ffd79.tar.gz rt.equinox.p2-1de7f89e2b47f41a0fd568f32e7e20d80c6ffd79.tar.xz rt.equinox.p2-1de7f89e2b47f41a0fd568f32e7e20d80c6ffd79.zip |
Bug 264186 - Repo transformer app should fail early if there are no IUs to process
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository.tools')
2 files changed, 9 insertions, 7 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java index 033450da3..327fcd207 100644 --- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java +++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java @@ -132,10 +132,12 @@ public class Repo2Runnable implements IApplication { } // get all IUs from the repos if (sourceMetadataRepositories == null || sourceMetadataRepositories.isEmpty()) - throw new ProvisionException("Need to specify either a source metadata repository or a valid list of IUs."); + throw new ProvisionException("Need to specify either a non-empty source metadata repository or a valid list of IUs."); for (Iterator iter = sourceMetadataRepositories.iterator(); iter.hasNext();) { processedIUs.addAll(getAllIUs((URI) iter.next(), monitor).toCollection()); } + if (processedIUs.isEmpty()) + throw new ProvisionException("Need to specify either a non-empty source metadata repository or a valid list of IUs."); } /* 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 ae0edb146..00e75e64d 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 @@ -61,12 +61,12 @@ public class Repo2RunnableTask extends Task { try { prepareSourceRepos(); List ius = prepareIUs(); - if (ius != null && ius.size() > 0) { - application.setSourceIUs(ius); - IStatus result = application.run(null); - if (result.matches(IStatus.ERROR)) - throw new ProvisionException(result); - } + if (ius == null || ius.size() == 0) + throw new BuildException("Need to specify either a non-empty source metadata repository or a valid list of IUs."); + 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); } catch (URISyntaxException e) { |