View | Details | Raw Unified | Return to bug 190533 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/update/internal/operations/BatchInstallOperation.java (-11 / +21 lines)
Lines 92-108 Link Here
92
				installCount++;
92
				installCount++;
93
			}
93
			}
94
			return SiteManager.getLocalSite().save();
94
			return SiteManager.getLocalSite().save();
95
		} catch (InstallAbortedException e) {
95
        } catch (InstallAbortedException e) {
96
			// saves the current configuration
96
            // saves the current configuration
97
			if (installCount > 0)
97
            if (installCount > 0) {
98
				SiteManager.getLocalSite().save();
98
                try {
99
			throw new InvocationTargetException(e);
99
                    SiteManager.getLocalSite().save();
100
		} catch (CoreException e) {
100
                } catch (CoreException ce) {
101
			// saves the current configuration
101
                    UpdateUtils.logException(ce);
102
			if (installCount > 0)
102
                }
103
				SiteManager.getLocalSite().save();
103
            }
104
			throw new InvocationTargetException(e);
104
            throw new InvocationTargetException(e);
105
		} finally {
105
        } catch (CoreException e) {
106
            // saves the current configuration
107
            if (installCount > 0) {
108
                try {
109
                    SiteManager.getLocalSite().save();
110
                } catch (CoreException ce) {
111
                    UpdateUtils.logException(ce);
112
                }
113
            }
114
            throw new InvocationTargetException(e);
115
        } finally {
106
			OperationsManager.setInProgress(false);
116
			OperationsManager.setInProgress(false);
107
			monitor.done();
117
			monitor.done();
108
		}
118
		}
(-)src/org/eclipse/update/internal/core/InstallConfiguration.java (-2 / +20 lines)
Lines 28-34 Link Here
28
import org.eclipse.core.runtime.CoreException;
28
import org.eclipse.core.runtime.CoreException;
29
import org.eclipse.core.runtime.FileLocator;
29
import org.eclipse.core.runtime.FileLocator;
30
import org.eclipse.core.runtime.IProgressMonitor;
30
import org.eclipse.core.runtime.IProgressMonitor;
31
import org.eclipse.core.runtime.IStatus;
31
import org.eclipse.core.runtime.Platform;
32
import org.eclipse.core.runtime.Platform;
33
import org.eclipse.core.runtime.Status;
32
import org.eclipse.osgi.util.NLS;
34
import org.eclipse.osgi.util.NLS;
33
import org.eclipse.update.configuration.IActivity;
35
import org.eclipse.update.configuration.IActivity;
34
import org.eclipse.update.configuration.IConfiguredSite;
36
import org.eclipse.update.configuration.IConfiguredSite;
Lines 497-502 Link Here
497
		if (featurePlugin != null)
499
		if (featurePlugin != null)
498
			pluginVersion = featurePlugin.getVersionedIdentifier().getVersion().toString();
500
			pluginVersion = featurePlugin.getVersionedIdentifier().getVersion().toString();
499
501
502
        // Find the site
503
        SiteEntry siteEntry = null;
504
        try {
505
            URL featureUrl = new URL(cSite.getPlatformURLString());
506
            siteEntry = (SiteEntry)runtimeConfiguration.findConfiguredSite(featureUrl);
507
        } catch (MalformedURLException e) {
508
            throw Utilities.newCoreException(NLS.bind(Messages.InstallConfiguration_UnableToCreateURL, (new String[] { cSite.getPlatformURLString() })), e);
509
        } catch (ClassCastException e) {
510
            throw Utilities.newCoreException(Messages.InstallConfiguration_UnableToCast, e);    
511
        }
512
513
        // if the URL doesn't exist throw a CoreException
514
        if (siteEntry == null) {
515
            throw new CoreException(
516
                    new Status(IStatus.ERROR, "org.eclipse.update.core",    //$NON-NLS-1$
517
                            NLS.bind(Messages.InstallConfiguration_unableToFindSite, (new String[] { cSite.getSite().getURL().toExternalForm(), runtimeConfiguration.getConfigurationLocation().toExternalForm() }))));
518
        }
519
500
		// write the primary features
520
		// write the primary features
501
		if (feature.isPrimary()) {
521
		if (feature.isPrimary()) {
502
			// get any fragments for the feature plugin
522
			// get any fragments for the feature plugin
Lines 515-521 Link Here
515
			String application = feature.getApplication();
535
			String application = feature.getApplication();
516
			FeatureEntry featureEntry = (FeatureEntry)runtimeConfiguration.createFeatureEntry(id, version, pluginIdentifier, pluginVersion, true, application, roots);
536
			FeatureEntry featureEntry = (FeatureEntry)runtimeConfiguration.createFeatureEntry(id, version, pluginIdentifier, pluginVersion, true, application, roots);
517
			featureEntry.setURL(getFeatureRelativeURL(feature));
537
			featureEntry.setURL(getFeatureRelativeURL(feature));
518
			SiteEntry siteEntry = (SiteEntry)runtimeConfiguration.findConfiguredSite(cSite.getSite().getURL());
519
			siteEntry.addFeatureEntry(featureEntry);
538
			siteEntry.addFeatureEntry(featureEntry);
520
		} else {
539
		} else {
521
			// write non-primary feature entries
540
			// write non-primary feature entries
Lines 523-529 Link Here
523
			String pluginIdentifier = feature.getPrimaryPluginID();
542
			String pluginIdentifier = feature.getPrimaryPluginID();
524
			FeatureEntry featureEntry = (FeatureEntry)runtimeConfiguration.createFeatureEntry(id, version, pluginIdentifier, pluginVersion, false, null, null);
543
			FeatureEntry featureEntry = (FeatureEntry)runtimeConfiguration.createFeatureEntry(id, version, pluginIdentifier, pluginVersion, false, null, null);
525
			featureEntry.setURL(getFeatureRelativeURL(feature));
544
			featureEntry.setURL(getFeatureRelativeURL(feature));
526
			SiteEntry siteEntry = (SiteEntry)runtimeConfiguration.findConfiguredSite(cSite.getSite().getURL());
527
			siteEntry.addFeatureEntry(featureEntry);
545
			siteEntry.addFeatureEntry(featureEntry);
528
		}
546
		}
529
547

Return to bug 190533