@@ -36,7 +36,6 @@ import Distribution.Simple.Utils
36
36
import Distribution.Verbosity
37
37
( Verbosity )
38
38
import Distribution.Pretty (prettyShow )
39
- import Distribution.Deprecated.Text (display )
40
39
import qualified Distribution.PackageDescription as PD
41
40
import Distribution.Simple.Program
42
41
( programName )
@@ -171,7 +170,7 @@ unpackPackage :: Verbosity -> FilePath -> PackageId
171
170
-> PackageDescriptionOverride
172
171
-> FilePath -> IO ()
173
172
unpackPackage verbosity prefix pkgid descOverride pkgPath = do
174
- let pkgdirname = display pkgid
173
+ let pkgdirname = prettyShow pkgid
175
174
pkgdir = prefix </> pkgdirname
176
175
pkgdir' = addTrailingPathSeparator pkgdir
177
176
emptyDirectory directory = null <$> listDirectory directory
@@ -190,7 +189,7 @@ unpackPackage verbosity prefix pkgid descOverride pkgPath = do
190
189
case descOverride of
191
190
Nothing -> return ()
192
191
Just pkgtxt -> do
193
- let descFilePath = pkgdir </> display (packageName pkgid) <.> " cabal"
192
+ let descFilePath = pkgdir </> prettyShow (packageName pkgid) <.> " cabal"
194
193
info verbosity $
195
194
" Updating " ++ descFilePath
196
195
++ " with the latest revision from the index."
@@ -214,37 +213,37 @@ data ClonePackageException =
214
213
215
214
instance Exception ClonePackageException where
216
215
displayException (ClonePackageNoSourceRepos pkgid) =
217
- " Cannot fetch a source repository for package " ++ display pkgid
216
+ " Cannot fetch a source repository for package " ++ prettyShow pkgid
218
217
++ " . The package does not specify any source repositories."
219
218
220
219
displayException (ClonePackageNoSourceReposOfKind pkgid repoKind) =
221
- " Cannot fetch a source repository for package " ++ display pkgid
220
+ " Cannot fetch a source repository for package " ++ prettyShow pkgid
222
221
++ " . The package does not specify a source repository of the requested "
223
- ++ " kind" ++ maybe " ." (\ k -> " (kind " ++ display k ++ " )." ) repoKind
222
+ ++ " kind" ++ maybe " ." (\ k -> " (kind " ++ prettyShow k ++ " )." ) repoKind
224
223
225
224
displayException (ClonePackageNoRepoType pkgid _repo) =
226
- " Cannot fetch the source repository for package " ++ display pkgid
225
+ " Cannot fetch the source repository for package " ++ prettyShow pkgid
227
226
++ " . The package's description specifies a source repository but does "
228
227
++ " not specify the repository 'type' field (e.g. git, darcs or hg)."
229
228
230
229
displayException (ClonePackageUnsupportedRepoType pkgid _ repoType) =
231
- " Cannot fetch the source repository for package " ++ display pkgid
232
- ++ " . The repository type '" ++ display repoType
230
+ " Cannot fetch the source repository for package " ++ prettyShow pkgid
231
+ ++ " . The repository type '" ++ prettyShow repoType
233
232
++ " ' is not yet supported."
234
233
235
234
displayException (ClonePackageNoRepoLocation pkgid _repo) =
236
- " Cannot fetch the source repository for package " ++ display pkgid
235
+ " Cannot fetch the source repository for package " ++ prettyShow pkgid
237
236
++ " . The package's description specifies a source repository but does "
238
237
++ " not specify the repository 'location' field (i.e. the URL)."
239
238
240
239
displayException (ClonePackageDestinationExists pkgid dest isdir) =
241
- " Not fetching the source repository for package " ++ display pkgid ++ " . "
240
+ " Not fetching the source repository for package " ++ prettyShow pkgid ++ " . "
242
241
++ if isdir then " The destination directory " ++ dest ++ " already exists."
243
242
else " A file " ++ dest ++ " is in the way."
244
243
245
244
displayException (ClonePackageFailedWithExitCode
246
245
pkgid repo vcsprogname exitcode) =
247
- " Failed to fetch the source repository for package " ++ display pkgid
246
+ " Failed to fetch the source repository for package " ++ prettyShow pkgid
248
247
++ " , repository location " ++ srpLocation repo ++ " ("
249
248
++ vcsprogname ++ " failed with " ++ show exitcode ++ " )."
250
249
@@ -302,7 +301,7 @@ clonePackagesFromSourceRepo verbosity destDirPrefix
302
301
Left SourceRepoLocationUnspecified ->
303
302
throwIO (ClonePackageNoRepoLocation pkgid repo)
304
303
305
- let destDir = destDirPrefix </> display (packageName pkgid)
304
+ let destDir = destDirPrefix </> prettyShow (packageName pkgid)
306
305
destDirExists <- doesDirectoryExist destDir
307
306
destFileExists <- doesFileExist destDir
308
307
when (destDirExists || destFileExists) $
0 commit comments