X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=distrib%2Fcompare%2FProblem.hs;fp=distrib%2Fcompare%2FProblem.hs;h=f80c8567ee6ee2eeea00311e3e36631399c9b9a0;hp=0000000000000000000000000000000000000000;hb=29a05730930cd2c5986ebb22d550e893d9fa20cc;hpb=6c073daacc2c44e218411e874c2eec9d53851d72 diff --git a/distrib/compare/Problem.hs b/distrib/compare/Problem.hs new file mode 100644 index 0000000..f80c856 --- /dev/null +++ b/distrib/compare/Problem.hs @@ -0,0 +1,31 @@ + +module Problem where + +data FileProblem = First Problem + | Second Problem + | Change Problem + +data Problem = DuplicateFile FilePath + | ExtraFile FilePath + | PermissionsChanged FilePath FilePath String String + | FileSizeChanged FilePath FilePath Integer Integer + +pprFileProblem :: FileProblem -> String +pprFileProblem (First p) = "First " ++ pprProblem p +pprFileProblem (Second p) = "Second " ++ pprProblem p +pprFileProblem (Change p) = "Change " ++ pprProblem p + +pprProblem :: Problem -> String +pprProblem (DuplicateFile fp) = "Duplicate file: " ++ show fp +pprProblem (ExtraFile fp) = "Extra file: " ++ show fp +pprProblem (PermissionsChanged fp1 fp2 p1 p2) + = "Permissions changed:\n" + ++ " " ++ show fp1 + ++ " " ++ show fp2 + ++ " " ++ p1 ++ " -> " ++ p2 +pprProblem (FileSizeChanged fp1 fp2 s1 s2) + = "Size changed:\n" + ++ " " ++ show fp1 ++ "\n" + ++ " " ++ show fp2 ++ "\n" + ++ " " ++ show s1 ++ " -> " ++ show s2 +