Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
24509440
Commit
24509440
authored
Jun 05, 2007
by
Ian Lynagh
Browse files
ifBuildable now prints a warning if the package is not buildable
parent
e43dbbde
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/ifBuildable.hs
View file @
24509440
...
...
@@ -6,6 +6,7 @@ import System.Cmd
import
System.Directory
import
System.Environment
import
System.Exit
import
System.IO
main
::
IO
()
main
=
do
args
<-
getArgs
...
...
@@ -15,14 +16,19 @@ main = do args <- getArgs
[
_
]
->
error
"No command given"
package
:
prog
:
progArgs
->
do
setCurrentDirectory
package
unbuildable
<-
doesFileExist
"unbuildable"
if
unbuildable
then
do
mustBeBuildables
<-
getMustBeBuildablePackages
when
(
package
`
elem
`
mustBeBuildables
)
(
error
(
package
++
" is unbuildable"
))
else
do
ec
<-
rawSystem
prog
progArgs
exitWith
ec
doit
package
prog
progArgs
doit
::
String
->
String
->
[
String
]
->
IO
()
doit
package
prog
progArgs
=
do
setCurrentDirectory
package
unbuildable
<-
doesFileExist
"unbuildable"
if
unbuildable
then
do
mustBeBuildables
<-
getMustBeBuildablePackages
if
package
`
elem
`
mustBeBuildables
then
error
(
package
++
" is unbuildable"
)
else
hPutStrLn
stderr
"Warning: Package is unbuildable"
else
do
ec
<-
rawSystem
prog
progArgs
exitWith
ec
getMustBeBuildablePackages
::
IO
[
String
]
getMustBeBuildablePackages
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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