View | Details | Raw Unified | Return to bug 47458
Collapse All | Expand All

(-)src/org/eclipse/update/configurator/ConfigurationActivator.java (-3 / +38 lines)
Lines 10-19 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.update.configurator;
11
package org.eclipse.update.configurator;
12
12
13
import java.io.DataInputStream;
14
import java.io.DataOutputStream;
13
import java.io.File;
15
import java.io.File;
16
import java.io.FileInputStream;
17
import java.io.FileNotFoundException;
18
import java.io.FileOutputStream;
14
import java.io.IOException;
19
import java.io.IOException;
20
import java.io.InputStream;
15
import java.net.MalformedURLException;
21
import java.net.MalformedURLException;
16
import java.net.URL;
22
import java.net.URL;
23
import java.sql.Timestamp;
17
import java.util.*;
24
import java.util.*;
18
import org.eclipse.core.runtime.*;
25
import org.eclipse.core.runtime.*;
19
import org.eclipse.osgi.service.environment.DebugOptions;
26
import org.eclipse.osgi.service.environment.DebugOptions;
Lines 40-51 Link Here
40
	private String[] allArgs;
47
	private String[] allArgs;
41
48
42
	// location used to put the generated manfests
49
	// location used to put the generated manfests
43
	private String cacheLocation = (String) System.getProperties().get("osgi.manifest.cache"); //PASCAL Need to set this value somewhere (probably from boot)
50
	private String cacheLocation = (String) System.getProperties().get("osgi.manifest.cache");
44
	private IPluginConverter converter;
51
	private IPluginConverter converter;
45
	private Set ignore;
52
	private Set ignore;
46
	private BundleListener reconcilerListener;
53
	private BundleListener reconcilerListener;
47
	private IPlatform platform;
54
	private IPlatform platform;
48
	private PlatformConfiguration configuration;
55
	private PlatformConfiguration configuration;
56
	
57
	//Need to store that because it is not provided by the platformConfiguration
58
	private long lastTimeStamp;
49
59
50
	public void start(BundleContext ctx) throws Exception {
60
	public void start(BundleContext ctx) throws Exception {
51
		context = ctx;
61
		context = ctx;
Lines 58-64 Link Here
58
		if("org.eclipse.ui.workbench".equals(System.getProperties().get("eclipse.application"))) { //$NON-NLS-1$ //$NON-NLS-2$
68
		if("org.eclipse.ui.workbench".equals(System.getProperties().get("eclipse.application"))) { //$NON-NLS-1$ //$NON-NLS-2$
59
			System.setProperty("eclipse.application", "org.eclipse.ui.ide.workbench"); //$NON-NLS-1$ //$NON-NLS-2$
69
			System.setProperty("eclipse.application", "org.eclipse.ui.ide.workbench"); //$NON-NLS-1$ //$NON-NLS-2$
60
		}
70
		}
61
		if (!(application.equals(PlatformConfiguration.RECONCILER_APP) || System.getProperties().get("osgi.dev") != null))
71
	
72
		if (lastTimeStamp==configuration.getChangeStamp() && !(application.equals(PlatformConfiguration.RECONCILER_APP) || System.getProperties().get("osgi.dev") != null))
62
			if (System.getProperty("eclipse.application") == null) {
73
			if (System.getProperty("eclipse.application") == null) {
63
				System.setProperty("eclipse.application", application);
74
				System.setProperty("eclipse.application", application);
64
				return;
75
				return;
Lines 77-82 Link Here
77
		URL installURL = platform.getInstallURL();
88
		URL installURL = platform.getInstallURL();
78
		configurationFactorySR = context.registerService(IPlatformConfigurationFactory.class.getName(), new PlatformConfigurationFactory(), null);
89
		configurationFactorySR = context.registerService(IPlatformConfigurationFactory.class.getName(), new PlatformConfigurationFactory(), null);
79
		configuration = getPlatformConfiguration(allArgs, metaPath, installURL);
90
		configuration = getPlatformConfiguration(allArgs, metaPath, installURL);
91
		
92
		String configArea = (String) System.getProperty("osgi.configuration.area");
93
		try {
94
			DataInputStream stream = new DataInputStream(new FileInputStream(configArea + "/last.config.stamp"));
95
			lastTimeStamp = stream.readLong();
96
		} catch (FileNotFoundException e) {
97
			lastTimeStamp = configuration.getChangeStamp() - 1;
98
		} catch (IOException e) {
99
			lastTimeStamp = configuration.getChangeStamp() - 1;
100
		}
80
	}
101
	}
81
102
82
	private void computeIgnoredBundles() {
103
	private void computeIgnoredBundles() {
Lines 118-126 Link Here
118
		releasePlatform();
139
		releasePlatform();
119
		converter = null;
140
		converter = null;
120
		releaseConverter();
141
		releaseConverter();
142
		writePlatformConfigurationTimeStamp();
121
		configurationFactorySR.unregister();
143
		configurationFactorySR.unregister();
122
	}
144
	}
123
145
146
	private void writePlatformConfigurationTimeStamp() {
147
		String configArea = (String) System.getProperty("osgi.configuration.area");
148
		try {
149
			DataOutputStream stream = new DataOutputStream(new FileOutputStream(configArea + "/last.config.stamp"));
150
			stream.writeLong(configuration.getChangeStamp());
151
		} catch (FileNotFoundException e) {
152
			lastTimeStamp = configuration.getChangeStamp() - 1;
153
		} catch (IOException e) {
154
			lastTimeStamp = configuration.getChangeStamp() - 1;
155
		}
156
		
157
	}
158
124
	private void releasePlatform() {
159
	private void releasePlatform() {
125
		if (platformTracker == null)
160
		if (platformTracker == null)
126
			return;
161
			return;
Lines 266-272 Link Here
266
		if (generationLocation.exists())
301
		if (generationLocation.exists())
267
			return;
302
			return;
268
		if (!converter.convertManifest(pluginDir, generationLocation))
303
		if (!converter.convertManifest(pluginDir, generationLocation))
269
			System.out.println(pluginDir + " manifest generation failed");
304
			System.out.println(pluginDir + " manifest generation failed");	//TODO Need to log an error
270
	}
305
	}
271
	/*
306
	/*
272
	 * Derives a file name corresponding to a path:
307
	 * Derives a file name corresponding to a path:

Return to bug 47458