### Eclipse Workspace Patch 1.0 #P org.eclipse.equinox.p2.metadata.generator Index: src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java,v retrieving revision 1.60 diff -u -r1.60 Generator.java --- src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java 9 Jul 2008 20:51:38 -0000 1.60 +++ src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java 23 Jul 2008 17:43:41 -0000 @@ -103,6 +103,7 @@ private static final String PRODUCT_CONFIG_SUFFIX = ".config"; //$NON-NLS-1$ private static final String PRODUCT_INI_SUFFIX = ".ini"; //$NON-NLS-1$ private static final String PRODUCT_LAUCHER_SUFFIX = ".launcher"; //$NON-NLS-1$ + private static final String CONFIG_ANY = "ANY"; //$NON-NLS-1$ static final String DEFAULT_BUNDLE_LOCALIZATION = "plugin"; //$NON-NLS-1$ @@ -140,6 +141,10 @@ public static String[] parseConfigSpec(String config) { String[] parsed = getArrayFromString(config, "_"); //$NON-NLS-1$ + for (int i = 0; i < parsed.length; i++) { + if (parsed[i].equals("*")) //$NON-NLS-1$ + parsed[i] = "ANY"; //$NON-NLS-1$ + } if (parsed.length > 3) { String[] adjusted = new String[] {parsed[0], parsed[1], parsed[2] + '_' + parsed[3]}; return adjusted; @@ -722,6 +727,9 @@ * ws/os/arch combination. */ private void generateExecutableIUs(String ws, String os, final String arch, String version, File root, GeneratorResult result, IArtifactRepository destination) { + if (root == null) + return; + //Create the IU InstallableUnitDescription iu = new MetadataFactory.InstallableUnitDescription(); iu.setSingleton(true); @@ -732,8 +740,11 @@ Version launcherVersion = new Version(version); iu.setVersion(launcherVersion); iu.setSingleton(true); - String filter = "(& (osgi.ws=" + ws + ") (osgi.os=" + os + ") (osgi.arch=" + arch + "))"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - iu.setFilter(filter); + String filter = null; + if (!ws.equals(CONFIG_ANY) && !os.equals(CONFIG_ANY) && !arch.equals(CONFIG_ANY)) { + filter = "(& (osgi.ws=" + ws + ") (osgi.os=" + os + ") (osgi.arch=" + arch + "))"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + iu.setFilter(filter); + } IArtifactKey key = MetadataGeneratorHelper.createLauncherArtifactKey(launcherId, launcherVersion); iu.setArtifacts(new IArtifactKey[] {key}); @@ -752,7 +763,8 @@ String configUnitId = info.getFlavor() + launcherId; cu.setId(configUnitId); cu.setVersion(launcherVersion); - cu.setFilter(filter); + if (filter != null) + cu.setFilter(filter); cu.setHost(new RequiredCapability[] {MetadataFactory.createRequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, launcherId, new VersionRange(launcherVersion, true, launcherVersion, true), null, false, false)}); cu.setProperty(IInstallableUnit.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); //TODO bug 218890, would like the fragment to provide the launcher capability as well, but can't right now. @@ -986,7 +998,12 @@ if (info.getLauncherConfig() != null) { String[] config = parseConfigSpec(info.getLauncherConfig()); String version = getProductVersion(); - generateExecutableIUs(config[1], config[0], config[2], version, executableLocation.getParentFile(), result, destination); + File root = null; + if (executableLocation != null) + root = executableLocation.getParentFile(); + else if (info instanceof EclipseInstallGeneratorInfoProvider) + root = ((EclipseInstallGeneratorInfoProvider) info).getBaseLocation(); + generateExecutableIUs(config[1], config[0], config[2], version, root, result, destination); generateProductIniCU(config[1], config[0], config[2], version, result); return; } Index: src_ant/org/eclipse/equinox/internal/p2/metadata/generator/ant/GeneratorTask.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.generator/src_ant/org/eclipse/equinox/internal/p2/metadata/generator/ant/GeneratorTask.java,v retrieving revision 1.8 diff -u -r1.8 GeneratorTask.java --- src_ant/org/eclipse/equinox/internal/p2/metadata/generator/ant/GeneratorTask.java 9 May 2008 18:23:02 -0000 1.8 +++ src_ant/org/eclipse/equinox/internal/p2/metadata/generator/ant/GeneratorTask.java 23 Jul 2008 17:43:41 -0000 @@ -173,12 +173,16 @@ } public void setRoot(String root) { + if (root == null || root.startsWith("${")) //$NON-NLS-1$ + return; if (provider == null) provider = new EclipseInstallGeneratorInfoProvider(); provider.setRootId(root); } public void setRootVersion(String rootVersion) { + if (rootVersion == null || rootVersion.startsWith("${")) //$NON-NLS-1$ + return; if (provider == null) provider = new EclipseInstallGeneratorInfoProvider(); provider.setRootVersion(rootVersion);