This repository was archived by the owner on Feb 3, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-13
lines changed Expand file tree Collapse file tree 3 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import Development.Shake
8
8
import Development.Shake.FilePath
9
9
import System.Console.GetOpt
10
10
import qualified System.Info (os , arch )
11
+ import System.IO
11
12
12
13
import Config
13
14
import Dirs
@@ -31,12 +32,12 @@ flags = [ Option ['i'] ["info"] (NoArg $ Right Info)
31
32
" Show info on what gets included in this HP release"
32
33
, Option [] [" prefix" ] (ReqArg (Right . Prefix ) " DIR" )
33
34
" Set installation prefix (only for Posix builds)"
34
- , Option [' f' ] [" full" ] (NoArg $ Right Info )
35
+ , Option [' f' ] [" full" ] (NoArg $ Right Full )
35
36
" Do a full (rather than minimal) build of the platform."
36
37
]
37
38
38
39
main :: IO ()
39
- main = shakeArgsWith opts flags main'
40
+ main = hSetEncoding stdout utf8 >> shakeArgsWith opts flags main'
40
41
where
41
42
main' flgs args =
42
43
if Info `elem` flgs
Original file line number Diff line number Diff line change @@ -15,9 +15,7 @@ module Types
15
15
)
16
16
where
17
17
18
- #if MIN_VERSION_base(4,6,0)
19
- import Control.Applicative ((<$>) , (<*>) )
20
- #endif
18
+ import Control.Applicative
21
19
import Data.Char (isDigit )
22
20
import Data.List (intercalate )
23
21
import Data.Version (Version , showVersion , parseVersion )
@@ -42,11 +40,7 @@ readPackageP = do
42
40
ver <- parseVersion
43
41
return $ Package (intercalate " -" parts) ver
44
42
where
45
- #if MIN_VERSION_base(4,6,0)
46
43
part = (:) <$> satisfy lead <*> munch more
47
- #else
48
- part = do { l <- satisfy lead; m <- munch more; return (l: m) }
49
- #endif
50
44
51
45
lead c = not (isDigit c) && more c
52
46
more c = c /= ' -'
Original file line number Diff line number Diff line change @@ -137,17 +137,17 @@ extendedCtx name = mkStrContext ctx
137
137
pCtx pName " package" = MuVariable pName
138
138
pCtx pName " hackageUrl" =
139
139
MuVariable $ " http://hackage.haskell.org/package/" ++ pName
140
- pCtx pName " releases" = mapListStrContext pvCtx $ packageVersionInfo pName
140
+ pCtx pName " releases" = mapListStrContext pvCtx $ packageVersionInfo True pName
141
141
pCtx _ _ = MuNothing
142
142
143
143
pvCtx (c, _) " class" = MuVariable c
144
144
pvCtx (_, v) " version" = MuVariable v
145
145
pvCtx _ _ = MuNothing
146
146
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 ])
149
149
where
150
- comp Nothing _ = (" missing" , " — " )
150
+ comp Nothing _ = (" missing" , " - " )
151
151
comp (Just v) Nothing = (" update" , showVersion v)
152
152
comp (Just v) (Just w) | maj v == maj w = (" same" , showVersion v)
153
153
| otherwise = (" update" , showVersion v)
You can’t perform that action at this time.
0 commit comments