From 3788098e0af1cb85ecfbbbae39c4edeb621f1f85 Mon Sep 17 00:00:00 2001 From: hallgren Date: Wed, 22 Jul 2015 14:34:02 +0000 Subject: [PATCH] Setup.hs: ignore .* instead of . and .. when compiling/copying all files in a directory This avoids problems with .DS_Store files created by the Finder on OS X. --- Setup.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Setup.hs b/Setup.hs index 272322d8e..71bf797e2 100644 --- a/Setup.hs +++ b/Setup.hs @@ -82,7 +82,7 @@ rglCommands = let prelude_src_dir = rgl_src_dir "prelude" prelude_dst_dir = rgl_dst_dir (lbi bi) "prelude" createDirectoryIfMissing True prelude_dst_dir - files <- ls prelude_src_dir + files <- list_files prelude_src_dir run_gfc bi (["-s", "--gfo-dir="++prelude_dst_dir] ++ [prelude_src_dir file | file <- files]) , RGLCommand "all" True $ gfcp [l,s,c,t,sc] @@ -164,7 +164,7 @@ copyRGL args flags bi = do copyAll s from to = do putStrLn $ "Installing [" ++ s ++ "] " ++ to createDirectoryIfMissing True to - mapM_ (\file -> copyFile (from file) (to file)) =<< ls from + mapM_ (\file -> copyFile (from file) (to file)) =<< list_files from {- sdistRGL pkg mb_lbi hooks flags = do paths <- getRGLFiles rgl_src_dir [] @@ -414,7 +414,7 @@ updateFile path new = writeFile path new -- | List files, excluding "." and ".." -ls path = filter (`notElem` [".",".."]) `fmap` getDirectoryContents path +list_files path = filter ((/=".").take 1) `fmap` getDirectoryContents path -- | For parallel RGL module compilation