From b68a8d8968957aa551d9e450f2cbf5b025072ed1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 4 Jan 2020 20:18:40 -0400 Subject: [PATCH] use conversion functions from filepath-bytestring (again) This reverts commit 3a04af7927afaac9aa65e65157201c35304df964. --- Utility/FileSystemEncoding.hs | 15 +++------------ git-annex.cabal | 4 ++-- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/Utility/FileSystemEncoding.hs b/Utility/FileSystemEncoding.hs index f9e98145a7..4c099ff3a4 100644 --- a/Utility/FileSystemEncoding.hs +++ b/Utility/FileSystemEncoding.hs @@ -43,6 +43,7 @@ import qualified Data.ByteString.Lazy as L import qualified Data.ByteString.UTF8 as S8 import qualified Data.ByteString.Lazy.UTF8 as L8 #endif +import System.FilePath.ByteString (RawFilePath, encodeFilePath, decodeFilePath) import Utility.Exception import Utility.Split @@ -171,21 +172,11 @@ encodeBL' = L.pack . decodeW8 encodeBL' = L8.fromString #endif -{- Recent versions of the unix package have this alias; defined here - - for backwards compatibility. -} -type RawFilePath = S.ByteString - -{- Note that the RawFilePath is assumed to never contain NUL, - - since filename's don't. This should only be used with actual - - RawFilePaths not arbitrary ByteString that may contain NUL. -} fromRawFilePath :: RawFilePath -> FilePath -fromRawFilePath = decodeBS' +fromRawFilePath = decodeFilePath -{- Note that the FilePath is assumed to never contain NUL, - - since filename's don't. This should only be used with actual FilePaths - - not arbitrary String that may contain NUL. -} toRawFilePath :: FilePath -> RawFilePath -toRawFilePath = encodeBS' +toRawFilePath = encodeFilePath {- Converts a [Word8] to a FilePath, encoding using the filesystem encoding. - diff --git a/git-annex.cabal b/git-annex.cabal index a45bf3627d..afd400b87a 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -296,7 +296,7 @@ source-repository head custom-setup Setup-Depends: base (>= 4.11.1.0), hslogger, split, unix-compat, process, filepath, exceptions, bytestring, directory, IfElse, data-default, - filepath-bytestring (>= 1.4.2.1.0), + filepath-bytestring (>= 1.4.2.1.1), utf8-string, transformers, Cabal Executable git-annex @@ -321,7 +321,7 @@ Executable git-annex directory (>= 1.2), disk-free-space, filepath, - filepath-bytestring (>= 1.4.2.1.0), + filepath-bytestring (>= 1.4.2.1.1), IfElse, hslogger, monad-logger, -- 2.30.2