summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
Diffstat (limited to 'Build')
-rw-r--r--Build/DistributionUpdate.hs2
-rw-r--r--Build/EvilSplicer.hs16
-rw-r--r--Build/LinuxMkLibs.hs1
-rw-r--r--Build/Mans.hs7
4 files changed, 18 insertions, 8 deletions
diff --git a/Build/DistributionUpdate.hs b/Build/DistributionUpdate.hs
index 814927e99..dd18a7883 100644
--- a/Build/DistributionUpdate.hs
+++ b/Build/DistributionUpdate.hs
@@ -14,6 +14,7 @@ import Build.Version (getChangelogVersion, Version)
import Utility.UserInfo
import Utility.Url
import Utility.Tmp
+import Utility.FileSystemEncoding
import qualified Git.Construct
import qualified Annex
import Annex.Content
@@ -50,6 +51,7 @@ autobuilds =
main :: IO ()
main = do
+ useFileSystemEncoding
version <- liftIO getChangelogVersion
repodir <- getRepoDir
changeWorkingDirectory repodir
diff --git a/Build/EvilSplicer.hs b/Build/EvilSplicer.hs
index e685b1e44..32d9a1c9f 100644
--- a/Build/EvilSplicer.hs
+++ b/Build/EvilSplicer.hs
@@ -210,7 +210,6 @@ applySplices destdir imports splices@(first:_) = do
when (oldcontent /= Just newcontent) $ do
putStrLn $ "splicing " ++ f
withFile dest WriteMode $ \h -> do
- fileEncoding h
hPutStr h newcontent
hClose h
where
@@ -474,7 +473,7 @@ mangleCode = flip_colon
-
- To fix, we could just put a semicolon at the start of every line
- containing " -> " ... Except that lambdas also contain that.
- - But we can get around that: GHC outputs lambas like this:
+ - But we can get around that: GHC outputs lambdas like this:
-
- \ foo
- -> bar
@@ -487,7 +486,7 @@ mangleCode = flip_colon
- containing " -> " unless there's a "\ " first, or it's
- all whitespace up until it.
-}
- case_layout = parsecAndReplace $ do
+ case_layout = skipfree $ parsecAndReplace $ do
void newline
indent1 <- many1 $ char ' '
prefix <- manyTill (noneOf "\n") (try (string "-> "))
@@ -508,7 +507,7 @@ mangleCode = flip_colon
- var var
- -> foo
-}
- case_layout_multiline = parsecAndReplace $ do
+ case_layout_multiline = skipfree $ parsecAndReplace $ do
void newline
indent1 <- many1 $ char ' '
firstline <- restofline
@@ -521,6 +520,11 @@ mangleCode = flip_colon
else return $ "\n" ++ indent1 ++ "; " ++ firstline ++ "\n"
++ indent1 ++ indent2 ++ "-> "
+ {- Type definitions for free monads triggers the case_* hacks, avoid. -}
+ skipfree f s
+ | "MonadFree" `isInfixOf` s = s
+ | otherwise = f s
+
{- (foo, \ -> bar) is not valid haskell, GHC.
- Change to (foo, bar)
-
@@ -716,7 +720,9 @@ parsecAndReplace p s = case parse find "" s of
find = many $ try (Right <$> p) <|> (Left <$> anyChar)
main :: IO ()
-main = go =<< getArgs
+main = do
+ useFileSystemEncoding
+ go =<< getArgs
where
go (destdir:log:header:[]) = run destdir log (Just header)
go (destdir:log:[]) = run destdir log Nothing
diff --git a/Build/LinuxMkLibs.hs b/Build/LinuxMkLibs.hs
index d7512bfe0..ba40206fd 100644
--- a/Build/LinuxMkLibs.hs
+++ b/Build/LinuxMkLibs.hs
@@ -70,7 +70,6 @@ installLinkerShim top linker exe = do
-- Assume that for a symlink, the destination
-- will also be shimmed.
let sl' = ".." </> takeFileName sl </> takeFileName sl
- print (sl', exedest)
createSymbolicLink sl' exedest
, renameFile exe exedest
)
diff --git a/Build/Mans.hs b/Build/Mans.hs
index cf86d983d..2ea9b4197 100644
--- a/Build/Mans.hs
+++ b/Build/Mans.hs
@@ -50,8 +50,11 @@ buildMans = do
else return (Just dest)
isManSrc :: FilePath -> Bool
-isManSrc s = "git-annex" `isPrefixOf` (takeFileName s)
- && takeExtension s == ".mdwn"
+isManSrc s
+ | not (takeExtension s == ".mdwn") = False
+ | otherwise = "git-annex" `isPrefixOf` f || "git-remote-" `isPrefixOf` f
+ where
+ f = takeFileName s
srcToDest :: FilePath -> FilePath
srcToDest s = "man" </> progName s ++ ".1"