Skip to content
GitLab
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
47733f31
Commit
47733f31
authored
Mar 30, 2011
by
basvandijk
Browse files
Use catch from the Prelude in the auto generated Paths_pkgname module
This enables it to be build with GHC-6.8
parent
c3a0557f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Distribution/Simple/Build/PathsModule.hs
View file @
47733f31
...
...
@@ -72,16 +72,12 @@ generate pkg_descr lbi =
" ) where
\n
"
++
"
\n
"
++
foreign_imports
++
"import
qualified Control.Exception as Exception
\n
"
++
"import
Prelude (catch, IO, FilePath, return, (++))
\n
"
++
"import Data.Version (Version(..))
\n
"
++
"import System.Environment (getEnv)"
++
"
\n
"
++
"
\n
version :: Version"
++
"
\n
version = "
++
show
(
packageVersion
pkg_descr
)
++
"
\n
"
++
"
\n
"
++
"catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
\n
"
++
"catchIO = Exception.catch
\n
"
"
\n
version = "
++
show
(
packageVersion
pkg_descr
)
body
|
absolute
=
...
...
@@ -144,7 +140,7 @@ generate pkg_descr lbi =
mkGetDir
_
(
Just
dirrel
)
=
"getPrefixDirRel "
++
show
dirrel
mkGetDir
dir
Nothing
=
"return "
++
show
dir
mkGetEnvOr
var
expr
=
"catch
IO
(getEnv
\"
"
++
var'
++
"
\"
)"
++
mkGetEnvOr
var
expr
=
"catch (getEnv
\"
"
++
var'
++
"
\"
)"
++
" (
\\
_ -> "
++
expr
++
")"
where
var'
=
pkgPathEnvVar
pkg_descr
var
...
...
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