From 2e513dc98c51eca1cdfce3715b4a017be39734f7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 28 Apr 2016 15:31:35 -0400 Subject: Fix build with directory-1.2.6.2. It's now exporting a conflicting isSymbolicLink https://github.com/haskell/directory/issues/52 Only a few places in propellor use isSymbolicLink, but to prevent future problems, made as much of it as possible import Utility.Directory, which re-exports System.Directory without the conflicting symbol. (Utility.Tmp and System.Console.Concurrent.Internal cannot import Utility.Directory due to cycles, and don't use isSymbolicLink anyway.) --- src/Utility/Directory.hs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/Utility/Directory.hs') diff --git a/src/Utility/Directory.hs b/src/Utility/Directory.hs index fae33b5c..3b12b9fc 100644 --- a/src/Utility/Directory.hs +++ b/src/Utility/Directory.hs @@ -6,12 +6,15 @@ -} {-# LANGUAGE CPP #-} -{-# OPTIONS_GHC -fno-warn-tabs #-} +{-# OPTIONS_GHC -fno-warn-tabs -w #-} -module Utility.Directory where +module Utility.Directory ( + module Utility.Directory, + module System.Directory +) where import System.IO.Error -import System.Directory +import System.Directory hiding (isSymbolicLink) import Control.Monad import System.FilePath import Control.Applicative @@ -134,11 +137,13 @@ moveFile src dest = tryIO (rename src dest) >>= onrename _ <- tryIO $ removeFile tmp throwM e' +#ifndef mingw32_HOST_OS isdir f = do r <- tryIO $ getFileStatus f case r of (Left _) -> return False (Right s) -> return $ isDirectory s +#endif {- Removes a file, which may or may not exist, and does not have to - be a regular file. -- cgit v1.3-2-g0d8e