<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -21,12 +21,7 @@ module Digest where
 --
 -- A few imports, should tidy these up one day.
 --
-#if __GLASGOW_HASKELL__ &gt;= 608
-import qualified Data.ByteString.Unsafe as B (unsafeUseAsCStringLen)
-#else
-import qualified Data.ByteString.Base   as B (unsafeUseAsCStringLen)
-#endif
-import qualified Data.ByteString      as B
+import qualified Data.ByteString.Char8 as B
 import Foreign
 import Foreign.C.Types
 import Numeric                        (showHex)
@@ -53,7 +48,7 @@ ripemd160_digest_length = 20
 -- While this md5sum binding will return:
 --
 md5sum :: B.ByteString -&gt; String
-md5sum p = unsafePerformIO $ B.unsafeUseAsCStringLen p $ \(ptr,n) -&gt; do
+md5sum p = unsafePerformIO $ B.useAsCStringLen p $ \(ptr,n) -&gt; do
     allocaBytes md5_digest_length $ \digest_ptr -&gt; do
         digest  &lt;- c_md5 ptr (fromIntegral n) digest_ptr
         go digest 0 []
@@ -74,7 +69,7 @@ md5sum p = unsafePerformIO $ B.unsafeUseAsCStringLen p $ \(ptr,n) -&gt; do
 #endif
 
 sha1sum :: B.ByteString -&gt; String
-sha1sum p = unsafePerformIO $ B.unsafeUseAsCStringLen p $ \(ptr,n) -&gt; do
+sha1sum p = unsafePerformIO $ B.useAsCStringLen p $ \(ptr,n) -&gt; do
     allocaBytes sha1_digest_length $ \digest_ptr -&gt; do
         digest  &lt;- c_sha1 ptr (fromIntegral n) digest_ptr
         go digest 0 []
@@ -95,7 +90,7 @@ sha1sum p = unsafePerformIO $ B.unsafeUseAsCStringLen p $ \(ptr,n) -&gt; do
 #endif
 
 ripemd160sum :: B.ByteString -&gt; String
-ripemd160sum p = unsafePerformIO $ B.unsafeUseAsCStringLen p $ \(ptr,n) -&gt; do
+ripemd160sum p = unsafePerformIO $ B.useAsCStringLen p $ \(ptr,n) -&gt; do
     allocaBytes ripemd160_digest_length $ \digest_ptr -&gt; do
         digest  &lt;- c_ripemd160 ptr (fromIntegral n) digest_ptr
         go digest 0 []</diff>
      <filename>Digest.hs</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@ module Main where
 
 import Digest
 
+import qualified Data.Set as DS
 import Data.Char (intToDigit)
 import Data.List ( sortBy, groupBy, maximumBy, intercalate, isPrefixOf )
 import Data.Maybe ( listToMaybe, fromJust, fromMaybe, isJust )
@@ -228,8 +229,7 @@ checksumURI uri = do
   let bytes = pack tarballData
   return [ &quot;md5     &quot; ++ md5sum bytes
          , &quot;sha1    &quot; ++ sha1sum bytes
-         , &quot;rmd160  &quot; ++ ripemd160sum bytes
-         ]
+         , &quot;rmd160  &quot; ++ ripemd160sum bytes ]
 
 simpleVersion :: PackageDisplayInfo -&gt; String
 simpleVersion = showVersion . packageVersion . fromJust . latestAvailable
@@ -275,11 +275,20 @@ portfileEntries (&quot;configure_et_al&quot;, _)
       , &quot;&quot;
       , &quot;#pre-deactivate { system \&quot;${prefix}/libexec/${name}/unregister.sh\&quot; }&quot;
       ]
-portfileEntries (x, []) = x ++ &quot;\tNYI&quot;
-portfileEntries (x, y) = x ++ &quot;\t&quot; ++ y
+portfileEntries (x, []) = x
+portfileEntries (x, y)  = x ++ &quot;\t&quot; ++ y
 
 buildDependencies :: PackageDisplayInfo -&gt; String
-buildDependencies info = &quot;&quot;
+buildDependencies =   intercalate &quot; \\\n\t\t&quot; 
+                    . DS.toList . DS.fromList
+                    . deps . dependencies
+    where deps (x:xs) =
+              let (Dependency depName ver) = x
+                  (PackageName name)       = depName
+              in xlatdep name : deps xs
+                  where xlatdep &quot;base&quot; = &quot;port:ghc&quot;
+                        xlatdep n      = &quot;port:hs-&quot; ++ n
+          deps _ = []
 
 splitString :: String -&gt; String -&gt; [String]
 splitString = split' []
@@ -323,7 +332,7 @@ buildPortfile info sums
       , ([], [])
       , (&quot;checksums&quot;, sums)
       , ([], [])
-      , (&quot;depends_build&quot;, &quot;port:ghc&quot; ++ buildDependencies info)
+      , (&quot;depends_build&quot;, buildDependencies info)
       , ([], [])
       , (&quot;configure_et_al&quot;, [])
       ]</diff>
      <filename>Main.hs</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>bbb1ab294377913d242c436673edd1dfe66ad021</id>
    </parent>
  </parents>
  <author>
    <name>John Wiegley</name>
    <email>johnw@newartisans.com</email>
  </author>
  <url>http://github.com/jwiegley/hackports/commit/8808178c9d18761ad6fb03b713fa3923afc05f8b</url>
  <id>8808178c9d18761ad6fb03b713fa3923afc05f8b</id>
  <committed-date>2009-03-22T18:31:19-07:00</committed-date>
  <authored-date>2009-03-22T18:31:19-07:00</authored-date>
  <message>Package checksums are correctly generated now</message>
  <tree>c32f12719301f915691cdf4f83b9827c4b90548c</tree>
  <committer>
    <name>John Wiegley</name>
    <email>johnw@newartisans.com</email>
  </committer>
</commit>
