我希望能够搜索一个包,并获得一个下载链接以及所有依赖项的列表。有没有一种简单的方法可以通过命令行或Haskell模块来做到这一点?
发布于 2013-03-18 09:13:29
cabal (如果您还没有的话,可以从cabal-install包中获得)可以做到这一点。我将厚颜无耻地使用我刚刚发布的universe包作为运行示例。用于搜索:
sorghum:~% cabal list universe
* universe
Synopsis: Classes for types where we know all the values
Default available version: 0.0
Installed versions: 0.0
License: BSD3
* universe-th
Synopsis: Construct a Dec's ancestor list.
Default available version: 0.0.0.6
Installed versions: [ Not installed ]
Homepage: http://github.com/jfishcoff/universe-th
License: BSD3对于依赖关系信息:
sorghum:~% cabal info universe
* universe (library)
Synopsis: Classes for types where we know all the values
Versions available: 0.0
Versions installed: 0.0
Homepage: [ Not specified ]
Bug reports: [ Not specified ]
Description: A small package, in the spirit of data-default, which allows
the munging of finite and recursively enumerable types
Category: Data
License: BSD3
Author: Daniel Wagner
Maintainer: daniel@wagner-home.com
Source repo: [ Not specified ]
Dependencies: base ==4.*, void >=0.1 && <0.6
Documentation: /home/dmwit/.cabal/x86_64/share/doc/universe-0.0/html
Cached: No
Modules:
Data.Universe
Data.Universe.Helpers下载并解压缩:
sorghum:~% cabal unpack universe
Downloading universe-0.0...
Unpacking to universe-0.0/你也可以在不使用cabal fetch解包的情况下直接下载,因为你可能会喜欢--no-dependencies标志(当然也可能不会)。
发布于 2013-03-18 07:21:27
AFAIK当前的黑客没有它。但新的has一些基本的API调用。其中大多数返回html,但也有一些返回JSON表示。
https://stackoverflow.com/questions/15467478
复制相似问题