From 3a04af7927afaac9aa65e65157201c35304df964 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 27 Dec 2019 19:29:09 -0400 Subject: [PATCH] temporary revert "use conversion functions from filepath-bytestring" This reverts commit 75c40279c1600da157c2ba0981989da9eaf1c502. Debian unstable is one version too old, so this can be de-reverted in a bit. --- Utility/FileSystemEncoding.hs | 17 +++++++++++++---- git-annex.cabal | 2 +- stack.yaml | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Utility/FileSystemEncoding.hs b/Utility/FileSystemEncoding.hs index 4c099ff3a4..f9e98145a7 100644 --- a/Utility/FileSystemEncoding.hs +++ b/Utility/FileSystemEncoding.hs @@ -43,7 +43,6 @@ 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 @@ -172,11 +171,21 @@ encodeBL' = L.pack . decodeW8 encodeBL' = L8.fromString #endif -fromRawFilePath :: RawFilePath -> FilePath -fromRawFilePath = decodeFilePath +{- 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' + +{- 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 = encodeFilePath +toRawFilePath = encodeBS' {- Converts a [Word8] to a FilePath, encoding using the filesystem encoding. - diff --git a/git-annex.cabal b/git-annex.cabal index b0c9efdaca..a32c400bac 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -321,7 +321,7 @@ Executable git-annex directory (>= 1.2), disk-free-space, filepath, - filepath-bytestring (>= 1.4.2.1.1), + filepath-bytestring, IfElse, hslogger, monad-logger, diff --git a/stack.yaml b/stack.yaml index 887fd68529..dde1d76583 100644 --- a/stack.yaml +++ b/stack.yaml @@ -24,7 +24,7 @@ extra-deps: - sandi-0.5 - http-client-0.5.14 - silently-1.2.5.1 -- filepath-bytestring-1.4.2.1.1 +- filepath-bytestring-1.4.2.1.0 explicit-setup-deps: git-annex: true resolver: lts-13.29