Preserve mtimes on unpacked GHC tarballs on windows wrt #187
This commit is contained in:
@@ -384,6 +384,7 @@ data Dirs = Dirs
|
||||
, cacheDir :: FilePath
|
||||
, logsDir :: FilePath
|
||||
, confDir :: FilePath
|
||||
, tmpDir :: FilePath
|
||||
}
|
||||
deriving (Show, GHC.Generic)
|
||||
|
||||
|
||||
@@ -1086,19 +1086,14 @@ ensureGlobalTools = do
|
||||
|
||||
-- | Ensure ghcup directory structure exists.
|
||||
ensureDirectories :: Dirs -> IO ()
|
||||
ensureDirectories dirs = do
|
||||
let Dirs
|
||||
{ baseDir
|
||||
, binDir
|
||||
, cacheDir
|
||||
, logsDir
|
||||
, confDir
|
||||
} = dirs
|
||||
ensureDirectories (Dirs baseDir binDir cacheDir logsDir confDir tmpDir) = do
|
||||
createDirRecursive' baseDir
|
||||
createDirRecursive' (baseDir </> "ghc")
|
||||
createDirRecursive' binDir
|
||||
createDirRecursive' cacheDir
|
||||
createDirRecursive' logsDir
|
||||
createDirRecursive' confDir
|
||||
createDirRecursive' tmpDir
|
||||
pure ()
|
||||
|
||||
|
||||
|
||||
@@ -191,6 +191,15 @@ ghcupLogsDir = do
|
||||
#endif
|
||||
|
||||
|
||||
-- | Defaults to '~/.ghcup/tmp.
|
||||
--
|
||||
-- If 'GHCUP_USE_XDG_DIRS' is set (to anything),
|
||||
-- then uses 'XDG_DATA_HOME/ghcup/tmp' as per xdg spec.
|
||||
ghcupTmpDir :: IO FilePath
|
||||
ghcupTmpDir = ghcupBaseDir <&> (</> "tmp")
|
||||
|
||||
|
||||
|
||||
getAllDirs :: IO Dirs
|
||||
getAllDirs = do
|
||||
baseDir <- ghcupBaseDir
|
||||
@@ -198,6 +207,7 @@ getAllDirs = do
|
||||
cacheDir <- ghcupCacheDir
|
||||
logsDir <- ghcupLogsDir
|
||||
confDir <- ghcupConfigDir
|
||||
tmpDir <- ghcupTmpDir
|
||||
pure Dirs { .. }
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user