Commit df9a0b1f authored by bjorn@bringert.net's avatar bjorn@bringert.net
Browse files

fixed some unused imports and variable shadowing

parent 1e0f88ba
......@@ -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 _ ls _ _) <- optDescr, l <- ls, opt `p` l ]
getWith p = [ o | o@(Option _ xs _ _) <- optDescr, x <- xs, 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 xs rest
where options = [ o | o@(Option ss _ _ _) <- optDescr, s <- ss, x == s ]
shortOpt y ys rs optDescr = short ads ys rs
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)
......
......@@ -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
......
......@@ -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: "
......
......@@ -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 )
......
......@@ -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?
......
......@@ -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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment