Repository: enthought/okonomiyaki

Issue:
Okonomiyaki fails to parse existing RedHat3-built eggs
```python
    metadata = file_formats.EggMetadata.from_egg(path)
  File "okonomiyaki/file_formats/_egg_info.py", line 627, in from_egg
    spec_depend = LegacySpecDepend.from_egg(path_or_file)
  File "okonomiyaki/file_formats/_egg_info.py", line 387, in from_egg
    return cls.from_string(spec_depend_string)
  File "okonomiyaki/file_formats/_egg_info.py", line 391, in from_string
    data, epd_platform = _normalized_info_from_string(spec_depend_string)
  File "okonomiyaki/file_formats/_egg_info.py", line 562, in _normalized_info_from_string
    epd_platform = _epd_platform_from_raw_spec(data)
  File "okonomiyaki/file_formats/_egg_info.py", line 307, in _epd_platform_from_raw_spec
    platform_string, osdist_string, arch_string
  File "okonomiyaki/platforms/epd_platform.py", line 135, in _from_spec_depend_data
    raise ValueError(msg)
ValueError: Unrecognized platform/osdist combination: 'linux2'/'RedHat_3'
```

Discussion:

Patch:
diff --git a/CHANGELOG b/CHANGELOG
index 5e8f7ce..b21e68e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -5,6 +5,8 @@ Improvements:
 
   * EnpkgVersion.from_string now handles versions of the form `1.3.0`, with the
     build number being implicitly 0.
+  * EggMetadata.from_egg now handles eggs built for RedHat Enterprise
+    Linux 3 (#88).
 
 Internals:
 
diff --git a/okonomiyaki/platforms/epd_platform.py b/okonomiyaki/platforms/epd_platform.py
index ec327a9..433605a 100644
--- a/okonomiyaki/platforms/epd_platform.py
+++ b/okonomiyaki/platforms/epd_platform.py
@@ -136,7 +136,9 @@ class EPDPlatform(HasTraits):
         elif platform == "win32":
             epd_name = "win"
         elif platform.startswith("linux"):
-            if osdist in (None, "RedHat_5"):
+            if osdist == "RedHat_3":
+                epd_name = "rh3"
+            elif osdist in (None, "RedHat_5"):
                 epd_name = "rh5"
             elif osdist == "RedHat_6":
                 epd_name = "rh6"


Test patch:
diff --git a/okonomiyaki/platforms/tests/test_epd_platform.py b/okonomiyaki/platforms/tests/test_epd_platform.py
index e2d8729..b566340 100644
--- a/okonomiyaki/platforms/tests/test_epd_platform.py
+++ b/okonomiyaki/platforms/tests/test_epd_platform.py
@@ -327,6 +327,8 @@ class TestGuessEPDPlatform(unittest.TestCase):
         examples = (
             (("linux2", None, "x86"),
              EPDPlatform.from_epd_string("rh5-32"),),
+            (("linux2", "RedHat_3", "x86"),
+             EPDPlatform.from_epd_string("rh3-32"),),
             (("linux2", "RedHat_5", "x86"),
              EPDPlatform.from_epd_string("rh5-32"),),
             (("linux2", "RedHat_5", "amd64"),