never executed always true always false
1 {-# LANGUAGE DeriveFunctor #-}
2 {-# LANGUAGE DeriveGeneric #-}
3 module Distribution.Client.Types.PackageLocation (
4 PackageLocation (..),
5 UnresolvedPkgLoc,
6 ResolvedPkgLoc,
7 UnresolvedSourcePackage,
8 ) where
9
10 import Distribution.Client.Compat.Prelude
11 import Prelude ()
12
13 import Network.URI (URI)
14
15 import Distribution.Types.PackageId (PackageId)
16
17 import Distribution.Client.Types.Repo
18 import Distribution.Client.Types.SourceRepo (SourceRepoMaybe)
19 import Distribution.Solver.Types.SourcePackage (SourcePackage)
20
21 type UnresolvedPkgLoc = PackageLocation (Maybe FilePath)
22
23 type ResolvedPkgLoc = PackageLocation FilePath
24
25 data PackageLocation local =
26
27 -- | An unpacked package in the given dir, or current dir
28 LocalUnpackedPackage FilePath
29
30 -- | A package as a tarball that's available as a local tarball
31 | LocalTarballPackage FilePath
32
33 -- | A package as a tarball from a remote URI
34 | RemoteTarballPackage URI local
35
36 -- | A package available as a tarball from a repository.
37 --
38 -- It may be from a local repository or from a remote repository, with a
39 -- locally cached copy. ie a package available from hackage
40 | RepoTarballPackage Repo PackageId local
41
42 -- | A package available from a version control system source repository
43 | RemoteSourceRepoPackage SourceRepoMaybe local
44 deriving (Show, Functor, Eq, Ord, Generic, Typeable)
45
46 instance Binary local => Binary (PackageLocation local)
47 instance Structured local => Structured (PackageLocation local)
48
49 -- | Convenience alias for 'SourcePackage UnresolvedPkgLoc'.
50 type UnresolvedSourcePackage = SourcePackage UnresolvedPkgLoc