[commit: ghc] master: Tweak the bindist comparison tool (b45700c)

Ian Lynagh igloo at earth.li
Sat Apr 20 19:30:58 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

https://github.com/ghc/ghc/commit/b45700cee37d259e78315ee525b7d7ef6bd3a674

>---------------------------------------------------------------

commit b45700cee37d259e78315ee525b7d7ef6bd3a674
Author: Ian Lynagh <ian at well-typed.com>
Date:   Sat Apr 20 17:55:13 2013 +0100

    Tweak the bindist comparison tool
    
    It now just warns about files it doesn't recognise, rather than giving
    an error. This means that random text files etc in the same directory
    as the bindists don't make it fall over.

>---------------------------------------------------------------

 distrib/compare/Utils.hs   | 4 ++++
 distrib/compare/compare.hs | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/distrib/compare/Utils.hs b/distrib/compare/Utils.hs
index 720f533..bc4fd20 100644
--- a/distrib/compare/Utils.hs
+++ b/distrib/compare/Utils.hs
@@ -11,11 +11,15 @@ die :: Errors -> IO a
 die errs = do mapM_ (hPutStrLn stderr) errs
               exitFailure
 
+warn :: Errors -> IO ()
+warn warnings = mapM_ (hPutStrLn stderr) warnings
+
 dieOnErrors :: Either Errors a -> IO a
 dieOnErrors (Left errs) = die errs
 dieOnErrors (Right x) = return x
 
 type Errors = [String]
+type Warnings = [String]
 
 maybeRead :: Read a => String -> Maybe a
 maybeRead str = case reads str of
diff --git a/distrib/compare/compare.hs b/distrib/compare/compare.hs
index 23b983f..81055c2 100644
--- a/distrib/compare/compare.hs
+++ b/distrib/compare/compare.hs
@@ -52,7 +52,8 @@ doDirectory ignoreSizeChanges p1 p2
           mkFileInfo fp@('g':'h':'c':'-':x:xs)
            | isDigit x = return [(("ghc-", "VERSION", dropWhile isVersionChar xs), fp)]
            | otherwise = die ["No version number in " ++ show fp]
-          mkFileInfo fp = die ["Unrecognised filename " ++ show fp]
+          mkFileInfo fp = do warn ["Unrecognised filename " ++ show fp]
+                             return []
       fss1' <- mapM mkFileInfo fs1
       fss2' <- mapM mkFileInfo fs2
       let fs1' = sort $ concat fss1'





More information about the ghc-commits mailing list