Skip to content
This repository was archived by the owner on Feb 3, 2022. It is now read-only.

Commit 8283420

Browse files
U-CIQDEV\gbazermanU-CIQDEV\gbazerman
authored andcommitted
a few fixes
1 parent 48aff26 commit 8283420

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

hptool/src/Main.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Development.Shake
88
import Development.Shake.FilePath
99
import System.Console.GetOpt
1010
import qualified System.Info (os, arch)
11+
import System.IO
1112

1213
import Config
1314
import Dirs
@@ -31,12 +32,12 @@ flags = [ Option ['i'] ["info"] (NoArg $ Right Info)
3132
"Show info on what gets included in this HP release"
3233
, Option [] ["prefix"] (ReqArg (Right . Prefix) "DIR")
3334
"Set installation prefix (only for Posix builds)"
34-
, Option ['f'] ["full"] (NoArg $ Right Info)
35+
, Option ['f'] ["full"] (NoArg $ Right Full)
3536
"Do a full (rather than minimal) build of the platform."
3637
]
3738

3839
main :: IO ()
39-
main = shakeArgsWith opts flags main'
40+
main = hSetEncoding stdout utf8 >> shakeArgsWith opts flags main'
4041
where
4142
main' flgs args =
4243
if Info `elem` flgs

hptool/src/Types.hs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ module Types
1515
)
1616
where
1717

18-
#if MIN_VERSION_base(4,6,0)
19-
import Control.Applicative ((<$>), (<*>))
20-
#endif
18+
import Control.Applicative
2119
import Data.Char (isDigit)
2220
import Data.List (intercalate)
2321
import Data.Version (Version, showVersion, parseVersion)
@@ -42,11 +40,7 @@ readPackageP = do
4240
ver <- parseVersion
4341
return $ Package (intercalate "-" parts) ver
4442
where
45-
#if MIN_VERSION_base(4,6,0)
4643
part = (:) <$> satisfy lead <*> munch more
47-
#else
48-
part = do { l <- satisfy lead; m <- munch more; return (l:m) }
49-
#endif
5044

5145
lead c = not (isDigit c) && more c
5246
more c = c /= '-'

hptool/src/Website.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,17 @@ extendedCtx name = mkStrContext ctx
137137
pCtx pName "package" = MuVariable pName
138138
pCtx pName "hackageUrl" =
139139
MuVariable $ "http://hackage.haskell.org/package/" ++ pName
140-
pCtx pName "releases" = mapListStrContext pvCtx $ packageVersionInfo pName
140+
pCtx pName "releases" = mapListStrContext pvCtx $ packageVersionInfo True pName
141141
pCtx _ _ = MuNothing
142142

143143
pvCtx (c, _) "class" = MuVariable c
144144
pvCtx (_, v) "version" = MuVariable v
145145
pvCtx _ _ = MuNothing
146146

147-
packageVersionInfo :: String -> [(String, String)]
148-
packageVersionInfo pName = curr $ zipWith comp vers (drop 1 vers ++ [Nothing])
147+
packageVersionInfo :: Bool -> String -> [(String, String)]
148+
packageVersionInfo searchFull pName = curr $ zipWith comp vers (drop 1 vers ++ [Nothing])
149149
where
150-
comp Nothing _ = ("missing", "")
150+
comp Nothing _ = ("missing", "-")
151151
comp (Just v) Nothing = ("update", showVersion v)
152152
comp (Just v) (Just w) | maj v == maj w = ("same", showVersion v)
153153
| otherwise = ("update", showVersion v)

0 commit comments

Comments
 (0)