
The “Transport” data type you suggest seems like a good refactor. I’m less certain about the use of ProgramDB — the documentation suggests it will only be populated from command line flags in the “configure” step, or from .cabal files. Since upload/download do not take place in such settings, I don’t think it will contain useful information yet. So it might be the right approach to use it, but it would also require, I suspect, modifying other parts of the cabal-install executable to populate it properly? —Gershom On May 6, 2015 at 3:32:44 AM, Mikhail Glushenkov (the.dead.shall.rise@gmail.com) wrote:
On 6 May 2015 at 00:26, Gershom B wrote:
Ok, on my "https" branch here: https://github.com/gbaz/Cabal/tree/https
Looks like a good first step. Consider using machinery in Distribution.Simple.Program.Db for searching for curl/wget in path or in user-provided location.
I'd also use something like
data Transport = { getHttp :: URI -> FilePath -> IO (Int, String), putHttp :: URI -> FilePath -> ...}
configureTransport :: ProgramDB -> IO Transport
instead of switching on TransportType in getHttp/uploadToUri.