问题
Is it possible to get cabal to
- Download a particular package source, including all dependency packages sources.
- At a later stage (when internet connectivity can no longer be relied upon) install these packages via cabal, from the locally downloaded files, automatically in the right order so that the desired package is build?
I know that you can use cabal unpack
to view the source of a particular package, but I am not sure how to achieve above. Also note that in this post Can't get cabal update to work inside corporate network it was mentioned that this could be done, but the instructions were not specific enough for me.
回答1:
cabal help | grep fetch
:
fetch Downloads packages for later installation.
Example:
$ cabal fetch unbound
Resolving dependencies...
Downloading RepLib-0.5.3.1...
Downloading type-equality-0.1.1...
Downloading unbound-0.4.1.1...
Running cabal install unbound
at a later stage won't require Internet access.
来源:https://stackoverflow.com/questions/14112681/installing-packages-via-cabal-from-local-hackage