revert parentDir change
Reverts 965e106f24
Unfortunately, this caused breakage on Windows, and possibly elsewhere,
because parentDir and takeDirectory do not behave the same when there is a
trailing directory separator.
This commit is contained in:
parent
2fff78512d
commit
3bab5dfb1d
47 changed files with 99 additions and 96 deletions
|
@ -22,7 +22,6 @@ 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
|
||||
|
@ -76,6 +75,6 @@ install command = do
|
|||
( return ()
|
||||
, do
|
||||
programfile <- inDestDir =<< programFile
|
||||
createDirectoryIfMissing True (takeDirectory programfile)
|
||||
createDirectoryIfMissing True (parentDir programfile)
|
||||
writeFile programfile command
|
||||
)
|
||||
|
|
|
@ -64,7 +64,7 @@ getbuild repodir (url, f) = do
|
|||
let dest = repodir </> f
|
||||
let tmp = dest ++ ".tmp"
|
||||
nukeFile tmp
|
||||
createDirectoryIfMissing True (takeDirectory dest)
|
||||
createDirectoryIfMissing True (parentDir dest)
|
||||
let oops s = do
|
||||
nukeFile tmp
|
||||
putStrLn $ "*** " ++ s
|
||||
|
|
|
@ -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 (takeDirectory dest)
|
||||
createDirectoryIfMissing True (parentDir dest)
|
||||
let newcontent = concat $ addimports $ expand lls splices
|
||||
oldcontent <- catchMaybeIO $ readFileStrictAnyEncoding dest
|
||||
when (oldcontent /= Just newcontent) $ do
|
||||
|
|
|
@ -47,7 +47,7 @@ mklibs top = do
|
|||
writeFile (top </> "linker")
|
||||
(Prelude.head $ filter ("ld-linux" `isInfixOf`) libs')
|
||||
writeFile (top </> "gconvdir")
|
||||
(takeDirectory $ Prelude.head $ filter ("/gconv/" `isInfixOf`) glibclibs)
|
||||
(parentDir $ 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 (takeDirectory f) l
|
||||
let absl = absPathFrom (parentDir 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 $ takeDirectory f
|
||||
destdir = inTop top $ parentDir f
|
||||
|
||||
checkExe :: FilePath -> IO Bool
|
||||
checkExe f
|
||||
|
|
|
@ -50,7 +50,7 @@ installLibs appbase replacement_libs libmap = do
|
|||
ifM (doesFileExist dest)
|
||||
( return Nothing
|
||||
, do
|
||||
createDirectoryIfMissing True (takeDirectory dest)
|
||||
createDirectoryIfMissing True (parentDir dest)
|
||||
putStrLn $ "installing " ++ pathlib ++ " as " ++ shortlib
|
||||
_ <- boolSystem "cp" [File pathlib, File dest]
|
||||
_ <- boolSystem "chmod" [Param "644", File dest]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue