### Eclipse Workspace Patch 1.0 #P org.eclipse.equinox.p2.director Index: META-INF/MANIFEST.MF =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director/META-INF/MANIFEST.MF,v retrieving revision 1.16 diff -u -r1.16 MANIFEST.MF --- META-INF/MANIFEST.MF 15 Apr 2008 18:04:52 -0000 1.16 +++ META-INF/MANIFEST.MF 21 Apr 2008 09:52:31 -0000 @@ -19,7 +19,7 @@ org.eclipse.osgi.service.resolver;version="1.1.0", org.eclipse.osgi.util;version="1.0.0", org.osgi.framework;version="1.3.0" -Export-Package: org.eclipse.equinox.internal.p2.director;x-friends:="org.eclipse.equinox.p2.exemplarysetup", +Export-Package: org.eclipse.equinox.internal.p2.director;x-friends:="org.eclipse.equinox.p2.exemplarysetup,org.eclipse.equinox.p2.director.app", org.eclipse.equinox.internal.p2.resolution;x-internal:=true, org.eclipse.equinox.internal.p2.rollback;x-friends:="org.eclipse.equinox.p2.ui", org.eclipse.equinox.internal.provisional.p2.director #P org.eclipse.equinox.p2.artifact.repository Index: META-INF/MANIFEST.MF =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF,v retrieving revision 1.19 diff -u -r1.19 MANIFEST.MF --- META-INF/MANIFEST.MF 9 Apr 2008 18:57:44 -0000 1.19 +++ META-INF/MANIFEST.MF 21 Apr 2008 09:52:32 -0000 @@ -6,7 +6,7 @@ Bundle-Localization: plugin Bundle-Version: 0.1.0.qualifier Export-Package: org.eclipse.equinox.internal.p2.artifact.mirror;x-internal:=true, - org.eclipse.equinox.internal.p2.artifact.repository;x-friends:="org.eclipse.equinox.p2.metadata.generator,org.eclipse.equinox.p2.tests", + org.eclipse.equinox.internal.p2.artifact.repository;x-friends:="org.eclipse.equinox.p2.metadata.generator,org.eclipse.equinox.p2.tests,org.eclipse.equinox.p2.director.app", org.eclipse.equinox.internal.p2.artifact.repository.simple;x-friends:="org.eclipse.equinox.p2.selfhosting,org.eclipse.equinox.p2.touchpoint.eclipse,org.eclipse.equinox.p2.tests", org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing, #P org.eclipse.equinox.p2.core Index: META-INF/MANIFEST.MF =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF,v retrieving revision 1.16 diff -u -r1.16 MANIFEST.MF --- META-INF/MANIFEST.MF 20 Mar 2008 00:31:41 -0000 1.16 +++ META-INF/MANIFEST.MF 21 Apr 2008 09:52:33 -0000 @@ -16,7 +16,7 @@ org.osgi.framework;version="1.3.0", org.osgi.util.tracker;version="1.3.3", org.xml.sax -Export-Package: org.eclipse.equinox.internal.p2.core;x-friends:="org.eclipse.equinox.p2.metadata.generator", +Export-Package: org.eclipse.equinox.internal.p2.core;x-friends:="org.eclipse.equinox.p2.metadata.generator,org.eclipse.equinox.p2.director.app", org.eclipse.equinox.internal.p2.core.helpers; x-friends:="org.eclipse.equinox.p2.director, org.eclipse.equinox.p2.artifact.processors, #P org.eclipse.equinox.p2.director.app Index: src/org/eclipse/equinox/internal/p2/director/app/Application.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java,v retrieving revision 1.28 diff -u -r1.28 Application.java --- src/org/eclipse/equinox/internal/p2/director/app/Application.java 14 Apr 2008 01:02:04 -0000 1.28 +++ src/org/eclipse/equinox/internal/p2/director/app/Application.java 21 Apr 2008 09:52:35 -0000 @@ -16,20 +16,44 @@ import org.eclipse.core.runtime.*; import org.eclipse.equinox.app.IApplication; import org.eclipse.equinox.app.IApplicationContext; +import org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRepositoryManager; import org.eclipse.equinox.internal.p2.console.ProvisioningHelper; +import org.eclipse.equinox.internal.p2.core.ProvisioningEventBus; import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; +import org.eclipse.equinox.internal.p2.director.SimpleDirector; +import org.eclipse.equinox.internal.p2.director.SimplePlanner; +import org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager; +import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; +import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus; import org.eclipse.equinox.internal.provisional.p2.director.*; import org.eclipse.equinox.internal.provisional.p2.engine.*; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery; +import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.query.Collector; import org.eclipse.osgi.service.resolver.VersionRange; import org.eclipse.osgi.util.NLS; +import org.osgi.framework.ServiceRegistration; import org.osgi.framework.Version; public class Application implements IApplication { private static final Integer EXIT_ERROR = new Integer(13); + static private String FLAVOR_DEFAULT = "tooling"; //$NON-NLS-1$ + + public static final int COMMAND_INSTALL = 0; + public static final int COMMAND_UNINSTALL = 1; + public static final int COMMAND_LIST = 2; + + public static final String[] COMMAND_NAMES = {"-installIU", "-uninstallIU", "-list"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + + private ServiceRegistration directorRegistration; + private ServiceRegistration plannerRegistration; + private ServiceRegistration engineRegistration; + private ServiceRegistration busRegistration; + private ServiceRegistration metadataManagerRegistration; + private ServiceRegistration artifactManagerRegistration; + private IProvisioningEventBus bus; private Path destination; private URL artifactRepositoryLocation; @@ -39,7 +63,6 @@ private String flavor; private String profileId; private String profileProperties; // a comma-separated list of property pairs "tag=value" - private boolean install; private String bundlePool = null; private String nl; private String os; @@ -48,8 +71,176 @@ private boolean roamingProfile = false; private IPlanner planner; private IEngine engine; + private int command = -1; + + public void processArguments(String[] args) throws Exception { + if (args == null) + return; + for (int i = 0; i < args.length; i++) { + + String opt = args[i]; + if (opt.equals("-roaming")) { //$NON-NLS-1$ + roamingProfile = true; + } + + if (opt.equals(COMMAND_NAMES[COMMAND_LIST])) { + if (command != -1) + ambigousCommand(COMMAND_LIST, command); + command = COMMAND_LIST; + } + + // check for args without parameters (i.e., a flag arg) + + // check for args with parameters. If we are at the last + // argument or + // if the next one + // has a '-' as the first character, then we can't have an arg + // with + // a parm so continue. + if (i == args.length - 1 || args[i + 1].startsWith("-")) //$NON-NLS-1$ + continue; + + String arg = args[++i]; + + if (opt.equalsIgnoreCase("-profile")) //$NON-NLS-1$ + profileId = arg; + + if (opt.equalsIgnoreCase("-profileProperties") || opt.equalsIgnoreCase("-props")) //$NON-NLS-1$ //$NON-NLS-2$ + profileProperties = arg; + + // we create a path object here to handle ../ entries in the middle of paths + if (opt.equalsIgnoreCase("-destination") || opt.equalsIgnoreCase("-dest")) //$NON-NLS-1$ //$NON-NLS-2$ + destination = new Path(arg); + + // we create a path object here to handle ../ entries in the middle of paths + if (opt.equalsIgnoreCase("-bundlepool") || opt.equalsIgnoreCase("-bp")) //$NON-NLS-1$ //$NON-NLS-2$ + bundlePool = new Path(arg).toOSString(); + + if (opt.equalsIgnoreCase("-metadataRepository") || opt.equalsIgnoreCase("-mr")) //$NON-NLS-1$ //$NON-NLS-2$ + metadataRepositoryLocation = new URL(arg); + + if (opt.equalsIgnoreCase("-artifactRepository") || opt.equalsIgnoreCase("-ar")) //$NON-NLS-1$ //$NON-NLS-2$ + artifactRepositoryLocation = new URL(arg); + + if (opt.equalsIgnoreCase("-flavor")) //$NON-NLS-1$ + flavor = arg; + + if (opt.equalsIgnoreCase(COMMAND_NAMES[COMMAND_INSTALL])) { + if (command != -1) + ambigousCommand(COMMAND_INSTALL, command); + root = arg; + command = COMMAND_INSTALL; + } + + if (opt.equalsIgnoreCase("-version")) { //$NON-NLS-1$ + version = new Version(arg); + } + + if (opt.equalsIgnoreCase(COMMAND_NAMES[COMMAND_UNINSTALL])) { + if (command != -1) + ambigousCommand(COMMAND_UNINSTALL, command); + root = arg; + command = COMMAND_UNINSTALL; + } + + if (opt.equalsIgnoreCase("-p2.os")) { //$NON-NLS-1$ + os = arg; + } + if (opt.equalsIgnoreCase("-p2.ws")) { //$NON-NLS-1$ + ws = arg; + } + if (opt.equalsIgnoreCase("-p2.nl")) { //$NON-NLS-1$ + nl = arg; + } + if (opt.equalsIgnoreCase("-p2.arch")) { //$NON-NLS-1$ + arch = arg; + } + } + + } + + public Object run(String[] args) throws Exception { + long time = -System.currentTimeMillis(); + initializeServices(); + processArguments(args); + + IStatus operationStatus = Status.OK_STATUS; + InstallableUnitQuery query; + Collector roots; + switch (command) { + case COMMAND_INSTALL : + case COMMAND_UNINSTALL : + IProfile profile = initializeProfile(); + initializeRepositories(); + + query = new InstallableUnitQuery(root, version == null ? VersionRange.emptyRange : new VersionRange(version, true, version, true)); + roots = ProvisioningHelper.getInstallableUnits(null, query, new NullProgressMonitor()); + if (roots.size() <= 0) + roots = profile.query(query, roots, new NullProgressMonitor()); + if (roots.size() <= 0) { + LogHelper.log(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.Missing_IU, root))); + System.out.println(NLS.bind(Messages.Missing_IU, root)); + return EXIT_ERROR; + } + if (!updateRoamingProperties(profile).isOK()) { + LogHelper.log(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.Cant_change_roaming, profile.getProfileId()))); + System.out.println(NLS.bind(Messages.Cant_change_roaming, profile.getProfileId())); + return EXIT_ERROR; + } + ProvisioningContext context = new ProvisioningContext(); + ProfileChangeRequest request = buildProvisioningRequest(profile, roots, command == COMMAND_INSTALL); + printRequest(request); + operationStatus = planAndExecute(profile, context, request); + break; + case COMMAND_LIST : + query = new InstallableUnitQuery(null, VersionRange.emptyRange); + if (metadataRepositoryLocation == null) + missingArgument("metadataRepository"); //$NON-NLS-1$ + roots = ProvisioningHelper.getInstallableUnits(metadataRepositoryLocation, query, new NullProgressMonitor()); + + Iterator unitIterator = roots.iterator(); + while (unitIterator.hasNext()) { + IInstallableUnit iu = (IInstallableUnit) unitIterator.next(); + System.out.println(iu.getId()); + } + break; + } + + time += System.currentTimeMillis(); + if (operationStatus.isOK()) + System.out.println(NLS.bind(Messages.Operation_complete, new Long(time))); + else { + System.out.println(Messages.Operation_failed); + LogHelper.log(operationStatus); + return EXIT_ERROR; + } + return IApplication.EXIT_OK; + } + + public Object start(IApplicationContext context) throws Exception { + registerEventBus(); + registerEngine(); + registerPlanner(); + registerDirector(); + registerArtifactRepoManager(); + registerMetadataRepoManager(); + return run((String[]) context.getArguments().get("application.args")); //$NON-NLS-1$ + } + + public void stop() { + unregisterMetadataManager(); + unregisterArtifactManager(); + unregisterDirector(); + unregisterPlanner(); + unregisterEngine(); + unregisterEventBus(); + } + + private void ambigousCommand(int cmd1, int cmd2) throws CoreException { + throw new CoreException(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.Ambigous_Command, new Object[] {COMMAND_NAMES[cmd1], COMMAND_NAMES[cmd2]}))); + } - private ProfileChangeRequest buildProvisioningRequest(IProfile profile, Collector roots) { + private ProfileChangeRequest buildProvisioningRequest(IProfile profile, Collector roots, boolean install) { ProfileChangeRequest request = new ProfileChangeRequest(profile); markRoots(request, roots); if (install) { @@ -75,11 +266,16 @@ return toString(values); } - private IProfile initializeProfile() { + private IProfile initializeProfile() throws CoreException { if (profileId == null) profileId = IProfileRegistry.SELF; IProfile profile = ProvisioningHelper.getProfile(profileId); if (profile == null) { + if (destination == null) + missingArgument("destination"); //$NON-NLS-1$ + if (flavor == null) + flavor = System.getProperty("eclipse.p2.configurationFlavor", FLAVOR_DEFAULT); //$NON-NLS-1$ + Properties props = new Properties(); props.setProperty(IProfile.PROP_INSTALL_FOLDER, destination.toOSString()); props.setProperty(IProfile.PROP_FLAVOR, flavor); @@ -105,7 +301,11 @@ return profile; } - private void initializeRepositories() { + private void initializeRepositories() throws CoreException { + if (artifactRepositoryLocation == null) + missingArgument("artifactRepository"); //$NON-NLS-1$ + if (metadataRepositoryLocation == null) + missingArgument("metadataRepository"); //$NON-NLS-1$ ProvisioningHelper.addArtifactRepository(artifactRepositoryLocation); ProvisioningHelper.addMetadataRepository(metadataRepositoryLocation); } @@ -130,6 +330,10 @@ } } + private void missingArgument(String argumentName) throws CoreException { + throw new CoreException(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.Missing_Required_Argument, argumentName))); + } + private IStatus planAndExecute(IProfile profile, ProvisioningContext context, ProfileChangeRequest request) { ProvisioningPlan result; IStatus operationStatus; @@ -153,80 +357,6 @@ } } - public void processArguments(String[] args) throws Exception { - if (args == null) - return; - for (int i = 0; i < args.length; i++) { - - if (args[i].equals("-roaming")) { //$NON-NLS-1$ - roamingProfile = true; - } - - // check for args without parameters (i.e., a flag arg) - - // check for args with parameters. If we are at the last - // argument or - // if the next one - // has a '-' as the first character, then we can't have an arg - // with - // a parm so continue. - if (i == args.length - 1 || args[i + 1].startsWith("-")) //$NON-NLS-1$ - continue; - - String arg = args[++i]; - - if (args[i - 1].equalsIgnoreCase("-profile")) //$NON-NLS-1$ - profileId = arg; - - if (args[i - 1].equalsIgnoreCase("-profileProperties") || args[i - 1].equalsIgnoreCase("-props")) //$NON-NLS-1$ //$NON-NLS-2$ - profileProperties = arg; - - // we create a path object here to handle ../ entries in the middle of paths - if (args[i - 1].equalsIgnoreCase("-destination") || args[i - 1].equalsIgnoreCase("-dest")) //$NON-NLS-1$ //$NON-NLS-2$ - destination = new Path(arg); - - // we create a path object here to handle ../ entries in the middle of paths - if (args[i - 1].equalsIgnoreCase("-bundlepool") || args[i - 1].equalsIgnoreCase("-bp")) //$NON-NLS-1$ //$NON-NLS-2$ - bundlePool = new Path(arg).toOSString(); - - if (args[i - 1].equalsIgnoreCase("-metadataRepository") || args[i - 1].equalsIgnoreCase("-mr")) //$NON-NLS-1$ //$NON-NLS-2$ - metadataRepositoryLocation = new URL(arg); - - if (args[i - 1].equalsIgnoreCase("-artifactRepository") || args[i - 1].equalsIgnoreCase("-ar")) //$NON-NLS-1$ //$NON-NLS-2$ - artifactRepositoryLocation = new URL(arg); - - if (args[i - 1].equalsIgnoreCase("-flavor")) //$NON-NLS-1$ - flavor = arg; - - if (args[i - 1].equalsIgnoreCase("-installIU")) { //$NON-NLS-1$ - root = arg; - install = true; - } - - if (args[i - 1].equalsIgnoreCase("-version")) { //$NON-NLS-1$ - version = new Version(arg); - } - - if (args[i - 1].equalsIgnoreCase("-uninstallIU")) { //$NON-NLS-1$ - root = arg; - install = false; - } - - if (args[i - 1].equalsIgnoreCase("-p2.os")) { //$NON-NLS-1$ - os = arg; - } - if (args[i - 1].equalsIgnoreCase("-p2.ws")) { //$NON-NLS-1$ - ws = arg; - } - if (args[i - 1].equalsIgnoreCase("-p2.nl")) { //$NON-NLS-1$ - nl = arg; - } - if (args[i - 1].equalsIgnoreCase("-p2.arch")) { //$NON-NLS-1$ - arch = arg; - } - } - } - /** * @param pairs a comma separated list of tag=value pairs * @param properties the collection into which the pairs are put @@ -246,49 +376,37 @@ } } - public Object run(String[] args) throws Exception { - long time = -System.currentTimeMillis(); - initializeServices(); - processArguments(args); - IProfile profile = initializeProfile(); - initializeRepositories(); + private void registerArtifactRepoManager() { + if (ServiceHelper.getService(Activator.getContext(), IArtifactRepositoryManager.class.getName()) == null) + artifactManagerRegistration = Activator.getContext().registerService(IArtifactRepositoryManager.class.getName(), new ArtifactRepositoryManager(), null); + } - InstallableUnitQuery query = new InstallableUnitQuery(root, version == null ? VersionRange.emptyRange : new VersionRange(version, true, version, true)); - Collector roots = ProvisioningHelper.getInstallableUnits(null, query, new NullProgressMonitor()); - if (roots.size() <= 0) - roots = profile.query(query, roots, new NullProgressMonitor()); - if (roots.size() <= 0) { - LogHelper.log(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.Missing_IU, root))); - System.out.println(NLS.bind(Messages.Missing_IU, root)); - return EXIT_ERROR; - } - if (!updateRoamingProperties(profile).isOK()) { - LogHelper.log(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.Cant_change_roaming, profile.getProfileId()))); - System.out.println(NLS.bind(Messages.Cant_change_roaming, profile.getProfileId())); - return EXIT_ERROR; - } - ProvisioningContext context = new ProvisioningContext(); - ProfileChangeRequest request = buildProvisioningRequest(profile, roots); - printRequest(request); - IStatus operationStatus = planAndExecute(profile, context, request); + private void registerDirector() { + if (ServiceHelper.getService(Activator.getContext(), IDirector.class.getName()) == null) + directorRegistration = Activator.getContext().registerService(IDirector.class.getName(), new SimpleDirector(), null); + } - time += System.currentTimeMillis(); - if (operationStatus.isOK()) - System.out.println(NLS.bind(Messages.Operation_complete, new Long(time))); - else { - System.out.println(Messages.Operation_failed); - LogHelper.log(operationStatus); - return EXIT_ERROR; + private void registerEngine() { + if (ServiceHelper.getService(Activator.getContext(), IEngine.class.getName()) == null) + engineRegistration = Activator.getContext().registerService(IEngine.class.getName(), new Engine(bus), null); + } + + private void registerEventBus() { + bus = (IProvisioningEventBus) ServiceHelper.getService(Activator.getContext(), IProvisioningEventBus.SERVICE_NAME); + if (bus == null) { + bus = new ProvisioningEventBus(); + busRegistration = Activator.getContext().registerService(IProvisioningEventBus.SERVICE_NAME, bus, null); } - return IApplication.EXIT_OK; } - public Object start(IApplicationContext context) throws Exception { - return run((String[]) context.getArguments().get("application.args")); //$NON-NLS-1$ + private void registerMetadataRepoManager() { + if (ServiceHelper.getService(Activator.getContext(), IMetadataRepositoryManager.class.getName()) == null) + metadataManagerRegistration = Activator.getContext().registerService(IMetadataRepositoryManager.class.getName(), new MetadataRepositoryManager(), null); } - public void stop() { - //nothing to do + private void registerPlanner() { + if (ServiceHelper.getService(Activator.getContext(), IPlanner.class.getName()) == null) + plannerRegistration = Activator.getContext().registerService(IPlanner.class.getName(), new SimplePlanner(), null); } private String toString(Properties context) { @@ -304,6 +422,49 @@ return result.toString(); } + private void unregisterArtifactManager() { + if (artifactManagerRegistration != null) { + artifactManagerRegistration.unregister(); + artifactManagerRegistration = null; + } + } + + private void unregisterDirector() { + if (directorRegistration != null) { + directorRegistration.unregister(); + directorRegistration = null; + } + } + + private void unregisterEngine() { + if (engineRegistration != null) { + engineRegistration.unregister(); + engineRegistration = null; + } + } + + private void unregisterEventBus() { + if (busRegistration != null) { + busRegistration.unregister(); + busRegistration = null; + bus = null; + } + } + + private void unregisterMetadataManager() { + if (metadataManagerRegistration != null) { + metadataManagerRegistration.unregister(); + metadataManagerRegistration = null; + } + } + + private void unregisterPlanner() { + if (plannerRegistration != null) { + plannerRegistration.unregister(); + plannerRegistration = null; + } + } + private IStatus updateRoamingProperties(IProfile profile) { ProfileChangeRequest request = new ProfileChangeRequest(profile); if (!Boolean.valueOf(profile.getProperty(IProfile.PROP_ROAMING)).booleanValue()) Index: src/org/eclipse/equinox/internal/p2/director/app/Messages.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Messages.java,v retrieving revision 1.3 diff -u -r1.3 Messages.java --- src/org/eclipse/equinox/internal/p2/director/app/Messages.java 14 Apr 2008 00:36:47 -0000 1.3 +++ src/org/eclipse/equinox/internal/p2/director/app/Messages.java 21 Apr 2008 09:52:35 -0000 @@ -24,6 +24,10 @@ public static String Missing_IU; public static String Missing_planner; + public static String Listing; + public static String Ambigous_Command; + public static String Missing_Required_Argument; + public static String Installing; public static String Uninstalling; static { Index: src/org/eclipse/equinox/internal/p2/director/app/messages.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/messages.properties,v retrieving revision 1.3 diff -u -r1.3 messages.properties --- src/org/eclipse/equinox/internal/p2/director/app/messages.properties 14 Apr 2008 00:36:47 -0000 1.3 +++ src/org/eclipse/equinox/internal/p2/director/app/messages.properties 21 Apr 2008 09:52:35 -0000 @@ -19,6 +19,8 @@ Missing_Engine=Engine could not be loaded. Missing_IU=The installable unit {0} has not been found. Missing_planner=Planner could not be loaded. - +Missing_Required_Argument=Missing required argument -{0}. +Ambigous_Command=Cannot execute both {0} and {1} in one invocation +Listing=Listing Installable Units from {0} Installing=Installing {0} {1}. Uninstalling=Uninstaling {0} {1}. \ No newline at end of file Index: src_ant/org/eclipse/equinox/p2/director/app/ant/DirectorTask.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director.app/src_ant/org/eclipse/equinox/p2/director/app/ant/DirectorTask.java,v retrieving revision 1.1 diff -u -r1.1 DirectorTask.java --- src_ant/org/eclipse/equinox/p2/director/app/ant/DirectorTask.java 8 Nov 2007 17:54:09 -0000 1.1 +++ src_ant/org/eclipse/equinox/p2/director/app/ant/DirectorTask.java 21 Apr 2008 09:52:35 -0000 @@ -27,6 +27,7 @@ public class DirectorTask extends Task { boolean roaming; + boolean list; String profile, flavor, os, ws, nl, arch, installIU, uninstallIU; File destination, bundlePool; URL metadataRepository, artifactRepository; @@ -45,65 +46,6 @@ } } - private String[] getArguments() { - List result = new ArrayList(); - if (roaming) - result.add("-roaming"); - if (profile != null) { - result.add("-profile"); - result.add(profile); - } - if (destination != null) { - result.add("-destination"); - result.add(destination.getAbsolutePath()); - } - if (bundlePool != null) { - result.add("-bundlePool"); - result.add(bundlePool.getAbsolutePath()); - } - if (metadataRepository != null) { - result.add("-metadataRepository"); - result.add(metadataRepository.toExternalForm()); - } - if (artifactRepository != null) { - result.add("-artifactRepository"); - result.add(artifactRepository.toExternalForm()); - } - if (flavor != null) { - result.add("-flavor"); - result.add(flavor); - } - if (version != null) { - result.add("-version"); - result.add(version.toString()); - } - if (os != null) { - result.add("-p2.os"); - result.add(os); - } - if (ws != null) { - result.add("-p2.ws"); - result.add(ws); - } - if (arch != null) { - result.add("-p2.arch"); - result.add(arch); - } - if (nl != null) { - result.add("-p2.nl"); - result.add(nl); - } - if (installIU != null) { - result.add("-installIU"); - result.add(installIU); - } - if (uninstallIU != null) { - result.add("-uninstallIU"); - result.add(uninstallIU); - } - return (String[]) result.toArray(new String[result.size()]); - } - public void setArch(String value) { arch = value; } @@ -132,6 +74,10 @@ installIU = value; } + public void setList(String value) { + list = Boolean.valueOf(value).booleanValue(); + } + public void setMetadataRepository(String value) { try { metadataRepository = new URL(value); @@ -167,4 +113,66 @@ public void setWs(String value) { ws = value; } + + private String[] getArguments() { + List result = new ArrayList(); + if (roaming) + result.add("-roaming"); + if (profile != null) { + result.add("-profile"); + result.add(profile); + } + if (destination != null) { + result.add("-destination"); + result.add(destination.getAbsolutePath()); + } + if (bundlePool != null) { + result.add("-bundlePool"); + result.add(bundlePool.getAbsolutePath()); + } + if (metadataRepository != null) { + result.add("-metadataRepository"); + result.add(metadataRepository.toExternalForm()); + } + if (artifactRepository != null) { + result.add("-artifactRepository"); + result.add(artifactRepository.toExternalForm()); + } + if (flavor != null) { + result.add("-flavor"); + result.add(flavor); + } + if (version != null) { + result.add("-version"); + result.add(version.toString()); + } + if (os != null) { + result.add("-p2.os"); + result.add(os); + } + if (ws != null) { + result.add("-p2.ws"); + result.add(ws); + } + if (arch != null) { + result.add("-p2.arch"); + result.add(arch); + } + if (nl != null) { + result.add("-p2.nl"); + result.add(nl); + } + if (list) { + result.add(Application.COMMAND_NAMES[Application.COMMAND_LIST]); + } + if (installIU != null) { + result.add(Application.COMMAND_NAMES[Application.COMMAND_INSTALL]); + result.add(installIU); + } + if (uninstallIU != null) { + result.add(Application.COMMAND_NAMES[Application.COMMAND_UNINSTALL]); + result.add(uninstallIU); + } + return (String[]) result.toArray(new String[result.size()]); + } } Index: META-INF/MANIFEST.MF =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF,v retrieving revision 1.10 diff -u -r1.10 MANIFEST.MF --- META-INF/MANIFEST.MF 14 Apr 2008 00:36:47 -0000 1.10 +++ META-INF/MANIFEST.MF 21 Apr 2008 09:52:34 -0000 @@ -6,9 +6,12 @@ Bundle-Localization: plugin Bundle-Version: 0.1.0.qualifier Import-Package: org.eclipse.equinox.app, + org.eclipse.equinox.internal.p2.artifact.repository, org.eclipse.equinox.internal.p2.console, org.eclipse.equinox.internal.p2.core.helpers, + org.eclipse.equinox.internal.p2.director, org.eclipse.equinox.internal.p2.engine, + org.eclipse.equinox.internal.p2.metadata.repository, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.core.location, org.eclipse.equinox.internal.provisional.p2.director, @@ -22,9 +25,10 @@ org.eclipse.osgi.service.resolver;version="1.1.0", org.osgi.framework Bundle-Activator: org.eclipse.equinox.internal.p2.director.app.Activator -Eclipse-LazyStart: true +Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0, J2SE-1.4 -Require-Bundle: org.eclipse.equinox.common, +Require-Bundle: org.eclipse.equinox.p2.core;bundle-version="0.1.0", + org.eclipse.equinox.common, org.eclipse.osgi;bundle-version="3.4.0" Export-Package: org.eclipse.equinox.internal.p2.director.app;x-internal:=true #P org.eclipse.equinox.p2.metadata.repository Index: META-INF/MANIFEST.MF =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF,v retrieving revision 1.14 diff -u -r1.14 MANIFEST.MF --- META-INF/MANIFEST.MF 9 Apr 2008 18:57:43 -0000 1.14 +++ META-INF/MANIFEST.MF 21 Apr 2008 09:52:36 -0000 @@ -5,7 +5,7 @@ Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-Version: 0.1.0.qualifier -Export-Package: org.eclipse.equinox.internal.p2.metadata.repository;x-friends:="org.eclipse.equinox.p2.metadata.generator,org.eclipse.equinox.p2.engine", +Export-Package: org.eclipse.equinox.internal.p2.metadata.repository;x-friends:="org.eclipse.equinox.p2.metadata.generator,org.eclipse.equinox.p2.engine,org.eclipse.equinox.p2.director.app", org.eclipse.equinox.internal.p2.metadata.repository.io;x-friends:="org.eclipse.equinox.p2.engine", org.eclipse.equinox.internal.provisional.p2.metadata.repository, org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository