throw exception if library copy fails

This commit is contained in:
Joey Hess 2016-01-14 17:56:21 -04:00
parent 196d39a813
commit 6a5e241a74
Failed to extract signature

View file

@ -12,6 +12,7 @@ import Data.Maybe
import System.FilePath
import System.Directory
import Control.Monad
import Control.Monad.IfElse
import Data.List
import Data.String.Utils
import Control.Applicative
@ -53,9 +54,10 @@ installLibs appbase replacement_libs libmap = do
, do
createDirectoryIfMissing True (parentDir dest)
putStrLn $ "installing " ++ pathlib ++ " as " ++ shortlib
_ <- boolSystem "cp" [File pathlib, File dest]
_ <- boolSystem "chmod" [Param "644", File dest]
_ <- boolSystem "ln" [Param "-s", File fulllib, File symdest]
unlessM (boolSystem "cp" [File pathlib, File dest]
<&&> boolSystem "chmod" [Param "644", File dest]
<&&> boolSystem "ln" [Param "-s", File fulllib, File symdest]) $
error "library install failed"
return $ Just appbase
)
return (catMaybes libs, replacement_libs', libmap')