Commit fa577840 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Get rid of partial functions.

parent 6a09a6b9
......@@ -76,17 +76,18 @@ libffiRules = do
createDirectory $ buildRootPath -/- stageString Stage0
tarballs <- getDirectoryFiles "" ["libffi-tarballs/libffi*.tar.gz"]
when (length tarballs /= 1) $
putError $ "libffiRules: exactly one libffi tarball expected"
++ "(found: " ++ show tarballs ++ ")."
tarball <- case tarballs of
[file] -> return $ unifyPath file
_ -> putError $ "libffiRules: exactly one tarball expected"
++ "(found: " ++ show tarballs ++ ")."
need tarballs
let libname = dropExtension . dropExtension . takeFileName $ head tarballs
need [tarball]
let libname = dropExtension . dropExtension $ takeFileName tarball
removeDirectory (buildRootPath -/- libname)
-- TODO: Simplify.
actionFinally (do
build $ Target libffiContext Tar tarballs [buildRootPath]
build $ Target libffiContext Tar [tarball] [buildRootPath]
moveDirectory (buildRootPath -/- libname) libffiBuildPath) $
removeFiles buildRootPath [libname <//> "*"]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment