Homebrew / legacy-homebrew

đź’€ The former home of Homebrew/homebrew (deprecated)
https://brew.sh
26.97k stars 11.35k forks source link

Add formula description when using 'brew info' #32517

Closed zedtux closed 10 years ago

zedtux commented 10 years ago

As of now, when doing brew info redis, you see the version and the homepage, that's it.

It would be nice to be able to have a short description of the formula like the following for the example:

Redis is an open source, BSD licensed, advanced key-value cache and store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets, sorted sets, bitmaps and hyperloglogs.

I have built brewformulas.org (sources available on Github) which is a service to provide the description of a Homebrew formula. Recently, someone asked me to implement an API which allows people to get a JSON out of brewformulas.org.

In the example of Redis, you can then call http://brewformulas.org/Redis.json which returns you the following:

{
  "formula":"redis",
  "description":"Redis is an open source, BSD licensed, advanced key-value cache and store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets, sorted sets, bitmaps and hyperloglogs.",
  "reference":"Extracted automatically from Redis homepage",
  "homepage":"http://redis.io/",
  "version":"",
  "dependencies":[],
  "dependents":[]
}

It shouldn't be so hard to then show this in the brew info redis. :-)

jacknagel commented 10 years ago

If we're going to integrate package descriptions into core (which we've been hesitant to do in the past for maintenance reasons), I think we'd want them under our control somehow (not a knock against your project--it's great!). And I'm not sure we really want brew info to be making network requests.

There is also https://github.com/telemachus/homebrew-desc (which provides a brew desc command) for local package descriptions. There's been talk of integrating it in some fashion, but so far nothing has materialized for review.

zedtux commented 10 years ago

Well I did my project after having growled several times due to the missing description in brew info. It where people are looking for details about a formula.

homebrew-desc is nice but my project is retrieving automatically the descriptions, meaning when you will add a new formula, on the next import, and if supported, I will provide you a description automatically.

I think we'd want them under our control somehow

I'm completely open for discussion. Let me know what mean under our control and I can fix it :)

MikeMcQuaid commented 10 years ago

Under our control means having them somewhere in our Git repository with the formulae themselves. I'm also in favour of making brew desc more integrated rather than using an online-only or in-formula solution.

DomT4 commented 10 years ago

It may be way out of my league, but I'm happy and willing to try and take a crack at coming up with a simple, integrated, Homebrew-shipped description utility after I'm done with the Luarocks fixes.

MikeMcQuaid commented 10 years ago

@DomT4 Honestly, I think it is I'm afraid. The problem isn't just getting a utility (brew-desc does that pretty well) but getting the descriptions for all packages and deciding on the level of integration. As an interim step though perhaps if we detect brew desc is installed then brew info could output the description too?

DomT4 commented 10 years ago

@mikemcquaid Fair comment. I'm never afraid to give these things a shot, especially the big projects, but I'll self confess to still having a lot to learn in this area (Especially with Ruby & Git, both of which I love, but I'm prone to some comical beginner mistakes :grinning:).

If someone else wants to take a shot at gently detecting if Brew Desc is installed and then leaning on that for package information I'm entirely willing to let someone with greater knowledge on the subject than myself do so. Otherwise I'll toss some ideas around in my head and see if I can think of something that works, at least adequately, until Homebrew can come up with a more permanent solution.

MikeMcQuaid commented 10 years ago

which("brew-desc") should be enough. Good luck!

zedtux commented 10 years ago

Anyway my project will never been used right ?

MikeMcQuaid commented 10 years ago

Not as described, sorry @zedtux.

DomT4 commented 9 years ago

Discussion here if Homebrew maintainers want to throw in thoughts/comments/"this is a terrible idea"/etc that's more than welcome.