remove unused functions from Utility.RawFilePath
This commit is contained in:
parent
f8bb9a8734
commit
780a379ab1
3 changed files with 1 additions and 28 deletions
|
@ -39,7 +39,6 @@ import Annex.Concurrent.Utility
|
||||||
import Types.Concurrency
|
import Types.Concurrency
|
||||||
import Git.Env
|
import Git.Env
|
||||||
import Git.Ssh
|
import Git.Ssh
|
||||||
import qualified Utility.RawFilePath as R
|
|
||||||
import qualified Utility.OsString as OS
|
import qualified Utility.OsString as OS
|
||||||
import Annex.Perms
|
import Annex.Perms
|
||||||
#ifndef mingw32_HOST_OS
|
#ifndef mingw32_HOST_OS
|
||||||
|
|
|
@ -40,13 +40,12 @@ import Git.FilePath
|
||||||
import qualified Git.Url as Url
|
import qualified Git.Url as Url
|
||||||
import Utility.UserInfo
|
import Utility.UserInfo
|
||||||
import Utility.Url.Parse
|
import Utility.Url.Parse
|
||||||
import qualified Utility.RawFilePath as R
|
|
||||||
import qualified Utility.OsString as OS
|
import qualified Utility.OsString as OS
|
||||||
|
|
||||||
{- Finds the git repository used for the cwd, which may be in a parent
|
{- Finds the git repository used for the cwd, which may be in a parent
|
||||||
- directory. -}
|
- directory. -}
|
||||||
fromCwd :: IO (Maybe Repo)
|
fromCwd :: IO (Maybe Repo)
|
||||||
fromCwd = R.getCurrentDirectory >>= seekUp . toOsPath
|
fromCwd = getCurrentDirectory >>= seekUp
|
||||||
where
|
where
|
||||||
seekUp dir = do
|
seekUp dir = do
|
||||||
r <- checkForRepo dir
|
r <- checkForRepo dir
|
||||||
|
|
|
@ -22,12 +22,8 @@ module Utility.RawFilePath (
|
||||||
readSymbolicLink,
|
readSymbolicLink,
|
||||||
createSymbolicLink,
|
createSymbolicLink,
|
||||||
createLink,
|
createLink,
|
||||||
removeLink,
|
|
||||||
getFileStatus,
|
getFileStatus,
|
||||||
getSymbolicLinkStatus,
|
getSymbolicLinkStatus,
|
||||||
doesPathExist,
|
|
||||||
getCurrentDirectory,
|
|
||||||
createDirectory,
|
|
||||||
setFileMode,
|
setFileMode,
|
||||||
setOwnerAndGroup,
|
setOwnerAndGroup,
|
||||||
rename,
|
rename,
|
||||||
|
@ -38,18 +34,6 @@ module Utility.RawFilePath (
|
||||||
#ifndef mingw32_HOST_OS
|
#ifndef mingw32_HOST_OS
|
||||||
import Utility.FileSystemEncoding (RawFilePath)
|
import Utility.FileSystemEncoding (RawFilePath)
|
||||||
import System.Posix.Files.ByteString
|
import System.Posix.Files.ByteString
|
||||||
import qualified System.Posix.Directory.ByteString as D
|
|
||||||
|
|
||||||
-- | Checks if a file or directory exists. Note that a dangling symlink
|
|
||||||
-- will be false.
|
|
||||||
doesPathExist :: RawFilePath -> IO Bool
|
|
||||||
doesPathExist = fileExist
|
|
||||||
|
|
||||||
getCurrentDirectory :: IO RawFilePath
|
|
||||||
getCurrentDirectory = D.getWorkingDirectory
|
|
||||||
|
|
||||||
createDirectory :: RawFilePath -> IO ()
|
|
||||||
createDirectory p = D.createDirectory p 0o777
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
import System.PosixCompat (FileStatus, FileMode)
|
import System.PosixCompat (FileStatus, FileMode)
|
||||||
|
@ -89,15 +73,6 @@ getSymbolicLinkStatus :: RawFilePath -> IO FileStatus
|
||||||
getSymbolicLinkStatus p = P.getSymbolicLinkStatus . fromRawFilePath
|
getSymbolicLinkStatus p = P.getSymbolicLinkStatus . fromRawFilePath
|
||||||
=<< convertToWindowsNativeNamespace p
|
=<< convertToWindowsNativeNamespace p
|
||||||
|
|
||||||
doesPathExist :: RawFilePath -> IO Bool
|
|
||||||
doesPathExist = D.doesPathExist . fromRawFilePath
|
|
||||||
|
|
||||||
getCurrentDirectory :: IO RawFilePath
|
|
||||||
getCurrentDirectory = toRawFilePath <$> D.getCurrentDirectory
|
|
||||||
|
|
||||||
createDirectory :: RawFilePath -> IO ()
|
|
||||||
createDirectory = D.createDirectory . fromRawFilePath
|
|
||||||
|
|
||||||
setFileMode :: RawFilePath -> FileMode -> IO ()
|
setFileMode :: RawFilePath -> FileMode -> IO ()
|
||||||
setFileMode p m = do
|
setFileMode p m = do
|
||||||
p' <- fromRawFilePath <$> convertToWindowsNativeNamespace p
|
p' <- fromRawFilePath <$> convertToWindowsNativeNamespace p
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue