summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
Diffstat (limited to 'Build')
-rw-r--r--Build/DesktopFile.hs3
-rw-r--r--Build/DistributionUpdate.hs2
-rw-r--r--Build/EvilSplicer.hs2
-rw-r--r--Build/LinuxMkLibs.hs6
-rw-r--r--Build/OSXMkLibs.hs2
5 files changed, 8 insertions, 7 deletions
diff --git a/Build/DesktopFile.hs b/Build/DesktopFile.hs
index 6a5838f81..5eab68756 100644
--- a/Build/DesktopFile.hs
+++ b/Build/DesktopFile.hs
@@ -22,6 +22,7 @@ import Assistant.Install.Menu
import Control.Applicative
import System.Directory
import System.Environment
+import System.FilePath
#ifndef mingw32_HOST_OS
import System.Posix.User
#endif
@@ -75,6 +76,6 @@ install command = do
( return ()
, do
programfile <- inDestDir =<< programFile
- createDirectoryIfMissing True (parentDir programfile)
+ createDirectoryIfMissing True (takeDirectory programfile)
writeFile programfile command
)
diff --git a/Build/DistributionUpdate.hs b/Build/DistributionUpdate.hs
index 2058f4be4..d7fb373c8 100644
--- a/Build/DistributionUpdate.hs
+++ b/Build/DistributionUpdate.hs
@@ -64,7 +64,7 @@ getbuild repodir (url, f) = do
let dest = repodir </> f
let tmp = dest ++ ".tmp"
nukeFile tmp
- createDirectoryIfMissing True (parentDir dest)
+ createDirectoryIfMissing True (takeDirectory dest)
let oops s = do
nukeFile tmp
putStrLn $ "*** " ++ s
diff --git a/Build/EvilSplicer.hs b/Build/EvilSplicer.hs
index fc41c624f..81d4e37c7 100644
--- a/Build/EvilSplicer.hs
+++ b/Build/EvilSplicer.hs
@@ -204,7 +204,7 @@ applySplices destdir imports splices@(first:_) = do
let f = splicedFile first
let dest = (destdir </> f)
lls <- map (++ "\n") . lines <$> readFileStrictAnyEncoding f
- createDirectoryIfMissing True (parentDir dest)
+ createDirectoryIfMissing True (takeDirectory dest)
let newcontent = concat $ addimports $ expand lls splices
oldcontent <- catchMaybeIO $ readFileStrictAnyEncoding dest
when (oldcontent /= Just newcontent) $ do
diff --git a/Build/LinuxMkLibs.hs b/Build/LinuxMkLibs.hs
index 1ca2fa651..f3a7c3b2e 100644
--- a/Build/LinuxMkLibs.hs
+++ b/Build/LinuxMkLibs.hs
@@ -47,7 +47,7 @@ mklibs top = do
writeFile (top </> "linker")
(Prelude.head $ filter ("ld-linux" `isInfixOf`) libs')
writeFile (top </> "gconvdir")
- (parentDir $ Prelude.head $ filter ("/gconv/" `isInfixOf`) glibclibs)
+ (takeDirectory $ Prelude.head $ filter ("/gconv/" `isInfixOf`) glibclibs)
mapM_ (installLinkerShim top) exes
@@ -75,7 +75,7 @@ installLinkerShim top exe = do
symToHardLink :: FilePath -> IO ()
symToHardLink f = whenM (isSymbolicLink <$> getSymbolicLinkStatus f) $ do
l <- readSymbolicLink f
- let absl = absPathFrom (parentDir f) l
+ let absl = absPathFrom (takeDirectory f) l
nukeFile f
createLink absl f
@@ -84,7 +84,7 @@ installFile top f = do
createDirectoryIfMissing True destdir
void $ copyFileExternal CopyTimeStamps f destdir
where
- destdir = inTop top $ parentDir f
+ destdir = inTop top $ takeDirectory f
checkExe :: FilePath -> IO Bool
checkExe f
diff --git a/Build/OSXMkLibs.hs b/Build/OSXMkLibs.hs
index ef668bb4a..57f74f0e0 100644
--- a/Build/OSXMkLibs.hs
+++ b/Build/OSXMkLibs.hs
@@ -50,7 +50,7 @@ installLibs appbase replacement_libs libmap = do
ifM (doesFileExist dest)
( return Nothing
, do
- createDirectoryIfMissing True (parentDir dest)
+ createDirectoryIfMissing True (takeDirectory dest)
putStrLn $ "installing " ++ pathlib ++ " as " ++ shortlib
_ <- boolSystem "cp" [File pathlib, File dest]
_ <- boolSystem "chmod" [Param "644", File dest]