git.iko.soy/typeable/cabal2nix
on master help sign in
Hackage4Nix.hs (discoverNixFiles): don't ignore paths that begin with a '.'

The 'readDir' function strips magic directories during traversal, so we don't need to worry about that issue here anymore.

commit980335d48537325243afb71291ef7607a21375df authorPeter Simons <simons@cryp.to> dateTue 23 Aug 2011, 12:45 (15 years ago) parent84fbf30
1 file changed+6−8
src/Hackage4Nix.hs+6−8
src/Hackage4Nix.hs+6−8
@@ -65,14 +65,12 @@ readCabalFile name vers = do
6565 return pkg
6666
6767discoverNixFiles :: (FilePath -> Hackage4Nix ()) -> FilePath -> Hackage4Nix ()
68−discoverNixFiles yield dirOrFile
69− | "." `isPrefixOf` takeFileName dirOrFile = return ()
70− | otherwise = do
71− isFile <- io (doesFileExist dirOrFile)
72− case (isFile, takeExtension dirOrFile) of
73− (True,".nix") -> yield dirOrFile
74− (True,_) -> return ()
75− (False,_) -> io (readDirectory dirOrFile) >>= mapM_ (discoverNixFiles yield . (dirOrFile </>))
68+discoverNixFiles yield dirOrFile = do
69+ isFile <- io (doesFileExist dirOrFile)
70+ case (isFile, takeExtension dirOrFile) of
71+ (True,".nix") -> yield dirOrFile
72+ (True,_) -> return ()
73+ (False,_) -> io (readDirectory dirOrFile) >>= mapM_ (discoverNixFiles yield . (dirOrFile </>))
7674
7775regenerateDerivation :: Derivation -> String -> Bool
7876regenerateDerivation deriv buf = not (pname deriv `elem` patchedPackages) &&