This commit is contained in:
Joey Hess 2012-02-14 01:11:02 -04:00
parent 2b28c70f5f
commit afd33b0236

10
Seek.hs
View file

@ -89,17 +89,13 @@ withNothing _ _ = error "This command takes no parameters."
prepFiltered :: (FilePath -> CommandStart) -> Annex [FilePath] -> Annex [CommandStart] prepFiltered :: (FilePath -> CommandStart) -> Annex [FilePath] -> Annex [CommandStart]
prepFiltered a = prepFilteredGen a id prepFiltered a fs = do
prepFilteredGen :: (b -> CommandStart) -> (b -> FilePath) -> Annex [b] -> Annex [CommandStart]
prepFilteredGen a d fs = do
matcher <- Limit.getMatcher matcher <- Limit.getMatcher
map (proc matcher) <$> fs map (proc matcher) <$> fs
where where
proc matcher v = do proc matcher f = do
let f = d v
ok <- matcher f ok <- matcher f
if ok then a v else return Nothing if ok then a f else return Nothing
notSymlink :: FilePath -> IO Bool notSymlink :: FilePath -> IO Bool
notSymlink f = liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f notSymlink f = liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f