Brew Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 33: Line 33:
=Keg=
=Keg=


A ''keg'' is the installation prefix of a [[#Formula|formula]]. The corresponding directories are stored in [[#Cellar|cellar]].
A ''keg'' is the installation prefix of a [[#Formula|formula]], and it can be logically thought of as an installed application (name + version). The corresponding directories are stored in [[#Cellar|cellar]].


Example:
Example:

Revision as of 18:15, 20 April 2018

Internal

Formula

A formula is a package definition written in Ruby. Homebrew comes with a good amount of existing formulae, and they are stored as Ruby files in the default tap named "homebrew": /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/<package-name>.rb.

New formulae can be can be created. Instructions are available here: https://docs.brew.sh/Formula-Cookbook. The sequence is:

brew create <URL> 

where <URL> is a zip or tar file, installed with

brew install <formula>

and debugged with:

brew install --debug --verbose <formula>

Formula API: http://www.rubydoc.info/github/Homebrew/brew/master/Formula

Common Formulate

bash

/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/bash.rb

Tap

A tap is a Git repository of formulae and other commands.

Keg

A keg is the installation prefix of a formula, and it can be logically thought of as an installed application (name + version). The corresponding directories are stored in cellar.

Example:

/usr/local/Cellar/foo/0.1

Cellar

The directory where all kegs are stored:

/usr/local/Cellar

Bottle

Cask

User Space vs. System Space

Commands

update

Fetches the latest version of Homebrew and all formulae and upgrades.

doctor

Checks the Homebrew installation for potential problems and exit with a non-zero status if potential problems are found.

cleanup

Remove old version from cellar for all installed (or specified) formulae. Old downloads from the Homebrew download-cache are deleted.