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
df9a0b1f
Commit
df9a0b1f
authored
Jun 10, 2004
by
bjorn@bringert.net
Browse files
fixed some unused imports and variable shadowing
parent
1e0f88ba
Changes
6
Hide whitespace changes
Inline
Side-by-side
Distribution/GetOpt.hs
View file @
df9a0b1f
...
...
@@ -170,7 +170,7 @@ getNext a rest _ = (NonOpt a,rest)
longOpt
::
String
->
[
String
]
->
[
OptDescr
a
]
->
(
OptKind
a
,[
String
])
longOpt
ls
rs
optDescr
=
long
ads
arg
rs
where
(
opt
,
arg
)
=
break
(
==
'='
)
ls
getWith
p
=
[
o
|
o
@
(
Option
_
l
s
_
_
)
<-
optDescr
,
l
<-
l
s
,
opt
`
p
`
l
]
getWith
p
=
[
o
|
o
@
(
Option
_
x
s
_
_
)
<-
optDescr
,
x
<-
x
s
,
opt
`
p
`
x
]
exact
=
getWith
(
==
)
options
=
if
null
exact
then
getWith
isPrefixOf
else
exact
ads
=
[
ad
|
Option
_
_
ad
_
<-
options
]
...
...
@@ -188,10 +188,10 @@ longOpt ls rs optDescr = long ads arg rs
-- handle short option
shortOpt
::
Char
->
String
->
[
String
]
->
[
OptDescr
a
]
->
(
OptKind
a
,[
String
])
shortOpt
x
xs
rest
optDescr
=
short
ads
x
s
r
est
where
options
=
[
o
|
o
@
(
Option
ss
_
_
_
)
<-
optDescr
,
s
<-
ss
,
x
==
s
]
shortOpt
y
ys
rs
optDescr
=
short
ads
y
s
r
s
where
options
=
[
o
|
o
@
(
Option
ss
_
_
_
)
<-
optDescr
,
s
<-
ss
,
y
==
s
]
ads
=
[
ad
|
Option
_
_
ad
_
<-
options
]
optStr
=
'-'
:
[
x
]
optStr
=
'-'
:
[
y
]
short
(
_
:
_
:
_
)
_
rest
=
(
errAmbig
options
optStr
,
rest
)
short
(
NoArg
a
:
_
)
[]
rest
=
(
Opt
a
,
rest
)
...
...
Distribution/ModuleTest.hs
View file @
df9a0b1f
...
...
@@ -60,17 +60,11 @@ import qualified Distribution.Simple.Utils(hunitTests)
import
Distribution.Simple.Configure
()
import
Distribution.Simple.Register
()
-- base
import
Control.Monad
(
when
)
import
Directory
(
setCurrentDirectory
,
doesFileExist
,
doesDirectoryExist
,
removeDirectory
)
import
System.Cmd
(
system
)
import
System.Exit
(
ExitCode
(
..
))
import
HUnit
(
runTestTT
,
Test
(
..
),
assertBool
)
import
HUnit
(
runTestTT
,
Test
(
..
))
label
t
=
"-= "
++
t
++
" =-"
runTestTT'
::
Test
->
IO
Counts
runTestTT'
t
@
(
TestList
_
)
=
runTestTT
t
runTestTT'
(
TestLabel
l
t
)
=
putStrLn
(
label
l
)
>>
runTestTT
t
...
...
Distribution/Setup.hs
View file @
df9a0b1f
...
...
@@ -178,6 +178,7 @@ getConfigFlags flags
convert
HugsFlag
=
Just
Hugs
convert
_
=
Nothing
getOneOpt
::
Show
a
=>
[
a
]
->
Either
String
(
Maybe
a
)
getOneOpt
[]
=
return
Nothing
getOneOpt
[
one
]
=
return
(
Just
one
)
getOneOpt
o
=
fail
$
"Multiple options where one expected: "
...
...
Distribution/Simple/Configure.hs
View file @
df9a0b1f
...
...
@@ -54,7 +54,6 @@ import Distribution.Simple.Utils
import
Distribution.Package
(
PackageIdentifier
)
import
System.IO
hiding
(
catch
)
import
System.Exit
import
System.Directory
import
Control.Monad
(
when
)
import
Control.Exception
(
catch
,
evaluate
)
...
...
Distribution/Simple/Install.hs
View file @
df9a0b1f
...
...
@@ -51,10 +51,6 @@ import Distribution.Package (PackageDescription(..), showPackageId)
import
Distribution.Simple.Configure
(
LocalBuildInfo
(
..
))
import
Distribution.Simple.Utils
(
setupMessage
,
moveSources
,
pathSeperatorStr
)
import
System.Cmd
(
system
)
import
System.Directory
(
doesDirectoryExist
,
createDirectory
,
doesFileExist
)
import
System.Exit
-- |FIX: for now, only works with hugs or sdist-style
-- installation... must implement for .hi files and such... how do we
-- know which files to expect?
...
...
Distribution/Simple/SrcDist.hs
View file @
df9a0b1f
...
...
@@ -47,8 +47,6 @@ import Distribution.Package(PackageDescription(..), showPackageId)
import
Distribution.Simple.Configure
(
LocalBuildInfo
)
import
Distribution.Simple.Utils
(
setupMessage
,
moveSources
,
pathSeperatorStr
)
import
System.IO
()
import
System.Exit
(
ExitCode
(
..
),
exitWith
)
import
System.Cmd
(
system
)
-- |Create a source distribution. FIX: Calls tar directly (won't work
...
...
@@ -73,4 +71,5 @@ distSrc = "dist/src"
tarBallName
::
PackageDescription
->
FilePath
tarBallName
p
=
(
nameVersion
p
)
++
".tgz"
nameVersion
::
PackageDescription
->
String
nameVersion
=
showPackageId
.
package
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