felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject svn commit: r498680 - /incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/R4LibraryClause.java
Date Mon, 22 Jan 2007 16:32:47 GMT
Author: pauls
Date: Mon Jan 22 08:32:47 2007
New Revision: 498680

URL: http://svn.apache.org/viewvc?view=rev&rev=498680
Log:
Improve normalization for native library matching (FELIX-26).

Modified:
    incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/R4LibraryClause.java

Modified: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/R4LibraryClause.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/R4LibraryClause.java?view=diff&rev=498680&r1=498679&r2=498680
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/R4LibraryClause.java
(original)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/R4LibraryClause.java
Mon Jan 22 08:32:47 2007
@@ -289,15 +289,15 @@
                     // Add the value to its corresponding property list.
                     if (property.equals(Constants.BUNDLE_NATIVECODE_OSNAME))
                     {
-                        osNameList.add(value);
+                        osNameList.add(normalizeOSName(value));
                     }
                     else if (property.equals(Constants.BUNDLE_NATIVECODE_OSVERSION))
                     {
-                        osVersionList.add(value);
+                        osVersionList.add(normalizeOSVersion(value));
                     }
                     else if (property.equals(Constants.BUNDLE_NATIVECODE_PROCESSOR))
                     {
-                        processorList.add(value);
+                        processorList.add(normalizeProcessor(value));
                     }
                     else if (property.equals(Constants.BUNDLE_NATIVECODE_LANGUAGE))
                     {
@@ -321,10 +321,10 @@
             System.arraycopy(libFiles, 0, actualLibFiles, 0, libCount);
             return new R4LibraryClause(
                 actualLibFiles,
-                (String[]) osNameList.toArray(new String[0]),
-                (String[]) processorList.toArray(new String[0]),
-                (String[]) osVersionList.toArray(new String[0]),
-                (String[]) languageList.toArray(new String[0]),
+                (String[]) osNameList.toArray(new String[osNameList.size()]),
+                (String[]) processorList.toArray(new String[processorList.size()]),
+                (String[]) osVersionList.toArray(new String[osVersionList.size()]),
+                (String[]) languageList.toArray(new String[languageList.size()]),
                 selectionFilter);
         }
         catch (RuntimeException ex)
@@ -337,6 +337,8 @@
 
     public static String normalizeOSName(String value)
     {
+        value = value.toLowerCase();
+
         if (value.startsWith("win"))
         {
             String os = "win";
@@ -390,7 +392,7 @@
         {
             return "irix";
         }
-        else if (value.startsWith("macos"))
+        else if (value.startsWith("macos") || value.startsWith("mac os"))
         {
             return "macos";
         }
@@ -431,6 +433,8 @@
 
     public static String normalizeProcessor(String value)
     {
+        value = value.toLowerCase();
+
         if (value.startsWith("x86") || value.startsWith("pentium")
             || value.startsWith("i386") || value.startsWith("i486")
             || value.startsWith("i586") || value.startsWith("i686"))



Mime
View raw message