Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
18227a1b
Commit
18227a1b
authored
May 21, 2004
by
simonmar
Browse files
Nicer messages for each pass
parent
54b6fb35
Changes
7
Hide whitespace changes
Inline
Side-by-side
Distribution/Package.hs
View file @
18227a1b
...
...
@@ -42,12 +42,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -}
module
Distribution.Package
(
PackageIdentifier
(
..
),
PackageIdentifier
(
..
),
showPackageId
,
PackageDescription
(
..
),
emptyPackageDescription
)
where
import
Distribution.Version
(
Version
)
import
Distribution.Version
(
Version
,
showVersion
)
import
Distribution.Misc
(
License
(
..
),
Dependency
,
Extension
)
import
Distribution.Setup
(
CompilerFlavor
)
...
...
@@ -55,6 +56,10 @@ data PackageIdentifier
=
PackageIdentifier
{
pkgName
::
String
,
pkgVersion
::
Version
}
deriving
(
Read
,
Show
,
Eq
)
showPackageId
::
PackageIdentifier
->
String
showPackageId
pkgid
=
pkgName
pkgid
++
'-'
:
showVersion
(
pkgVersion
pkgid
)
-- | This data type is the internal representation of the file @pkg.descr@.
-- It contains two kinds of information about the package: information
-- which is needed for all packages, such as the package name and version, and
...
...
Distribution/Simple/Build.hs
View file @
18227a1b
...
...
@@ -43,15 +43,16 @@ module Distribution.Simple.Build (
build
)
where
import
Distribution.Package
(
PackageDescription
)
import
Distribution.Package
import
Distribution.Simple.Configure
(
LocalBuildInfo
)
import
Distribution.Simple.Utils
(
setupMessage
)
import
System.IO
import
System.Exit
build
::
PackageDescription
->
LocalBuildInfo
->
IO
()
build
pkg_descr
lbi
=
do
hPutStrLn
stderr
"ToDo: building..."
setupMessage
"Configuring"
pkg_descr
exitWith
(
ExitFailure
1
)
-- construct ghc --make command line
...
...
Distribution/Simple/Configure.hs
View file @
18227a1b
...
...
@@ -50,7 +50,7 @@ module Distribution.Simple.Configure (writePersistBuildConfig,
import
Distribution.Setup
(
ConfigFlags
,
CompilerFlavor
(
..
),
Compiler
(
..
))
import
Distribution.Package
(
PackageDescription
(
..
))
import
Distribution.Simple.Utils
(
splitFilenameDir
,
die
,
split
)
import
Distribution.Simple.Utils
(
splitFilenameDir
,
die
,
split
,
setupMessage
)
import
System.IO
hiding
(
catch
)
import
System.Exit
...
...
@@ -91,16 +91,17 @@ localBuildInfoFile = "./.setup-config"
-- Configuration
configure
::
PackageDescription
->
ConfigFlags
->
IO
LocalBuildInfo
configure
pkg
config
(
maybe_hc_flavor
,
maybe_hc_path
,
maybe_prefix
)
configure
pkg
_descr
(
maybe_hc_flavor
,
maybe_hc_path
,
maybe_prefix
)
=
do
setupMessage
"Configuring"
pkg_descr
-- prefix
let
prefix
=
case
maybe_prefix
of
Just
path
->
path
Nothing
->
system_default_prefix
pkg
config
Nothing
->
system_default_prefix
pkg
_descr
message
$
"Using build prefix: "
++
prefix
-- detect compiler
compiler
@
(
Compiler
f'
p'
pkg
)
<-
configCompiler
maybe_hc_flavor
maybe_hc_path
pkg
config
compiler
@
(
Compiler
f'
p'
pkg
)
<-
configCompiler
maybe_hc_flavor
maybe_hc_path
pkg
_descr
message
$
"Using compiler flavor: "
++
(
show
f'
)
message
$
"Using compiler: "
++
p'
message
$
"Using package tool: "
++
pkg
...
...
@@ -119,21 +120,21 @@ system_default_prefix PackageDescription{package=package} =
configCompiler :: Maybe CompilerFlavor -> Maybe FilePath -> PackageDescription
-> IO Compiler
configCompiler (Just flavor) (Just path) pkg
config
configCompiler (Just flavor) (Just path) pkg
_descr
= do pkgtool <- guessPkgToolFromHCPath flavor path
return (Compiler{compilerFlavor=flavor,
compilerPath=path,
compilerPkgTool=pkgtool})
configCompiler (Just flavor) Nothing pkg
config
configCompiler (Just flavor) Nothing pkg
_descr
= do path <- findCompiler flavor
pkgtool <- guessPkgToolFromHCPath flavor path
return (Compiler{compilerFlavor=flavor,
compilerPath=path,
compilerPkgTool=pkgtool})
configCompiler Nothing maybe_path pkg
config
= configCompiler (Just defaultCompilerFlavor) maybe_path pkg
config
configCompiler Nothing maybe_path pkg
_descr
= configCompiler (Just defaultCompilerFlavor) maybe_path pkg
_descr
defaultCompilerFlavor =
#if defined(__GLASGOW_HASKELL__)
...
...
Distribution/Simple/Install.hs
View file @
18227a1b
...
...
@@ -41,10 +41,18 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -}
module
Distribution.Simple.Install
(
install
)
where
module
Distribution.Simple.Install
(
install
)
where
import
Distribution.Package
(
PackageDescription
)
import
Distribution.Simple.Configure
(
LocalBuildInfo
)
import
Distribution.Simple.Utils
(
setupMessage
)
import
System.Exit
install
::
PackageDescription
->
LocalBuildInfo
->
IO
()
install
_
_
=
return
()
install
pkg_descr
localbuildinfo
=
do
setupMessage
"Installing"
pkg_descr
exitWith
(
ExitFailure
1
)
Distribution/Simple/Register.hs
View file @
18227a1b
...
...
@@ -49,16 +49,17 @@ module Distribution.Simple.Register (
import
Distribution.Simple.Configure
(
LocalBuildInfo
)
import
Distribution.Package
(
PackageDescription
)
import
Distribution.InstalledPackageInfo
(
InstalledPackageInfo
)
import
Distribution.Simple.Utils
(
setupMessage
)
import
System.IO
import
System.Exit
register
::
PackageDescription
->
LocalBuildInfo
->
IO
()
register
pkg_descr
lbi
=
do
hPutStrLn
stderr
"ToDo: registering..."
setupMessage
"Registering"
pkg_descr
exitWith
(
ExitFailure
1
)
unregister
::
PackageDescription
->
LocalBuildInfo
->
IO
()
unregister
pkg_descr
lbi
=
do
hPutStrLn
stderr
"ToDo: u
nregistering
..."
setupMessage
"U
nregistering
"
pkg_descr
exitWith
(
ExitFailure
1
)
Distribution/Simple/SrcDist.hs
View file @
18227a1b
...
...
@@ -45,11 +45,12 @@ module Distribution.Simple.SrcDist (
import
Distribution.Package
(
PackageDescription
)
import
Distribution.Simple.Configure
(
LocalBuildInfo
)
import
Distribution.Simple.Utils
(
setupMessage
)
import
System.IO
import
System.Exit
sdist
::
PackageDescription
->
LocalBuildInfo
->
IO
()
sdist
pkg_descr
lbi
=
do
hPutStrLn
stderr
"ToDo: sdisting..."
setupMessage
"Building source dist for"
pkg_descr
exitWith
(
ExitFailure
1
)
Distribution/Simple/Utils.hs
View file @
18227a1b
...
...
@@ -46,9 +46,12 @@ module Distribution.Simple.Utils (
splitFilenameDir
,
split
,
isPathSeparator
,
die
setupMessage
,
die
,
)
where
import
Distribution.Package
import
System.IO
import
System.Exit
...
...
@@ -81,5 +84,9 @@ isPathSeparator ch =
ch
==
'/'
#
endif
setupMessage
::
String
->
PackageDescription
->
IO
()
setupMessage
msg
pkg_descr
=
putStrLn
(
msg
++
' '
:
showPackageId
(
package
pkg_descr
)
++
"..."
)
die
::
String
->
IO
a
die
msg
=
do
hPutStr
stderr
msg
;
exitWith
(
ExitFailure
1
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment