From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1JGwL0-00052x-PP for garchives@archives.gentoo.org; Mon, 21 Jan 2008 13:05:19 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 039A2E0458; Mon, 21 Jan 2008 13:05:18 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 6C536E0455 for ; Mon, 21 Jan 2008 13:05:17 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id E9D4665C34 for ; Mon, 21 Jan 2008 13:05:16 +0000 (UTC) Received: from elvanor by stork.gentoo.org with local (Exim 4.68) (envelope-from ) id 1JGvnv-000258-BI for gentoo-commits@lists.gentoo.org; Mon, 21 Jan 2008 12:31:07 +0000 From: "Jean-Noel Rivasseau (elvanor)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, elvanor@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in dev-util/eclipse-sdk/files/3.3/fedora: eclipse-pde.build-add-package-build.patch eclipse-libupdatebuild2.patch eclipse-fileinitializer.patch X-VCS-Repository: gentoo-x86 X-VCS-Files: eclipse-pde.build-add-package-build.patch eclipse-libupdatebuild2.patch eclipse-fileinitializer.patch X-VCS-Directories: dev-util/eclipse-sdk/files/3.3/fedora X-VCS-Committer: elvanor X-VCS-Committer-Name: Jean-Noel Rivasseau Content-Type: text/plain; charset=utf8 Message-Id: Sender: Jean-Noel Rivasseau Date: Mon, 21 Jan 2008 12:31:07 +0000 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 1e97a17e-041d-4f2d-8834-109fb7789c6c X-Archives-Hash: bbb599a8a89e7ec8751df10948d6bbd7 elvanor 08/01/21 12:31:07 Added: eclipse-pde.build-add-package-build.patch eclipse-libupdatebuild2.patch eclipse-fileinitializer.patch Log: Eclipse 3.3.1.1 version bump, minor syntax changes for 3.2.1-r2 ebuild. (Portage version: 2.1.3.19) Revision Changes Path 1.1 dev-util/eclipse-sdk/files/3.3/fedora/eclipse-pde.bu= ild-add-package-build.patch file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/eclipse-s= dk/files/3.3/fedora/eclipse-pde.build-add-package-build.patch?rev=3D1.1&v= iew=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/eclipse-s= dk/files/3.3/fedora/eclipse-pde.build-add-package-build.patch?rev=3D1.1&c= ontent-type=3Dtext/plain Index: eclipse-pde.build-add-package-build.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Index: templates/package-build/build.properties =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: templates/package-build/build.properties diff -N templates/package-build/build.properties --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/package-build/build.properties 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,12 @@ +buildDirectory=3D${sourceDirectory}/build +buildLabel=3DrpmBuild +archivePrefix=3Declipse +skipFetch=3Dtrue +javacFailOnError=3Dtrue +collectingFolder=3Declipse +archivesFormat=3D*,*,*-zip +zipargs=3D-y +javacDebugInfo=3Dtrue +archiveName=3D${id}.zip +runPackager=3Dfalse +baseLocation=3D/usr/share/eclipse Index: templates/package-build/customTargets-assemble-target.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: templates/package-build/customTargets-assemble-target.xml diff -N templates/package-build/customTargets-assemble-target.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/package-build/customTargets-assemble-target.xml 1 Jan 1970 = 00:00:00 -0000 @@ -0,0 +1,12 @@ + + + + + + + + + + + Index: templates/package-build/customTargets.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: templates/package-build/customTargets.xml diff -N templates/package-build/customTargets.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/package-build/customTargets.xml 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,144 @@ + + + + + + + =09 + =20 + + + + + + + + + + + + + + +=09 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =20 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: templates/package-build/prepare-build-dir.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: templates/package-build/prepare-build-dir.sh diff -N templates/package-build/prepare-build-dir.sh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/package-build/prepare-build-dir.sh 1 Jan 1970 00:00:00 -000= 0 @@ -0,0 +1,77 @@ +#!/bin/sh + +if [ $# -ne 2 ]; then=20 + echo "usage: $0 " + exit 1 +fi + +if [ ! -d $1 ]; then + echo "usage: $0 " + exit 1 +fi + +SOURCEDIR=3D$1 +BUILDDIR=3D$2 + +echo "preparing files in $1 for buildfile generation ..." +mkdir -p $BUILDDIR + +# make some ant build files to extract the id from the feature.xml, plug= in.xml or the fragment.xml +mkdir -p $BUILDDIR/tmp +BUILDFILE=3D$BUILDDIR/tmp/build.xml + +echo " + + + + + +" > $BUILDFILE + +for type in feature plugin fragment; do + CURBUILDFILE=3D$BUILDDIR/tmp/$type-build.xml + cat $BUILDFILE | sed "s|@type@|$type|" > $CURBUILDFILE +done + +# make the directories eclipse is expecting=20 +echo " making the 'features' and 'plugins' directories" +mkdir -p $BUILDDIR/features $BUILDDIR/plugins + +# make symlinks for the features +FEATURES=3D$(find $SOURCEDIR -name feature.xml) +for f in $FEATURES; do + PROJECTDIR=3D$(dirname $f) + PROJECTNAME=3D$(ant -Dbasedir=3D$PROJECTDIR -f $BUILDDIR/tmp/feature-b= uild.xml 2>&1 | grep echo | cut --delimiter=3D' ' -f 7) + if [ -z $PROJECTNAME ]; then + echo "ERROR: could not determine the feature id for $PROJECTDIR" + exit 1 + fi + + echo " making symlink: $BUILDDIR/features/$PROJECTNAME -> $PROJECTDIR= " + ln -sf $PROJECTDIR $BUILDDIR/features/$PROJECTNAME +done + +# make symlinks for plugins and fragments +PLUGINDIRS=3D$(find $SOURCEDIR -name plugin.xml -o -name fragment.xml -o= -name MANIFEST.MF | sed "s/plugin.xml//g" | sed "s/fragment.xml//g" | se= d "s/META-INF\/MANIFEST.MF//" | sort | uniq) +for dir in $PLUGINDIRS; do + PROJECTNAME=3D"" + if [ -e $dir/META-INF/MANIFEST.MF ]; then + PROJECTNAME=3D$(grep Bundle-SymbolicName $dir/META-INF/MANIFEST.MF |= cut --delimiter=3D';' -f 1 | cut --delimiter=3D' ' -f 2) + elif [ -e $dir/plugin.xml ]; then + PROJECTNAME=3D$(ant -Dbasedir=3D$dir -f $BUILDDIR/tmp/plugin-build.x= ml 2>&1 | grep echo | cut --delimiter=3D' ' -f 7) + elif [ -e $dir/fragment.xml ]; then + PROJECTNAME=3D$(ant -Dbasedir=3D$dir -f $BUILDDIR/tmp/fragment-build= .xml 2>&1 | grep echo | cut --delimiter=3D' ' -f 7) + fi + + if [ -z $PROJECTNAME ]; then + echo "ERROR: could not determine the plugin or fragment id for $dir" + exit 1 + fi + + echo " making symlink: $BUILDDIR/plugins/$PROJECTNAME -> $dir" + ln -sf $dir $BUILDDIR/plugins/$PROJECTNAME + +done=20 + +rm -rf $BUILDDIR/tmp +echo done=20 1.1 dev-util/eclipse-sdk/files/3.3/fedora/eclipse-libupd= atebuild2.patch file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/eclipse-s= dk/files/3.3/fedora/eclipse-libupdatebuild2.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/eclipse-s= dk/files/3.3/fedora/eclipse-libupdatebuild2.patch?rev=3D1.1&content-type=3D= text/plain Index: eclipse-libupdatebuild2.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- plugins/org.eclipse.update.core.linux/src/build.xml.orig 2006-01-27 1= 5:35:35.000000000 -0500 +++ plugins/org.eclipse.update.core.linux/src/build.xml 2006-01-27 15:36:= 07.000000000 -0500 @@ -5,7 +5,7 @@ =20 - + =20 =20 1.1 dev-util/eclipse-sdk/files/3.3/fedora/eclipse-filein= itializer.patch file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/eclipse-s= dk/files/3.3/fedora/eclipse-fileinitializer.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/eclipse-s= dk/files/3.3/fedora/eclipse-fileinitializer.patch?rev=3D1.1&content-type=3D= text/plain Index: eclipse-fileinitializer.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Index: plugin.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/eclipse/org.eclipse.core.runtime/plugin.xml,v retrieving revision 1.68 diff -u -r1.68 plugin.xml --- plugin.xml 4 Mar 2005 22:18:54 -0000 1.68 +++ plugin.xml 7 Nov 2005 20:22:09 -0000 @@ -6,4 +6,22 @@ + + + + + + + + + + + + + +=20 Index: src/org/eclipse/core/internal/runtime/Messages.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/eclipse/org.eclipse.core.runtime/src/org/eclipse/core/= internal/runtime/Messages.java,v retrieving revision 1.18 diff -u -r1.18 Messages.java --- src/org/eclipse/core/internal/runtime/Messages.java 20 Oct 2005 18:31= :04 -0000 1.18 +++ src/org/eclipse/core/internal/runtime/Messages.java 7 Nov 2005 20:22:= 09 -0000 @@ -106,6 +106,14 @@ public static String plugin_instantiateClassError; public static String plugin_loadClassError; =20 + // initializer + public static String initializer_error; +=09 + // file initializer + public static String fileInitializer_fileNotFound; + public static String fileInitializer_IOError; + public static String fileInitializer_missingFileName; +=09 static { // load message values from bundle file reloadMessages(); @@ -114,4 +122,4 @@ public static void reloadMessages() { NLS.initializeMessages(BUNDLE_NAME, Messages.class); } -} \ No newline at end of file +} Index: src/org/eclipse/core/internal/runtime/messages.properties =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/eclipse/org.eclipse.core.runtime/src/org/eclipse/core/= internal/runtime/messages.properties,v retrieving revision 1.106 diff -u -r1.106 messages.properties --- src/org/eclipse/core/internal/runtime/messages.properties 20 Oct 2005= 18:31:04 -0000 1.106 +++ src/org/eclipse/core/internal/runtime/messages.properties 7 Nov 2005 = 20:22:09 -0000 @@ -54,6 +54,13 @@ provider_invalid =3D Problem creating the provider registered by {0}. product_notFound =3D Product {0} could not be found. =20 +### Initializer +initializer_error=3DThere was a problem running the application {0}. + +### File Initiializer +fileInitializer_fileNotFound=3D{0}: The file {1} was not found. +fileInitializer_IOError=3D{0}: There was an error reading {1}. + ### Compatibility - parsing/resolving parse_badPrereqOnFrag =3D Fragment \"{0}\" requires non-existent plug-in= \"{1}\". Fragment ignored. parse_duplicateFragment =3D Duplicate fragment found with id \"{0}\" and= version \"{1}\". Index: src/org/eclipse/core/runtime/Platform.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/eclipse/org.eclipse.core.runtime/src/org/eclipse/core/= runtime/Platform.java,v retrieving revision 1.90 diff -u -r1.90 Platform.java --- src/org/eclipse/core/runtime/Platform.java 26 Aug 2005 19:39:21 -0000= 1.90 +++ src/org/eclipse/core/runtime/Platform.java 7 Nov 2005 20:22:09 -0000 @@ -95,6 +95,15 @@ public static final String OPTION_STARTTIME =3D PI_RUNTIME + "/starttim= e"; //$NON-NLS-1$ =20 /** + * The simple identifier constant (value "initializers") o= f + * the extension point of the Core Runtime plug-in where plug-ins decla= re + * their the existence of initialization code. + *=20 + * @since 3.1 + */ + + public static final String PT_INITIALIZERS =3D "initializers"; //$NON-N= LS-1$ + /**=20 * Name of a preference for configuring the performance level for this = system. * *

Index: schema/initializers.exsd =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: schema/initializers.exsd diff -N schema/initializers.exsd --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ schema/initializers.exsd 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,138 @@ + + + + + + + + + Platform runtime supports plug-ins which would like to=20 +be initialized. That is, plug-ins that needs to be initialized when +the initialization application is being run should provide an extension +to this extension-point. +The initializers are run when the org.eclipse.core.runtime.initializer a= pplication +is being run. The initializers are run in any order. + + + + + + + + + + + + =20 + + + + + + + =20 + + + + + + + =20 + + + + + + + + + + + + + + + + + + + + + + + + + + =20 + + + + + + + + + + + + + + + 3.1 + + + + + + + + + Following is an example of initializer declaration: +<p> +<pre> + <extension id=3D"myInitializer" point=3D"org.eclips= e.core.runtime.initializers"> + <initializer> + <initialize class=3D"myInitializer.Doit"/> + </initializer> + </extension> +</pre> +</p> + + + + + + + + + The value of the class attribute must represent an=20 +implementor of=20 +<samp>org.eclipse.core.runtime.IPlatformRunnable</samp>. + + + + + + + + + [Enter information about supplied implementation of this extens= ion point.] + + + + + + + + + Copyright (c) 2005 IBM Corporation and others.<br> +All rights reserved. This program and the accompanying materials are mad= e=20 +available under the terms of the Eclipse Public License v1.0 which=20 +accompanies=20 +this distribution, and is available at=20 +<a=20 +href=3D"http://www.eclipse.org/legal/epl-v10.html">http://w= ww.eclipse.org/legal/epl-v10.html</a> + + + + Index: src/org/eclipse/core/internal/runtime/FileInitializer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: src/org/eclipse/core/internal/runtime/FileInitializer.java diff -N src/org/eclipse/core/internal/runtime/FileInitializer.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/core/internal/runtime/FileInitializer.java 1 Jan 1970= 00:00:00 -0000 @@ -0,0 +1,186 @@ +package org.eclipse.core.internal.runtime; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.net.URL; +import java.util.Collections; +import java.util.Enumeration; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Properties; +import java.util.Set; +import java.util.regex.Pattern; + +import org.eclipse.core.runtime.IPlatformRunnable; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.osgi.util.NLS; +import org.osgi.framework.Bundle; + +/** + *

+ * This application extracts files to their "localURL". The file pattern= s that you + * want to extract should be specified in a file in a properties format = like this: + *=20 + *

+ * .* =3D *.so,about.html
+ * org.eclipse.team.core.cvs =3D *.html
+ * 
+ *=20 + * This application should be run through the generic initializer mechan= ism and=20 + * not run directly. + *

+ *=20 + *

+ * To run this application, do something like: + *

+ *=20 + *

+ * + * java -cp startup.jar org.eclipse.core.launcher.Main -application org.= eclipse.core.runtime.initializer [-justThisArchOSWS] -fileInitializer <= ;fileWithFilePatternsToExtract> + * + *

+ *=20 + *

+ *

    + *
  • =20 + * Note: Only the files that are extracted will be printed to the consol= e. If you + * want to debug things, use the -consolelog option in + * org.eclipse.core.launcher.Main + *
  • + *
+ *

+ *=20 + * @see Initializer + * @see Platform#asLocalURL(URL) + * @since 3.1 + */ +public class FileInitializer implements IPlatformRunnable { +=09 + private LinkedList extractedFiles; + private boolean justThisArchOSWS; +=09 + public Object run(Object args) throws Exception { + Properties bundleAndFilePatterns =3D getBundleAndFileNamePatterns((Str= ing[]) args); + Set bundlePatterns =3D bundleAndFilePatterns.keySet(); + =09 + // don't do anything if bundleAndFilePatterns is empty + if (bundleAndFilePatterns =3D=3D null || bundleAndFilePatterns.size() = =3D=3D 0) { + return IPlatformRunnable.EXIT_OK; + } + =09 + justThisArchOSWS =3D getJustThisArchOSWS((String[]) args); + =09 + Bundle[] installedBundles =3D InternalPlatform.getDefault().getBundleC= ontext().getBundles(); + extractedFiles =3D new LinkedList(); + + // foreach(bundle pattern) + for (Iterator bundlePatternIter =3D bundlePatterns.iterator(); bundleP= atternIter.hasNext();) { + Object bundlePattern =3D bundlePatternIter.next(); + Object fileNamePattern =3D bundleAndFilePatterns.get(bundlePattern); + // foreach(filename pattern) + String[] fileNamePatterns =3D ((String) fileNamePattern).split(","); = //$NON-NLS-1$ + for (int i =3D 0; i < fileNamePatterns.length; i++) { + fileNamePatterns[i] =3D fileNamePatterns[i].trim(); + } + // foreach(bundle) + for (int i =3D 0; i < installedBundles.length; i++) { + String bundleName =3D installedBundles[i].getSymbolicName(); + // if(bundle matches pattern) check fileNamePattern(s) + if(Pattern.matches((String) bundlePattern, bundleName)) { + for (int j =3D 0; j < fileNamePatterns.length; j++) { + extractMatchingFilesFromBundle(fileNamePatterns[j], installedBundl= es[i]); + } + } + } + } // end for + return IPlatformRunnable.EXIT_OK; + } + + private void extractMatchingFilesFromBundle(String fileNamePattern, Bun= dle bundle) throws IOException { + Enumeration e =3D bundle.findEntries("/", fileNamePattern, true); //$N= ON-NLS-1$ + + while(e !=3D null && e.hasMoreElements()) { + URL fileURL =3D (URL) e.nextElement(); + if (justThisArchOSWS) { + Path filePath =3D new Path(fileURL.getPath()); + =09 + String[] path =3D filePath.segments(); + // check to see if the file should be extracted to the current os/ar= ch + if (path.length =3D=3D 4 && path[0].equals("os") && !(path[1].equals= (Platform.getOS()) && path[2].equals(Platform.getOSArch()))) { //$NON-NLS= -1$ + continue; + } + // check to see if the file is should be extracted to the current ws + if (path.length =3D=3D 3 && path[0].equals("ws") && !path[1].equals(= Platform.getWS())) { //$NON-NLS-1$ + continue; + } + } + =09 + // the call to Platform.asLocalURL(URL) does the actual extraction + URL localURL =3D Platform.asLocalURL(fileURL); + if (localURL !=3D null) { + String localURLPath =3D localURL.getPath(); + =09 + // only print the path if it hasn't been printed yet + int index =3D Collections.binarySearch(extractedFiles, localURLPath)= ; + if (index < 0) { + extractedFiles.add(-(index + 1), localURLPath); + System.out.println("FileInitializer: " + localURLPath); //$NON-NLS-= 1$ + } + } + } + } + + private final String ARG_FILE =3D "-fileInitializer"; //$NON-NLS-1$ +=09 + private Properties getBundleAndFileNamePatterns(String[] argsArray) { + =09 + for (int i =3D 0; i < argsArray.length; i++) { + if (argsArray[i].equalsIgnoreCase(ARG_FILE)) { + + // the "file patterns" file was not specified + if (argsArray.length < i + 2) { + String msg =3D NLS.bind(Messages.fileInitializer_missingFileName, t= his.getClass().getName()); + IStatus status =3D new Status(IStatus.ERROR, Platform.PI_RUNTIME, P= latform.PLUGIN_ERROR, msg, null); + InternalPlatform.getDefault().log(status); + return null; + } + =09 + try { + FileInputStream fin =3D new FileInputStream(argsArray[i + 1]); + Properties bundleAndFileNameProperties =3D new Properties(); + bundleAndFileNameProperties.load(fin); + fin.close(); + return bundleAndFileNameProperties; + } catch (FileNotFoundException e1) { + String msg =3D NLS.bind(Messages.fileInitializer_fileNotFound, this= .getClass().getName(), argsArray[i + 1]); + IStatus status =3D new Status(IStatus.ERROR, Platform.PI_RUNTIME, P= latform.PLUGIN_ERROR, msg, null); + InternalPlatform.getDefault().log(status); + return null; + } catch (IOException e) { + String msg =3D NLS.bind(Messages.fileInitializer_IOError, this.getC= lass().getName(), argsArray[i + 1]); + IStatus status =3D new Status(IStatus.ERROR, Platform.PI_RUNTIME, P= latform.PLUGIN_ERROR, msg, e); + InternalPlatform.getDefault().log(status); + return null; + } + } + } + =09 + // ARG_FILE wasn't found + return null; + } +=09 + private final String ARG_JUSTTHISARCHOSWS =3D "-justThisArchOSWS"; //$N= ON-NLS-1$ +=09 + private boolean getJustThisArchOSWS(String[] argsArray) { + for (int i =3D 0; i < argsArray.length; i++) { + if (argsArray[i].equalsIgnoreCase(ARG_JUSTTHISARCHOSWS)) { + return true; + } + } + return false; + } +} Index: src/org/eclipse/core/internal/runtime/Initializer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: src/org/eclipse/core/internal/runtime/Initializer.java diff -N src/org/eclipse/core/internal/runtime/Initializer.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/core/internal/runtime/Initializer.java 1 Jan 1970 00:= 00:00 -0000 @@ -0,0 +1,49 @@ +/***********************************************************************= ******** +* Copyright (c) 2005 Red Hat, Inc. and others. +* All rights reserved. This program and the accompanying materials +* are made available under the terms of the Eclipse Public License v1.0 +* which accompanies this distribution, and is available at +* http://www.eclipse.org/legal/epl-v10.html +*=20 +* Contributors: +* IBM - Initial implementation +************************************************************************= *******/ +package org.eclipse.core.internal.runtime; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtension; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.IPlatformRunnable; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.osgi.util.NLS; + +public class Initializer implements IPlatformRunnable { + + public Object run(Object args) throws Exception { + IExtensionPoint xpt =3D Platform.getExtensionRegistry().getExtensionPo= int(Platform.PI_RUNTIME, Platform.PT_INITIALIZERS); + if (xpt =3D=3D null) + return IPlatformRunnable.EXIT_OK; + =09 + IExtension[] exts =3D xpt.getExtensions(); + for (int i =3D 0; i < exts.length; i++) { + IConfigurationElement[] configs =3D exts[i].getConfigurationElements(= ); + IPlatformRunnable initializer =3D null; + if (configs.length !=3D 0) { + try { + initializer =3D (IPlatformRunnable) configs[0].createExecutableExte= nsion("initialize"); //$NON-NLS-1$ + initializer.run(args); + } catch(CoreException e) { + String msg =3D NLS.bind(Messages.initializer_error, exts[i].getExte= nsionPointUniqueIdentifier()); + IStatus status =3D new Status(IStatus.ERROR, Platform.PI_RUNTIME, P= latform.PLUGIN_ERROR, msg, e); + InternalPlatform.getDefault().log(status); + return null; + } + } + } + return IPlatformRunnable.EXIT_OK; + } + +} --=20 gentoo-commits@lists.gentoo.org mailing list