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
8a3eeb67
Commit
8a3eeb67
authored
Feb 15, 2005
by
ijones
Browse files
basic emit registration script when verbose > 10
parent
fc0a8d02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Distribution/Simple/Register.hs
View file @
8a3eeb67
...
...
@@ -81,6 +81,12 @@ import Data.Maybe (isNothing, fromJust)
import
HUnit
(
Test
)
#
endif
regScriptLocation
::
FilePath
regScriptLocation
=
"register.sh"
unregScriptLocation
::
FilePath
unregScriptLocation
=
"unregister.sh"
-- -----------------------------------------------------------------------------
-- Registration
...
...
@@ -124,7 +130,7 @@ register pkg_descr lbi (userInst,verbose)
|
otherwise
=
[
"--update-package"
,
"--input-file="
++
installedPkgConfigFile
]
rawSystemE
xit
verbose
(
compilerPkgTool
(
compiler
lbi
))
rawSystemE
mit
regScriptLocation
(
verbose
>
10
)
verbose
(
compilerPkgTool
(
compiler
lbi
))
([
"--auto-ghci-libs"
]
++
register_flags
++
config_flags
)
...
...
@@ -221,7 +227,7 @@ unregister pkg_descr lbi (user_unreg, verbose) = do
let
removeCmd
=
if
ghc_63_plus
then
[
"unregister"
,
theName
]
else
[
"--remove-package="
++
theName
]
rawSystemE
x
it
verbose
(
compilerPkgTool
(
compiler
lbi
))
rawSystemE
m
it
unregScriptLocation
(
verbose
>
10
)
verbose
(
compilerPkgTool
(
compiler
lbi
))
(
removeCmd
++
config_flags
)
Hugs
->
do
try
$
removeDirectoryRecursive
(
hugsPackageDir
pkg_descr
lbi
)
...
...
@@ -229,6 +235,20 @@ unregister pkg_descr lbi (user_unreg, verbose) = do
_
->
die
(
"only unregistering with GHC and Hugs is implemented"
)
rawSystemEmit
::
FilePath
-- ^Script name
->
Bool
-- ^if true, emit, if false, run
->
Int
-- ^Verbosity
->
FilePath
-- ^Program to run
->
[
String
]
-- ^Args
->
IO
()
rawSystemEmit
_
False
verbosity
path
args
=
rawSystemExit
verbosity
path
args
rawSystemEmit
scriptName
True
verbosity
path
args
=
writeFile
scriptName
(
"#!/bin/sh
\n\n
"
++
(
path
++
concatMap
(
' '
:
)
args
)
++
"
\n
"
)
>>
putStrLn
(
path
++
concatMap
(
' '
:
)
args
)
-- ------------------------------------------------------------
-- * Testing
-- ------------------------------------------------------------
...
...
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