[pkg-java] r2644 - in trunk/eclipse/debian: . patches

Stephan Michels tashiro-guest at costa.debian.org
Sun Oct 22 19:18:55 UTC 2006


Author: tashiro-guest
Date: 2006-10-22 19:18:54 +0000 (Sun, 22 Oct 2006)
New Revision: 2644

Modified:
   trunk/eclipse/debian/changelog
   trunk/eclipse/debian/patches/eclipse-updatehomedir.dpatch
   trunk/eclipse/debian/rules
Log:
Updated updatehomedir patch from Fedora's repository


Modified: trunk/eclipse/debian/changelog
===================================================================
--- trunk/eclipse/debian/changelog	2006-10-22 19:01:04 UTC (rev 2643)
+++ trunk/eclipse/debian/changelog	2006-10-22 19:18:54 UTC (rev 2644)
@@ -71,6 +71,7 @@
   * Ensured that the directories exist before links were created
   * Converted native presentation patch to 3.2
   * Show error dialog only if the mozilla/firefox wasn't found.
+  * Updated updatehomedir patch from Fedora's repository
 
  -- Matthias Klose <doko at debian.org>  Sun, 22 Oct 2006 04:25:47 +0200
 

Modified: trunk/eclipse/debian/patches/eclipse-updatehomedir.dpatch
===================================================================
--- trunk/eclipse/debian/patches/eclipse-updatehomedir.dpatch	2006-10-22 19:01:04 UTC (rev 2643)
+++ trunk/eclipse/debian/patches/eclipse-updatehomedir.dpatch	2006-10-22 19:18:54 UTC (rev 2644)
@@ -23,111 +23,227 @@
 exit 0
 
 @DPATCH@
-diff -P -r -u ../source-tree.orig/plugins/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/ModeSelectionPage.java source-tree/plugins/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/ModeSelectionPage.java
---- ../source-tree.orig/plugins/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/ModeSelectionPage.java	2005-09-20 12:06:46.000000000 +0200
-+++ source-tree/plugins/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/ModeSelectionPage.java	2005-09-20 14:18:57.000000000 +0200
-@@ -10,6 +10,7 @@
+diff -r -N -u source-tree.orig/plugins/org.eclipse.update.core/src/org/eclipse/update/internal/core/ConfiguredSite.java source-tree/plugins/org.eclipse.update.core/src/org/eclipse/update/internal/core/ConfiguredSite.java
+--- source-tree.orig/plugins/org.eclipse.update.core/src/org/eclipse/update/internal/core/ConfiguredSite.java	2006-10-22 19:59:44.000000000 +0200
++++ source-tree/plugins/org.eclipse.update.core/src/org/eclipse/update/internal/core/ConfiguredSite.java	2006-10-22 20:11:31.000000000 +0200
+@@ -35,6 +35,7 @@
+ import org.eclipse.core.runtime.IProgressMonitor;
+ import org.eclipse.core.runtime.IStatus;
+ import org.eclipse.core.runtime.MultiStatus;
++import org.eclipse.core.runtime.Platform;
+ import org.eclipse.osgi.util.NLS;
+ import org.eclipse.update.configuration.IActivity;
+ import org.eclipse.update.configuration.IConfiguredSite;
+@@ -803,7 +804,9 @@
+ 			}
+ 		} else {
+ 			File container = getSiteContaining(file);
+-			if (container != null) {
++			// allow the install location to pass even though it looks like this
++			// site is contained in another site
++			if (container != null && !siteLocation.equals(Platform.getInstallLocation().getURL().getFile())) {
+ 				verifyStatus = createStatus(IStatus.ERROR, NLS.bind(Messages.ConfiguredSite_ContainedInAnotherSite, (new String[] { container.getAbsolutePath() })), null);
+ 				return verifyStatus;
+ 			}
+diff -r -N -u source-tree.orig/plugins/org.eclipse.update.core/src/org/eclipse/update/internal/search/OptionalFeatureSearchCategory.java source-tree/plugins/org.eclipse.update.core/src/org/eclipse/update/internal/search/OptionalFeatureSearchCategory.java
+--- source-tree.orig/plugins/org.eclipse.update.core/src/org/eclipse/update/internal/search/OptionalFeatureSearchCategory.java	2006-10-22 19:59:44.000000000 +0200
++++ source-tree/plugins/org.eclipse.update.core/src/org/eclipse/update/internal/search/OptionalFeatureSearchCategory.java	2006-10-22 20:11:31.000000000 +0200
+@@ -76,6 +76,13 @@
+ 		public IQueryUpdateSiteAdapter getQuerySearchSite() {
+ 			return null;
+ 		}
++		
++		/* (non-Javadoc)
++		 * @see org.eclipse.update.internal.ui.search.ISearchQuery#getFeature()
++		 */
++		public IFeature getFeature() {
++				return null;
++		}
+ 	}
+ 
+ 	public void addVersionedIdentifier(VersionedIdentifier vid) {
+diff -r -N -u source-tree.orig/plugins/org.eclipse.update.core/src/org/eclipse/update/internal/search/SiteSearchCategory.java source-tree/plugins/org.eclipse.update.core/src/org/eclipse/update/internal/search/SiteSearchCategory.java
+--- source-tree.orig/plugins/org.eclipse.update.core/src/org/eclipse/update/internal/search/SiteSearchCategory.java	2006-10-22 19:59:44.000000000 +0200
++++ source-tree/plugins/org.eclipse.update.core/src/org/eclipse/update/internal/search/SiteSearchCategory.java	2006-10-22 20:11:31.000000000 +0200
+@@ -133,6 +133,14 @@
+ 		public IQueryUpdateSiteAdapter getQuerySearchSite() {
+ 			return null;
+ 		}
++		
++		/* (non-Javadoc)
++		 * @see org.eclipse.update.internal.ui.search.ISearchQuery#getFeature()
++		 */
++		public IFeature getFeature() {
++				return null;
++		}
++		
+ 	}
+ 
+ 	public SiteSearchCategory() {
+diff -r -N -u source-tree.orig/plugins/org.eclipse.update.core/src/org/eclipse/update/internal/search/UpdatesSearchCategory.java source-tree/plugins/org.eclipse.update.core/src/org/eclipse/update/internal/search/UpdatesSearchCategory.java
+--- source-tree.orig/plugins/org.eclipse.update.core/src/org/eclipse/update/internal/search/UpdatesSearchCategory.java	2006-10-22 19:59:44.000000000 +0200
++++ source-tree/plugins/org.eclipse.update.core/src/org/eclipse/update/internal/search/UpdatesSearchCategory.java	2006-10-22 20:11:31.000000000 +0200
+@@ -285,6 +285,10 @@
+ 			monitor.worked(1);
+ 			monitor.done();
+ 		}
++		
++		public IFeature getFeature() {
++			return candidate;
++		}	
+ 	}
+ 
+ 	private ArrayList candidates;
+diff -r -N -u source-tree.orig/plugins/org.eclipse.update.core/src/org/eclipse/update/search/IUpdateSearchQuery.java source-tree/plugins/org.eclipse.update.core/src/org/eclipse/update/search/IUpdateSearchQuery.java
+--- source-tree.orig/plugins/org.eclipse.update.core/src/org/eclipse/update/search/IUpdateSearchQuery.java	2006-10-22 19:59:44.000000000 +0200
++++ source-tree/plugins/org.eclipse.update.core/src/org/eclipse/update/search/IUpdateSearchQuery.java	2006-10-22 20:11:31.000000000 +0200
+@@ -7,6 +7,7 @@
+  *
+  * Contributors:
+  *     IBM Corporation - initial API and implementation
++ *     Red Hat Incorporated - getFeature() API addition
   *******************************************************************************/
- package org.eclipse.update.internal.ui.wizards;
+ package org.eclipse.update.search;
  
+@@ -50,4 +51,12 @@
+  * @param monitor a progress monitor to report search progress within the provided site
+  */
+ 	public void run(ISite site, String [] categoriesToSkip, IUpdateSearchFilter filter, IUpdateSearchResultCollector collector, IProgressMonitor monitor);
++	
++/**
++ * Returns IFeature associated with the IUpdateSearchQuery
++ * 
++ * @return the IFeature that is associated with the IUpdateSearchQuery
++ * @since 3.2
++ */
++	public IFeature getFeature();
+ }
+diff -r -N -u source-tree.orig/plugins/org.eclipse.update.core/src/org/eclipse/update/search/UpdateSearchRequest.java source-tree/plugins/org.eclipse.update.core/src/org/eclipse/update/search/UpdateSearchRequest.java
+--- source-tree.orig/plugins/org.eclipse.update.core/src/org/eclipse/update/search/UpdateSearchRequest.java	2006-10-22 19:59:44.000000000 +0200
++++ source-tree/plugins/org.eclipse.update.core/src/org/eclipse/update/search/UpdateSearchRequest.java	2006-10-22 20:11:31.000000000 +0200
+@@ -282,6 +282,10 @@
+ 					// currently, the next conditional is only executed (qsite!=null) when
+ 					// running an update search. 
+ 					if (qsite != null && searchFeatureProvidedSites) {
++						// do not update features that are installed in read-only locations
++						IFeature feature = query.getFeature();
++						if (feature != null && !feature.getSite().getCurrentConfiguredSite().verifyUpdatableStatus().isOK())
++							continue;
+ 						// check for mapping
+ 						IUpdateSiteAdapter mappedSite = getMappedSite(updatePolicy, qsite);
+ 						// when there is no mapped site the feature is not updatable
+diff -r -N -u source-tree.orig/plugins/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/InstallWizard2.java source-tree/plugins/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/InstallWizard2.java
+--- source-tree.orig/plugins/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/InstallWizard2.java	2006-10-22 19:58:27.000000000 +0200
++++ source-tree/plugins/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/InstallWizard2.java	2006-10-22 20:11:30.000000000 +0200
+@@ -153,7 +153,7 @@
+ 		addPage(licensePage);
+ 		optionalFeaturesPage = new OptionalFeaturesPage(config);
+ 		addPage(optionalFeaturesPage);
+-		targetPage = new TargetPage(config);
++		targetPage = new TargetPage(config, isUpdate);
+ 		addPage(targetPage);
+ 	}
+ 
+diff -r -N -u source-tree.orig/plugins/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/TargetPage.java source-tree/plugins/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/TargetPage.java
+--- source-tree.orig/plugins/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/TargetPage.java	2006-10-22 19:58:27.000000000 +0200
++++ source-tree/plugins/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/TargetPage.java	2006-10-22 20:11:31.000000000 +0200
+@@ -18,6 +18,9 @@
+ import java.util.HashSet;
+ import java.util.Iterator;
+ 
++import org.eclipse.core.runtime.CoreException;
++import org.eclipse.core.runtime.IStatus;
 +import org.eclipse.core.runtime.Platform;
  import org.eclipse.jface.dialogs.Dialog;
  import org.eclipse.jface.dialogs.IDialogSettings;
- import org.eclipse.swt.SWT;
-@@ -70,10 +71,17 @@
- 		GridLayout layout = new GridLayout();
- 		composite.setLayout(layout);
- 		updatesButton = new Button(composite, SWT.RADIO);
--		updatesButton.setText(UpdateUIMessages.ModeSelectionPage_updates); 
-+		updatesButton.setText(UpdateUIMessages.ModeSelectionPage_updates);
- 		updateMode = !getSettings().getBoolean(P_NEW_FEATURES_MODE);
-+		// don't allow updates if the installation location is readonly
-+		if (Platform.getInstallLocation().isReadOnly()) {
-+			updatesButton.setEnabled(false); 
-+			updateMode = false;
-+		}
- 		updatesButton.setSelection(updateMode);
- 		
-+	
-+		
- 		final Label updatesText = new Label(composite, SWT.WRAP);
- 		updatesText.setText(UpdateUIMessages.ModeSelectionPage_updatesText);
- 		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-diff -P -r -u ../source-tree.orig/plugins/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/TargetPage.java source-tree/plugins/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/TargetPage.java
---- ../source-tree.orig/plugins/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/TargetPage.java	2005-09-20 12:06:46.000000000 +0200
-+++ source-tree/plugins/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/wizards/TargetPage.java	2005-09-20 14:22:32.000000000 +0200
-@@ -13,6 +13,9 @@
- import java.io.*;
- import java.util.*;
- 
-+import org.eclipse.core.runtime.Platform;
-+import org.eclipse.core.runtime.CoreException;
-+import org.eclipse.core.runtime.IStatus;
- import org.eclipse.jface.dialogs.Dialog;
- import org.eclipse.jface.resource.*;
- import org.eclipse.jface.viewers.*;
-@@ -150,7 +153,7 @@
-         label.setLayoutData(gd);
- 
- 		installLocation = new Label(client, SWT.NULL);
--        installLocation.setText("foo"); //$NON-NLS-1$
-+        installLocation.setText(""); //$NON-NLS-1$
-         gd = new GridData(GridData.FILL_HORIZONTAL);
-         installLocation.setLayoutData(gd);
-         
-@@ -360,7 +363,27 @@
- 				continue;
- 			}
- 
--			jobs[i].setTargetSite(getFirstTargetSite(jobs[i]));
-+                       IConfiguredSite csite = getFirstTargetSite(jobs[i]);
-+                       if (csite == null && Platform.getInstallLocation().isReadOnly()) {
-+                               // there are no updateable sites and the installation location is read only
-+                               // make an update site in the user's home direcotry
-+                               String sitePath = System.getProperty("user.home") + File.separator + ".eclipse" + File.separator +
-+                                                                 Platform.getProduct().getId() + File.separator + "updates"; //$NON-NLS-1$ //$NON-NLS-2$
-+
-+                               try {
-+                                       csite = config.createConfiguredSite(new File(sitePath));
-+                                       config.addConfiguredSite(csite);
-+                                       IStatus status = csite.verifyUpdatableStatus();
-+                                       if (!status.isOK())
-+                                               throw new CoreException(status);
-+
-+                               } catch (CoreException e) {
-+                                       // there was a problem, the user must choose an installation site
-+                                       csite = null;
-+                               }
-+                       }
-+
-+			jobs[i].setTargetSite(csite);
- 
- 		}
- 	}
-@@ -370,7 +393,7 @@
- 		IConfiguredSite[] sites = config.getConfiguredSites();
- 		for (int i = 0; i < sites.length; i++) {
- 			IConfiguredSite csite = sites[i];
--			if (getSiteVisibility(csite, job)) 
-+			if (getSiteVisibility(csite, job) && csite.verifyUpdatableStatus().isOK() == true) 
- 				return csite;
- 		}
- 		return null;
-@@ -388,12 +411,11 @@
-     
-     void removeAddedSites() {
-         if (added != null) {
--        	Iterator it = added.iterator(); 
--            while (it.hasNext()) {
--                 config.removeConfiguredSite((IConfiguredSite) it.next());
--                // the config listener no longer removes the site so we need to cleanup the collection at the end
--            }
--            added.clear();
-+             while (!added.isEmpty()) {
-+                 Iterator it = added.iterator();
-+                 if (it.hasNext())
-+                     config.removeConfiguredSite((IConfiguredSite) it.next());
-+             }
-         }           
-     }
-     
+ import org.eclipse.jface.resource.ImageDescriptor;
+@@ -92,6 +95,7 @@
+     private Label installLocation;
+     private Button changeLocation;
+     static HashSet added;
++    private boolean isUpdate; // whether the wizard is updating a feature or installing a new one
+ 
+ 	class JobsContentProvider
+ 		extends DefaultContentProvider
+@@ -236,13 +240,14 @@
+ 	/**
+ 	 * Constructor for ReviewPage2
+ 	 */
+-	public TargetPage(IInstallConfiguration config) {
++	public TargetPage(IInstallConfiguration config, boolean isUpdate) {
+ 		super("Target"); //$NON-NLS-1$
+ 		setTitle(UpdateUIMessages.InstallWizard_TargetPage_title); 
+ 		setDescription(UpdateUIMessages.InstallWizard_TargetPage_desc); 
+ 		this.config = config;
+ 		UpdateUI.getDefault().getLabelProvider().connect(this);
+ 		configListener = new ConfigListener();
++		this.isUpdate = isUpdate;
+ 	}
+ 
+ 	public void setJobs(IInstallFeatureOperation[] jobs) {
+@@ -273,7 +278,7 @@
+         label.setLayoutData(gd);
+ 
+ 		installLocation = new Label(client, SWT.NULL);
+-        installLocation.setText("foo"); //$NON-NLS-1$
++        installLocation.setText(""); //$NON-NLS-1$
+         gd = new GridData(GridData.FILL_HORIZONTAL);
+         installLocation.setLayoutData(gd);
+         
+@@ -656,12 +661,45 @@
+ 				continue;
+ 			}
+ 
+-			jobs[i].setTargetSite(getFirstTargetSite(jobs[i]));
++			IConfiguredSite csite = getFirstTargetSite(jobs[i]);
++			if (csite == null && Platform.getInstallLocation().isReadOnly() && isUpdate == false) {
++				// there are no updateable sites, the installation location is read-only and we are installing a new feature
++				// make an update site in the user's home direcotry
++				File site = new File(System.getProperty("user.home") + File.separator + ".eclipse" + File.separator + //$NON-NLS-1$ //$NON-NLS-2$
++					Platform.getProduct().getId() + File.separator + "updates"); //$NON-NLS-1$
++				
++				try {
++					csite = config.createConfiguredSite(site);
++					config.addConfiguredSite(csite);
++					IStatus status = csite.verifyUpdatableStatus();
++					if (!status.isOK())
++						throw new CoreException(status);
++					
++				} catch (CoreException e) {
++					// there was a problem, the user must choose an installation site
++					csite = null;
++					// no need to check if the directory exists because File.delete() returns false if it's not there
++					deleteDir(site);
++				}
++			}
+ 
++			jobs[i].setTargetSite(csite);
+ 		}
+ 
+ 	}
+-	
++
++	private boolean deleteDir(File dir) {
++        if (dir.isDirectory()) {
++            String[] files = dir.list();
++            for (int i=0; i < files.length; i++) {
++                if (!deleteDir(new File(dir, files[i]))) {
++                    return false;
++                }
++            }
++        }
++        return dir.delete();
++    }
++
+ 	private IConfiguredSite getMostReceantlyUsedSite() {
+ 		IDialogSettings master = UpdateUI.getDefault().getDialogSettings();
+ 		IDialogSettings section = master.getSection(TargetSiteDialog.MOST_RECEANTLY_USED_SITE_URL);
+@@ -696,7 +734,7 @@
+ 		IConfiguredSite[] sites = config.getConfiguredSites();
+ 		for (int i = 0; i < sites.length; i++) {
+ 			IConfiguredSite csite = sites[i];
+-			if (getSiteVisibility(csite, job)) 
++			if (getSiteVisibility(csite, job) && csite.getSite().getCurrentConfiguredSite().verifyUpdatableStatus().isOK())
+ 				return csite;
+ 		}
+ 		return null;

Modified: trunk/eclipse/debian/rules
===================================================================
--- trunk/eclipse/debian/rules	2006-10-22 19:01:04 UTC (rev 2643)
+++ trunk/eclipse/debian/rules	2006-10-22 19:18:54 UTC (rev 2644)
@@ -134,6 +134,7 @@
 	eclipse-jsch-build-files \
 	eclipse-awt-libpath \
 	eclipse-nativepresentation \
+	eclipse-updatehomedir \
 
 #	eclipse-icon \
 #	eclipse-build \
@@ -143,9 +144,7 @@
 #	eclipse-disable-motif \
 #	eclipse-efj \
 #	eclipse-disable-filelog \
-#	eclipse-updatehomedir \
 #	eclipse-libswt-mozilla-classic \
-#	eclipse-navtivepresentation \
 #	eclipse-javadoc-bootclasspath \
 #	eclipse-link-classpathdoc \
 #	eclipse-gjdoc-reflection \




More information about the pkg-java-commits mailing list