felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsav...@apache.org
Subject svn commit: r795214 - /felix/trunk/sigil/common/core/src/org/apache/felix/sigil/repository/AbstractBundleRepository.java
Date Fri, 17 Jul 2009 20:30:12 GMT
Author: dsavage
Date: Fri Jul 17 20:30:12 2009
New Revision: 795214

URL: http://svn.apache.org/viewvc?rev=795214&view=rev
Log:
fix for FELIX-1379

Modified:
    felix/trunk/sigil/common/core/src/org/apache/felix/sigil/repository/AbstractBundleRepository.java

Modified: felix/trunk/sigil/common/core/src/org/apache/felix/sigil/repository/AbstractBundleRepository.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/common/core/src/org/apache/felix/sigil/repository/AbstractBundleRepository.java?rev=795214&r1=795213&r2=795214&view=diff
==============================================================================
--- felix/trunk/sigil/common/core/src/org/apache/felix/sigil/repository/AbstractBundleRepository.java
(original)
+++ felix/trunk/sigil/common/core/src/org/apache/felix/sigil/repository/AbstractBundleRepository.java
Fri Jul 17 20:30:12 2009
@@ -236,24 +236,30 @@
 					info.setDescription( attrs.getValue( "Bundle-Description" ) );
 					info.setVendor( attrs.getValue( "Bundle-Vendor" ) );
 
-					String importStr = attrs.getValue( "Import-Package" );
-					if ( importStr != null ) {
-						addImports( info, importStr );
+					String str = attrs.getValue( "Import-Package" );
+					if ( str != null ) {
+						addImports( info, str );
 					}
-					String exportStr = attrs.getValue( "Export-Package" );
-					if ( exportStr != null ) {
-						addExports( info, exportStr );
+					
+					str = attrs.getValue( "Export-Package" );
+					if ( str != null ) {
+						addExports( info, str );
 					}
 
-					String reqStr = attrs.getValue( "Require-Bundle" );
-					if ( reqStr != null ) {
-						addRequires( info, reqStr );
+					str = attrs.getValue( "Require-Bundle" );
+					if ( str != null ) {
+						addRequires( info, str );
 					}
 
-					String cpStr = attrs.getValue( "Bundle-Classpath" );
+					str = attrs.getValue( "Bundle-Classpath" );
 
-					if ( cpStr != null ) {
-						addClasspath( info, cpStr );
+					if ( str != null ) {
+						addClasspath( info, str );
+					}
+					
+					str = attrs.getValue( "Fragment-Host" );
+					if ( str != null ) {
+						addHost(info, str);
 					}
 				}
 				catch (RuntimeException e) {
@@ -377,4 +383,22 @@
 			info.addRequiredBundle(req);
 		}
 	}
-}
+	
+	/**
+	 * @param info
+	 * @param str
+	 */
+	private void addHost(IBundleModelElement info, String str) {
+		String[] parts = str.split( ";" );
+		IRequiredBundle req = ModelElementFactory.getInstance().newModelElement(IRequiredBundle.class);
+		req.setSymbolicName( parts[0].trim() );
+		
+		if ( parts.length > 1 ) {
+			String part = parts[1].toLowerCase().trim();
+			if ( part.startsWith( "bundle-version=" ) ) {
+				req.setVersions( VersionRange.parseVersionRange(part.substring("bundle-version=".length())));
+			}
+		}
+		info.setFragmentHost(req);
+	}
+}
\ No newline at end of file



Mime
View raw message