From 4e6c2fe5667587dbc4c51ce0fadb2ab941de6eb9 Mon Sep 17 00:00:00 2001 From: fendor Date: Tue, 18 Jun 2019 15:36:34 +0200 Subject: [PATCH] Better error message and use compat listDirectory --- cabal-install/Distribution/Client/Get.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cabal-install/Distribution/Client/Get.hs b/cabal-install/Distribution/Client/Get.hs index ee36f73fcf9..0ef057e38f6 100644 --- a/cabal-install/Distribution/Client/Get.hs +++ b/cabal-install/Distribution/Client/Get.hs @@ -24,7 +24,8 @@ module Distribution.Client.Get ( import Prelude () import Distribution.Client.Compat.Prelude hiding (get) - +import Distribution.Compat.Directory + ( listDirectory ) import Distribution.Package ( PackageId, packageId, packageName ) import Distribution.Simple.Setup @@ -56,8 +57,7 @@ import Control.Monad ( mapM, forM_, mapM_, unless ) import qualified Data.Map as Map import System.Directory - ( createDirectoryIfMissing, doesDirectoryExist, doesFileExist - , listDirectory ) + ( createDirectoryIfMissing, doesDirectoryExist, doesFileExist ) import System.Exit ( ExitCode(..) ) import System.FilePath @@ -172,7 +172,7 @@ unpackPackage verbosity prefix pkgid descOverride pkgPath = do isEmpty <- emptyDirectory pkgdir unless isEmpty $ die' verbosity $ - "The directory \"" ++ pkgdir' ++ "\" already exists, not unpacking." + "The directory \"" ++ pkgdir' ++ "\" already exists and is not empty, not unpacking." existsFile <- doesFileExist pkgdir when existsFile $ die' verbosity $ "A file \"" ++ pkgdir ++ "\" is in the way, not unpacking."