+removeTmpFiles :: Int -> [FilePath] -> IO ()
+removeTmpFiles verb fs = do
+ let verbose = verb >= 2
+ blowAway f =
+ (do when verbose (hPutStrLn stderr ("Removing: " ++ f))
+ if '*' `elem` f
+ then kludgedSystem ("rm -f " ++ f) "Cleaning temp files" >> return ()
+ else removeFile f)
+ `catchAllIO`
+ (\_ -> when verbose (hPutStrLn stderr
+ ("Warning: can't remove tmp file " ++ f)))
+ mapM_ blowAway fs