Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
b88d0c74
Commit
b88d0c74
authored
Mar 01, 2014
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding checks for broken packages
parent
a741c62b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
0 deletions
+44
-0
ihaskell.cabal
ihaskell.cabal
+2
-0
BrokenPackages.hs
src/IHaskell/BrokenPackages.hs
+37
-0
Evaluate.hs
src/IHaskell/Eval/Evaluate.hs
+3
-0
Types.hs
src/IHaskell/Types.hs
+2
-0
No files found.
ihaskell.cabal
View file @
b88d0c74
...
@@ -101,6 +101,7 @@ library
...
@@ -101,6 +101,7 @@ library
IHaskell.IPython
IHaskell.IPython
IHaskell.Flags
IHaskell.Flags
IHaskell.Types
IHaskell.Types
IHaskell.BrokenPackages
other-modules:
other-modules:
Paths_ihaskell
Paths_ihaskell
...
@@ -125,6 +126,7 @@ executable IHaskell
...
@@ -125,6 +126,7 @@ executable IHaskell
IHaskell.Flags
IHaskell.Flags
IHaskell.Types
IHaskell.Types
IHaskell.Display
IHaskell.Display
IHaskell.BrokenPackages
default-extensions: DoAndIfThenElse
default-extensions: DoAndIfThenElse
...
...
src/IHaskell/BrokenPackages.hs
0 → 100644
View file @
b88d0c74
{-# LANGUAGE OverloadedStrings, NoImplicitPrelude #-}
module
IHaskell.BrokenPackages
(
getBrokenPackages
)
where
import
ClassyPrelude
hiding
((
<|>
))
import
Text.Parsec
import
Text.Parsec.String
import
Control.Applicative
hiding
((
<|>
),
many
)
import
Shelly
data
BrokenPackage
=
BrokenPackage
{
packageID
::
String
,
brokenDeps
::
[
String
]
}
instance
Show
BrokenPackage
where
show
=
packageID
getBrokenPackages
::
IO
[
String
]
getBrokenPackages
=
shellyNoDir
$
do
silently
$
errExit
False
$
run
"ghc-pkg"
[
"check"
]
checkOut
<-
lastStderr
return
$
case
parse
(
many
check
)
"ghc-pkg output"
$
unpack
checkOut
of
Left
err
->
[]
Right
pkgs
->
map
show
pkgs
check
::
Parser
BrokenPackage
check
=
string
"There are problems in package "
>>
BrokenPackage
<$>
ident
<*
string
":
\n
"
<*>
many1
dependency
ident
::
Parser
String
ident
=
many
(
alphaNum
<|>
oneOf
"-."
)
dependency
::
Parser
String
dependency
=
string
" dependency
\"
"
*>
ident
<*
string
"
\"
doesn't exist
\n
"
src/IHaskell/Eval/Evaluate.hs
View file @
b88d0c74
...
@@ -68,6 +68,7 @@ import IHaskell.Eval.Lint
...
@@ -68,6 +68,7 @@ import IHaskell.Eval.Lint
import
IHaskell.Display
import
IHaskell.Display
import
qualified
IHaskell.Eval.Hoogle
as
Hoogle
import
qualified
IHaskell.Eval.Hoogle
as
Hoogle
import
IHaskell.Eval.Util
import
IHaskell.Eval.Util
import
IHaskell.BrokenPackages
import
Paths_ihaskell
(
version
)
import
Paths_ihaskell
(
version
)
import
Data.Version
(
versionBranch
)
import
Data.Version
(
versionBranch
)
...
@@ -148,6 +149,7 @@ initializeImports = do
...
@@ -148,6 +149,7 @@ initializeImports = do
-- XXX this will try to load broken packages, provided they depend
-- XXX this will try to load broken packages, provided they depend
-- on the right ihaskell version
-- on the right ihaskell version
dflags
<-
getSessionDynFlags
dflags
<-
getSessionDynFlags
broken
<-
liftIO
getBrokenPackages
displayPackages
<-
liftIO
$
do
displayPackages
<-
liftIO
$
do
(
dflags
,
_
)
<-
initPackages
dflags
(
dflags
,
_
)
<-
initPackages
dflags
let
Just
db
=
pkgDatabase
dflags
let
Just
db
=
pkgDatabase
dflags
...
@@ -175,6 +177,7 @@ initializeImports = do
...
@@ -175,6 +177,7 @@ initializeImports = do
displayPkgs
=
[
pkgName
displayPkgs
=
[
pkgName
|
pkgName
<-
packageNames
,
|
pkgName
<-
packageNames
,
Just
(
x
:
_
)
<-
[
stripPrefix
initStr
pkgName
],
Just
(
x
:
_
)
<-
[
stripPrefix
initStr
pkgName
],
pkgName
`
notElem
`
broken
,
isAlpha
x
]
isAlpha
x
]
return
displayPkgs
return
displayPkgs
...
...
src/IHaskell/Types.hs
View file @
b88d0c74
...
@@ -36,6 +36,8 @@ import Text.ParserCombinators.ReadP
...
@@ -36,6 +36,8 @@ import Text.ParserCombinators.ReadP
import
IPython.Kernel
import
IPython.Kernel
data
Test
=
Test
data
ViewFormat
data
ViewFormat
=
Pdf
=
Pdf
|
Html
|
Html
...
...
Write
Preview
Markdown
is supported
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