File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import Control.Lens hiding ( (<.>) )
11
11
import Control.Monad
12
12
import Data.Aeson
13
13
import qualified Data.ByteString.Char8 as BS
14
+ import qualified Data.List as List
14
15
import Data.Map as Map
15
16
import Data.Set as Set
16
17
import Data.String
@@ -38,7 +39,7 @@ readHackage path = getSubDirs path >>= foldM discoverPackageVersions mempty
38
39
getSubDirs :: FilePath -> IO [FilePath ]
39
40
getSubDirs path = do
40
41
let isDirectory p = doesDirectoryExist (path </> p)
41
- getDirectoryContents path >>= filterM isDirectory . Prelude. filter (\ x -> head x /= ' . ' )
42
+ getDirectoryContents path >>= filterM isDirectory . Prelude. filter (not . List. isPrefixOf " . " )
42
43
43
44
type SHA256Hash = String
44
45
Original file line number Diff line number Diff line change @@ -258,12 +258,12 @@ fetchWith (supportsRev, kind) source = do
258
258
[] -> error " This can't happen, but GHC doesn't know that."
259
259
(x: xs) -> (x,xs)
260
260
buf' = BS. unlines (reverse ls)
261
- case length ls of
262
- 0 -> return Nothing
263
- 1 -> return (Just (DerivationSource { derivKind = Just kind
261
+ case ls of
262
+ [] -> return Nothing
263
+ [hash] -> return (Just (DerivationSource { derivKind = Just kind
264
264
, derivUrl = sourceUrl source
265
265
, derivRevision = " "
266
- , derivHash = BS. unpack ( head ls)
266
+ , derivHash = BS. unpack hash
267
267
, derivSubmodule = Nothing
268
268
}
269
269
, BS. unpack l))
You can’t perform that action at this time.
0 commit comments