Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 101595 Details for
Bug 219866
[prov] IU to set launcher name in the product IU
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
219866.txt (text/plain), 6.93 KB, created by
Andrew Niefer
on 2008-05-22 15:00:08 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Andrew Niefer
Created:
2008-05-22 15:00:08 EDT
Size:
6.93 KB
patch
obsolete
>### 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.52 >diff -u -r1.52 Generator.java >--- src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java 21 May 2008 23:37:02 -0000 1.52 >+++ src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java 22 May 2008 18:56:10 -0000 >@@ -750,6 +750,8 @@ > cu.setTouchpointType(MetadataGeneratorHelper.TOUCHPOINT_NATIVE); > Map touchpointData = new HashMap(); > String configurationData = "unzip(source:@artifact, target:${installFolder});"; //$NON-NLS-1$ >+ >+ IInstallableUnit launcherNameIU = null; > if (Constants.OS_MACOSX.equals(os)) { > File[] appFolders = root.listFiles(new FilenameFilter() { > public boolean accept(File dir, String name) { >@@ -763,7 +765,7 @@ > for (int j = 0; j < launcherFiles.length; j++) { > configurationData += " chmod(targetDir:${installFolder}/" + appFolders[i].getName() + "/Contents/MacOS/, targetFile:" + launcherFiles[j].getName() + ", permissions:755);"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ > if (new Path(launcherFiles[j].getName()).getFileExtension() == null) >- MetadataGeneratorHelper.generateLauncherSetter(launcherFiles[j].getName(), launcherId, launcherVersion, os, ws, arch, result.rootIUs); >+ launcherNameIU = MetadataGeneratorHelper.generateLauncherSetter(launcherFiles[j].getName(), launcherId, launcherVersion, os, ws, arch, result.rootIUs); > } > } > } >@@ -773,9 +775,21 @@ > for (int i = 0; i < launcherFiles.length; i++) { > configurationData += " chmod(targetDir:${installFolder}, targetFile:" + launcherFiles[i].getName() + ", permissions:755);"; //$NON-NLS-1$ //$NON-NLS-2$ > if (new Path(launcherFiles[i].getName()).getFileExtension() == null) >- MetadataGeneratorHelper.generateLauncherSetter(launcherFiles[i].getName(), launcherId, launcherVersion, os, ws, arch, result.rootIUs); >+ launcherNameIU = MetadataGeneratorHelper.generateLauncherSetter(launcherFiles[i].getName(), launcherId, launcherVersion, os, ws, arch, result.rootIUs); >+ } >+ } >+ >+ if (launcherNameIU == null) { >+ File executableLocation = info.getExecutableLocation(); >+ if (executableLocation != null) { >+ if (!executableLocation.exists() && Constants.OS_WIN32.equals(os) && !executableLocation.getName().endsWith(".exe")) //$NON-NLS-1$ >+ executableLocation = new File(executableLocation.getParentFile(), executableLocation.getName() + ".exe"); //$NON-NLS-1$ >+ >+ if (executableLocation.exists()) >+ launcherNameIU = MetadataGeneratorHelper.generateLauncherSetter(executableLocation.getName(), launcherId, launcherVersion, os, ws, arch, result.rootIUs); > } > } >+ > touchpointData.put("install", configurationData); //$NON-NLS-1$ > String unConfigurationData = "cleanupzip(source:@artifact, target:${installFolder});"; //$NON-NLS-1$ > touchpointData.put("uninstall", unConfigurationData); //$NON-NLS-1$ >@@ -785,9 +799,13 @@ > //The Product Query will need to include the launcher CU fragments as a workaround to bug 218890 > if (result.configurationIUs.containsKey(launcherIdPrefix)) { > ((Set) result.configurationIUs.get(launcherIdPrefix)).add(unit); >+ if (launcherNameIU != null) >+ ((Set) result.configurationIUs.get(launcherIdPrefix)).add(launcherNameIU); > } else { > Set set = new HashSet(); > set.add(unit); >+ if (launcherNameIU != null) >+ set.add(launcherNameIU); > result.configurationIUs.put(launcherIdPrefix, set); > } > >Index: src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/MetadataGeneratorHelper.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/MetadataGeneratorHelper.java,v >retrieving revision 1.49 >diff -u -r1.49 MetadataGeneratorHelper.java >--- src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/MetadataGeneratorHelper.java 12 May 2008 18:05:43 -0000 1.49 >+++ src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/MetadataGeneratorHelper.java 22 May 2008 18:56:11 -0000 >@@ -772,7 +772,7 @@ > // TODO: shouldn't the filter for the group be constructed from os, ws, arch, nl > // of the feature? > // iu.setFilter(filter); >- >+ > // Create set of provided capabilities > ArrayList providedCapabilities = new ArrayList(); > providedCapabilities.add(createSelfCapability(id, version)); >@@ -923,23 +923,27 @@ > return createArtifactDescriptor(key, launcher, false, true); > } > >- public static void generateLauncherSetter(String launcherName, String iuId, Version version, String os, String ws, String arch, Set result) { >+ public static IInstallableUnit generateLauncherSetter(String launcherName, String iuId, Version version, String os, String ws, String arch, Set result) { > InstallableUnitDescription iud = new MetadataFactory.InstallableUnitDescription(); > iud.setId(iuId + '.' + launcherName); > iud.setVersion(version); > iud.setTouchpointType(MetadataGeneratorHelper.TOUCHPOINT_OSGI); >+ iud.setCapabilities(new ProvidedCapability[] {createSelfCapability(iuId + '.' + launcherName, version)}); > > if (os != null || ws != null || arch != null) { >- String filterOs = os != null ? "(os=" + os + ")" : ""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >- String filterWs = ws != null ? "(ws=" + ws + ")" : ""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >- String filterArch = arch != null ? "(arch=" + arch + ")" : ""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ String filterOs = os != null ? "(osgi.os=" + os + ")" : ""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ String filterWs = ws != null ? "(osgi.ws=" + ws + ")" : ""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ String filterArch = arch != null ? "(osgi.arch=" + arch + ")" : ""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ > iud.setFilter("(& " + filterOs + filterWs + filterArch + ")"); //$NON-NLS-1$ //$NON-NLS-2$ > } > Map touchpointData = new HashMap(); > touchpointData.put("configure", "setLauncherName(name:" + launcherName + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ > touchpointData.put("unconfigure", "setLauncherName()"); //$NON-NLS-1$ //$NON-NLS-2$ > iud.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); >- result.add(MetadataFactory.createInstallableUnit(iud)); >+ >+ IInstallableUnit iu = MetadataFactory.createInstallableUnit(iud); >+ result.add(iu); >+ return iu; > } > > public static ProvidedCapability createSelfCapability(String installableUnitId, Version installableUnitVersion) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 219866
:
101595
|
101650