- Move back to ~/.eclipse for update site pending upstream comments.

- Add patch to add platform to ~/.eclipse's platform.xml. This maintains
    user-installed plugins but allows us to move arch-specific stuff into
    %%{_libdir}.
This commit is contained in:
Andrew Overholt 2006-11-28 19:55:16 +00:00
parent 9e927f500f
commit f6a5ec55b3
3 changed files with 112 additions and 2 deletions

View File

@ -0,0 +1,99 @@
### Eclipse Workspace Patch 1.0
#P platform-launcher
Index: library/gtk/eclipseGtk.c
===================================================================
RCS file: /cvsroot/eclipse/platform-launcher/library/gtk/eclipseGtk.c,v
retrieving revision 1.27
diff -u -r1.27 eclipseGtk.c
--- library/gtk/eclipseGtk.c 27 Mar 2006 18:25:42 -0000 1.27
+++ library/gtk/eclipseGtk.c 28 Nov 2006 19:50:03 -0000
@@ -335,3 +335,73 @@
gtk_main_quit();
return FALSE;
}
+
+/* Add the platform to ~/.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.update/platform.xml */
+void addPlatformToTildeDotEclipse()
+{
+ gchar *platform_xml, *touched;
+ gchar *config_end_position;
+ gsize old_length;
+ gchar *old_contents, *new_contents;
+ GError *error = NULL;
+ const gchar *site_element = "<site url=\"platform:/base/\" enabled=\"true\" updateable=\"true\" policy=\"USER-EXCLUDE\">\n<feature id=\"org.eclipse.rcp\" version=\"3.2.1.r321_v20060801-clWbqCmjexIWDqg\" url=\"features/org.eclipse.rcp_3.2.1.r321_v20060801-clWbqCmjexIWDqg/\">\n</feature>\n</site>\n\0";
+
+ platform_xml = g_strconcat(g_get_home_dir(), "/.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.update/platform.xml", NULL);
+ touched = g_strconcat(g_get_home_dir(), "/.eclipse/.homedirmodified-fedora", NULL);
+
+ /* If platform.xml doesn't exist, Eclipse has yet to be started
+ * so don't worry about doing anything. Also, guard against doing
+ * this more than once with a dot file. */
+ if (!g_file_test(platform_xml, G_FILE_TEST_EXISTS) || \
+ g_file_test(touched, G_FILE_TEST_EXISTS)) {
+ g_free(platform_xml);
+ g_free(touched);
+ return;
+ }
+
+
+ if (g_file_get_contents (platform_xml,
+ &old_contents, &old_length, &error) == FALSE)
+ {
+ g_print("Error reading platform.xml in ~/.eclipse.\
+ You should remove ~/.eclipse before restarting Eclipse:\0");
+ g_print(g_strconcat(error->message, "\n\0", NULL));
+ g_free(error);
+ g_free(platform_xml);
+ g_free(touched);
+ return;
+ }
+
+ config_end_position = g_strrstr_len(old_contents, old_length, "</config>");
+ *config_end_position = '\0';
+ new_contents = g_strconcat(old_contents, site_element, "</config>\n\0", NULL);
+
+ if (g_file_set_contents(platform_xml,
+ new_contents, -1, &error) == FALSE)
+ {
+ g_print("Error writing platform.xml in ~/.eclipse.\
+ You should remove ~/.eclipse before restarting Eclipse:\0");
+ g_print(g_strconcat(error->message, "\n\0", NULL));
+ g_free(error);
+ g_free(touched);
+ g_free(platform_xml);
+ g_free(new_contents);
+ g_free(old_contents);
+ return;
+ }
+
+ if (g_file_set_contents(touched, "\0", -1, &error) == FALSE)
+ {
+ g_print("Error touching ~/.eclipse/.homedirmodified-fedora.\
+ You should remove ~/.eclipse before restarting Eclipse:\0");
+ g_print(g_strconcat(error->message, "\n\0", NULL));
+ g_free(error);
+ }
+
+ g_free(platform_xml);
+ g_free(touched);
+ g_free(new_contents);
+ g_free(old_contents);
+
+ return;
+}
Index: library/eclipse.c
===================================================================
RCS file: /cvsroot/eclipse/platform-launcher/library/eclipse.c,v
retrieving revision 1.71
diff -u -r1.71 eclipse.c
--- library/eclipse.c 25 Apr 2006 14:31:50 -0000 1.71
+++ library/eclipse.c 28 Nov 2006 19:50:03 -0000
@@ -512,6 +512,8 @@
/* Get the command to start the Java VM. */
vmCommandArgs = getVMCommand( argc, argv );
+ addPlatformToTildeDotEclipse();
+
/* While the Java VM should be restarted */
vmCommand = vmCommandArgs;
while (vmCommand != NULL)

View File

@ -73,7 +73,7 @@ diff -u -r1.81.2.1 TargetPage.java
+ 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 + ".eclipseplugins" + File.separator + //$NON-NLS-1$ //$NON-NLS-2$
+ 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 {

View File

@ -26,7 +26,7 @@ Epoch: 1
Summary: An open, extensible IDE
Name: eclipse
Version: %{eclipse_majmin}.%{eclipse_micro}
Release: 22%{?dist}
Release: 23%{?dist}
License: EPL
Group: Text Editors/Integrated Development Environments (IDE)
URL: http://www.eclipse.org/
@ -118,6 +118,9 @@ Patch100: customBuildCallbacks.xml-add-pre.gather.bin.parts.patch
# Add ppc64 to the list of arches with gre64.conf
# part of https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=207016
Patch101: %{name}-ppc64gre64.patch
# This allows us to remove the configuration platform.xml in /usr/share/eclipse
# yet still maintain user-installed plugins in ~/.eclipse
Patch102: %{name}-launcher-addplatformtotildeeclipse.patch
%if %{gcj_support}
@ -429,6 +432,7 @@ unzip -qq -d launchertmp plugins/org.eclipse.platform/launchersrc.zip
pushd launchertmp
%patch47 -p0
%patch101 -p0
%patch102 -p0
# put the configuration directory in an arch specific location
sed --in-place "s:/usr/lib/eclipse/configuration:%{_libdir}/%{name}/configuration:" library/eclipse.c
# make the eclipse install relocatable
@ -440,6 +444,7 @@ rm -rf launchertmp
pushd features/org.eclipse.platform.launchers
%patch47 -p0
%patch101 -p0
%patch102 -p0
# put the configuration directory in an arch specific location
sed --in-place "s:/usr/lib/eclipse:%{_libdir}/%{name}:" library/eclipse.c
# make the eclipse install relocatable
@ -1743,6 +1748,12 @@ rm -f %{_datadir}/%{name}/configuration/org.eclipse.update/platform.xml*
%{_libdir}/%{name}/plugins/org.eclipse.sdk_*
%changelog
* Tue Nov 28 2006 Andrew Overholt <overholt@redhat.com> 3.2.1-23
- Move back to ~/.eclipse for update site pending upstream comments.
- Add patch to add platform to ~/.eclipse's platform.xml. This maintains
user-installed plugins but allows us to move arch-specific stuff into
%%{_libdir}.
* Mon Nov 20 2006 Andrew Overholt <overholt@redhat.com> 3.2.1-22
- Use ~/.eclipseplugins instead of ~/.eclipse in update site - homedir patch.
- Bump release.