Merge branch 'ospath-mk1'

This commit is contained in:
Joey Hess 2025-01-30 15:05:18 -04:00
commit c2a48f1fa0
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 12 additions and 9 deletions

View file

@ -35,7 +35,9 @@ import System.File.OsPath
-- https://github.com/haskell/file-io/issues/39
import Utility.Path.Windows
import Utility.OsPath
import System.OsPath
import System.IO (IO, Handle, IOMode)
import Prelude (return)
import qualified System.File.OsPath as O
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as L
@ -84,7 +86,10 @@ appendFile' f b = do
openTempFile :: OsPath -> OsPath -> IO (OsPath, Handle)
openTempFile p s = do
p' <- toOsPath <$> convertToWindowsNativeNamespace (fromOsPath p)
O.openTempFile p' s
(t, h) <- O.openTempFile p' s
-- Avoid returning mangled path from convertToWindowsNativeNamespace
let t' = p </> takeFileName t
return (t', h)
#endif
#else

View file

@ -333,14 +333,12 @@ Executable git-annex
P2P.Http.State
if flag(OsPath)
-- Currently this build flag does not pass the test suite on Windows
if (! os(windows))
Build-Depends:
os-string (>= 2.0.0),
directory (>= 1.3.8.3),
filepath (>= 1.5.2.0),
file-io (>= 0.1.3)
CPP-Options: -DWITH_OSPATH
Build-Depends:
os-string (>= 2.0.0),
directory (>= 1.3.8.3),
filepath (>= 1.5.2.0),
file-io (>= 0.1.3)
CPP-Options: -DWITH_OSPATH
if (os(windows))
Build-Depends: