throw exception if library copy fails
This commit is contained in:
parent
196d39a813
commit
6a5e241a74
1 changed files with 5 additions and 3 deletions
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue