diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-12-24 14:48:51 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-12-24 15:01:55 -0400 |
commit | 42e08cd4575d3dc558dfe172c1f28c752d69e8c6 (patch) | |
tree | 78a8eddc31c390aaf8f66435bb13db9366f9a7c4 /Build | |
parent | 34f375526f44ff255d45bbabcd1425b3d5d0bb4a (diff) | |
parent | 3b9d9a267b7c9247d36d9b622e1b836724ca5fb0 (diff) |
Merge branch 'master' into no-xmpp
Diffstat (limited to 'Build')
-rw-r--r-- | Build/DistributionUpdate.hs | 2 | ||||
-rw-r--r-- | Build/EvilSplicer.hs | 16 | ||||
-rw-r--r-- | Build/LinuxMkLibs.hs | 1 | ||||
-rw-r--r-- | Build/Mans.hs | 7 |
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" |