@@ -48,12 +48,12 @@ fetch :: forall a. (String -> MaybeT IO a) -- ^ This function is passed the
4848fetch f = runMaybeT . fetchers where
4949 fetchers :: Source -> MaybeT IO (DerivationSource, a)
5050 fetchers source = msum . (fetchLocal source :) $ map (\fetcher -> fetchWith fetcher source >>= process)
51− [ (False, "zip")
52− , (False, "url")
53− , (True, "git")
54− , (True, "hg")
55− , (True, "svn")
56− , (True, "bzr")
51+ [ (False, "zip", [])
52+ , (False, "url", [])
53+ , (True, "git", ["--fetch-submodules"])
54+ , (True, "hg", [])
55+ , (True, "svn", [])
56+ , (True, "bzr", [])
5757 ]
5858
5959 -- | Remove '/' from the end of the path. Nix doesn't accept paths that
@@ -74,15 +74,15 @@ fetch f = runMaybeT . fetchers where
7474 localArchive :: FilePath -> MaybeT IO (DerivationSource, a)
7575 localArchive path = do
7676 absolutePath <- liftIO $ canonicalizePath path
77− unpacked <- snd <$> fetchWith (False, "zip") (Source ("file://" ++ absolutePath) "" Nothing)
77+ unpacked <- snd <$> fetchWith (False, "zip", []) (Source ("file://" ++ absolutePath) "" Nothing)
7878 process (DerivationSource "" absolutePath "" "", unpacked)
7979
8080 process :: (DerivationSource, FilePath) -> MaybeT IO (DerivationSource, a)
8181 process (derivSource, file) = (,) derivSource <$> f file
8282
8383-- | Like 'fetch', but allows to specify which script to use.
84−fetchWith :: (Bool, String) -> Source -> MaybeT IO (DerivationSource, FilePath)
85−fetchWith (supportsRev, kind) source = do
84+fetchWith :: (Bool, String, [String]) -> Source -> MaybeT IO (DerivationSource, FilePath)
85+fetchWith (supportsRev, kind, addArgs) source = do
8686 unless ((sourceRevision source /= "") || isNothing (sourceHash source) || not supportsRev) $
8787 liftIO (hPutStrLn stderr "** need a revision for VCS when the hash is given. skipping.") >> mzero
8888
@@ -106,7 +106,7 @@ fetchWith (supportsRev, kind) source = do
106106 script = "nix-prefetch-" ++ kind
107107
108108 args :: [String]
109− args = sourceUrl source : [ sourceRevision source | supportsRev ] ++ maybeToList (sourceHash source)
109+ args = addArgs ++ sourceUrl source : [ sourceRevision source | supportsRev ] ++ maybeToList (sourceHash source)
110110
111111 processOutputWithRev :: [String] -> IO (DerivationSource, FilePath)
112112 processOutputWithRev [rev,hash,path] = return (DerivationSource kind (sourceUrl source) (extractRevision rev) hash, path)