-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6519 from phadej/copy_on_windows
Copy on windows
- Loading branch information
Showing
9 changed files
with
124 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,58 @@ | ||
{-# LANGUAGE CPP #-} | ||
module Distribution.Client.Compat.Directory (setModificationTime) where | ||
module Distribution.Client.Compat.Directory ( | ||
setModificationTime, | ||
createFileLink, | ||
pathIsSymbolicLink, | ||
getSymbolicLinkTarget, | ||
) where | ||
|
||
#if MIN_VERSION_directory(1,2,3) | ||
import System.Directory (setModificationTime) | ||
#else | ||
|
||
import Data.Time.Clock (UTCTime) | ||
#endif | ||
|
||
#if MIN_VERSION_directory(1,3,1) | ||
import System.Directory (createFileLink, getSymbolicLinkTarget, pathIsSymbolicLink) | ||
#elif defined(MIN_VERSION_unix) | ||
import System.Posix.Files (createSymbolicLink, getSymbolicLinkStatus, isSymbolicLink, readSymbolicLink) | ||
#endif | ||
|
||
------------------------------------------------------------------------------- | ||
-- setModificationTime | ||
------------------------------------------------------------------------------- | ||
|
||
#if !MIN_VERSION_directory(1,2,3) | ||
|
||
setModificationTime :: FilePath -> UTCTime -> IO () | ||
setModificationTime _fp _t = return () | ||
|
||
#endif | ||
|
||
------------------------------------------------------------------------------- | ||
-- Symlink | ||
------------------------------------------------------------------------------- | ||
|
||
#if MIN_VERSION_directory(1,3,1) | ||
#elif defined(MIN_VERSION_unix) | ||
createFileLink :: FilePath -> FilePath -> IO () | ||
createFileLink = createSymbolicLink | ||
|
||
pathIsSymbolicLink :: FilePath -> IO Bool | ||
pathIsSymbolicLink fp = do | ||
status <- getSymbolicLinkStatus fp | ||
return (isSymbolicLink status) | ||
|
||
getSymbolicLinkTarget :: FilePath -> IO FilePath | ||
getSymbolicLinkTarget = readSymbolicLink | ||
|
||
#else | ||
createFileLink :: FilePath -> FilePath -> IO () | ||
createFileLink _ _ = fail "Symlinking feature not available" | ||
|
||
pathIsSymbolicLink :: FilePath -> IO Bool | ||
pathIsSymbolicLink _ = fail "Symlinking feature not available" | ||
|
||
getSymbolicLinkTarget :: FilePath -> IO FilePath | ||
getSymbolicLinkTarget _ = fail "Symlinking feature not available" | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ | |
* Use `hackage-security-0.6` | ||
([#6388](https://github.com/haskell/cabal/pull/6388)) | ||
* Other dependency upgrades | ||
* On windows use copy as the default install method for executables | ||
|
||
3.0.0.0 Mikhail Glushenkov <[email protected]> August 2019 | ||
* `v2-haddock` fails on `haddock` failures (#5977) | ||
|