From dd52d8ebdc1ab707dba70aa431725297b6250aaf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 9 Nov 2020 12:06:53 -0400 Subject: [PATCH] update after RawFilePath transition --- Build/LinuxMkLibs.hs | 14 +++++++----- Build/OSXMkLibs.hs | 3 ++- Build/Standalone.hs | 24 +++++++++++++++------ Utility/RawFilePath.hs | 1 + doc/bugs/make_debianstandalone_-_FTBFS.mdwn | 2 ++ 5 files changed, 31 insertions(+), 13 deletions(-) diff --git a/Build/LinuxMkLibs.hs b/Build/LinuxMkLibs.hs index 5f3c8e9dc7..d6d7df62fa 100644 --- a/Build/LinuxMkLibs.hs +++ b/Build/LinuxMkLibs.hs @@ -21,8 +21,10 @@ import Utility.Directory import Utility.Process import Utility.Monad import Utility.Path +import Utility.Path.AbsRel import Utility.FileMode import Utility.CopyFile +import Utility.FileSystemEncoding mklibs :: FilePath -> a -> IO Bool mklibs top _installedbins = do @@ -42,7 +44,7 @@ mklibs top _installedbins = do -- Various files used by runshell to set up env vars used by the -- linker shims. writeFile (top "libdirs") (unlines libdirs') - writeFile (top "gconvdir") (parentDir $ Prelude.head gconvlibs) + writeFile (top "gconvdir") (fromRawFilePath $ parentDir $ toRawFilePath $ Prelude.head gconvlibs) mapM_ (installLib installFile top) linkers let linker = Prelude.head linkers @@ -107,16 +109,18 @@ installLinkerShim top linker exe = do createSymbolicLink sl' exedest , renameFile exe exedest ) - link <- relPathDirToFile (top exedir) (top ++ linker) + link <- relPathDirToFile + (toRawFilePath (top exedir)) + (toRawFilePath (top ++ linker)) unlessM (doesFileExist (top exelink)) $ - createSymbolicLink link (top exelink) + createSymbolicLink (fromRawFilePath link) (top exelink) writeFile exe $ unlines [ "#!/bin/sh" , "GIT_ANNEX_PROGRAMPATH=\"$0\"" , "export GIT_ANNEX_PROGRAMPATH" , "exec \"$GIT_ANNEX_DIR/" ++ exelink ++ "\" --library-path \"$GIT_ANNEX_LD_LIBRARY_PATH\" \"$GIT_ANNEX_DIR/shimmed/" ++ base ++ "/" ++ base ++ "\" \"$@\"" ] - modifyFileMode exe $ addModes executeModes + modifyFileMode (toRawFilePath exe) $ addModes executeModes where base = takeFileName exe shimdir = "shimmed" base @@ -129,7 +133,7 @@ installFile top f = do createDirectoryIfMissing True destdir void $ copyFileExternal CopyTimeStamps f destdir where - destdir = inTop top $ parentDir f + destdir = inTop top $ fromRawFilePath $ parentDir $ toRawFilePath f checkExe :: FilePath -> IO Bool checkExe f diff --git a/Build/OSXMkLibs.hs b/Build/OSXMkLibs.hs index 72b5d0156d..b79cfa84d0 100644 --- a/Build/OSXMkLibs.hs +++ b/Build/OSXMkLibs.hs @@ -24,6 +24,7 @@ import Utility.Path import Utility.Exception import Utility.Env import Utility.Split +import Utility.FileSystemEncoding import qualified Data.Map as M import qualified Data.Set as S @@ -63,7 +64,7 @@ installLibs appbase installedbins replacement_libs libmap = do ifM (doesFileExist dest) ( return Nothing , do - createDirectoryIfMissing True (parentDir dest) + createDirectoryIfMissing True (fromRawFilePath (parentDir (toRawFilePath dest))) putStrLn $ "installing " ++ pathlib ++ " as " ++ shortlib unlessM (boolSystem "cp" [File pathlib, File dest] <&&> boolSystem "chmod" [Param "644", File dest] diff --git a/Build/Standalone.hs b/Build/Standalone.hs index f39322db59..98c3b2cc89 100644 --- a/Build/Standalone.hs +++ b/Build/Standalone.hs @@ -21,8 +21,10 @@ import qualified Data.Map as M import Utility.SafeCommand import Utility.Process import Utility.Path +import Utility.Path.AbsRel import Utility.Directory import Utility.Env +import Utility.FileSystemEncoding import Build.BundledPrograms #ifdef darwin_HOST_OS import System.IO @@ -71,8 +73,10 @@ installGitLibs topdir = do execpath <- getgitpath "exec-path" cfs <- dirContents execpath forM_ cfs $ \f -> do - destf <- (gitcoredestdir ) - <$> relPathDirToFile execpath f + destf <- ((gitcoredestdir ) . fromRawFilePath) + <$> relPathDirToFile + (toRawFilePath execpath) + (toRawFilePath f) createDirectoryIfMissing True (takeDirectory destf) issymlink <- isSymbolicLink <$> getSymbolicLinkStatus f if issymlink @@ -96,8 +100,10 @@ installGitLibs topdir = do createDirectoryIfMissing True (takeDirectory linktarget') L.readFile f >>= L.writeFile linktarget' removeWhenExistsWith removeLink destf - rellinktarget <- relPathDirToFile (takeDirectory destf) linktarget' - createSymbolicLink rellinktarget destf + rellinktarget <- relPathDirToFile + (toRawFilePath (takeDirectory destf)) + (toRawFilePath linktarget') + createSymbolicLink (fromRawFilePath rellinktarget) destf else cp f destf -- install git's template files @@ -108,8 +114,10 @@ installGitLibs topdir = do let templatepath = manpath ".." "git-core" "templates" tfs <- dirContents templatepath forM_ tfs $ \f -> do - destf <- (templatedestdir ) - <$> relPathDirToFile templatepath f + destf <- ((templatedestdir ) . fromRawFilePath) + <$> relPathDirToFile + (toRawFilePath templatepath) + (toRawFilePath f) createDirectoryIfMissing True (takeDirectory destf) cp f destf where @@ -187,7 +195,9 @@ installSkelRest topdir _basedir hwcaplibs = do gapi <- getEnv "GIT_ANNEX_PACKAGE_INSTALL" writeFile (topdir "runshell") (unlines (map (expandrunshell gapi) runshell)) - modifyFileMode (topdir "runshell") (addModes executeModes) + modifyFileMode + (toRawFilePath (topdir "runshell")) + (addModes executeModes) where expandrunshell (Just gapi) l@"GIT_ANNEX_PACKAGE_INSTALL=" = l ++ gapi -- This is an optimisation, that avoids the linker looking in diff --git a/Utility/RawFilePath.hs b/Utility/RawFilePath.hs index 79b0545f48..568595dac4 100644 --- a/Utility/RawFilePath.hs +++ b/Utility/RawFilePath.hs @@ -13,6 +13,7 @@ -} {-# LANGUAGE CPP #-} +{-# OPTIONS_GHC -fno-warn-tabs #-} module Utility.RawFilePath ( RawFilePath, diff --git a/doc/bugs/make_debianstandalone_-_FTBFS.mdwn b/doc/bugs/make_debianstandalone_-_FTBFS.mdwn index 7d85e7dc5f..c202f2046e 100644 --- a/doc/bugs/make_debianstandalone_-_FTBFS.mdwn +++ b/doc/bugs/make_debianstandalone_-_FTBFS.mdwn @@ -101,3 +101,5 @@ $> git describe 8.20201103-34-gd8e8d145e ``` ``` + +> [[fixed|done]] --[[Joey]] -- 2.30.2