aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2013-11-16 14:10:23 -0600
committerJack Nagel2013-11-16 14:10:25 -0600
commit6c252b59bdefd5702eea66223469a162cd0c9ffd (patch)
tree26514d259af83cdd169b1cb89b324ac70a2fd9a0
parent018e03b967987628879d9b9d5bcc661a880c18a3 (diff)
downloadhomebrew-6c252b59bdefd5702eea66223469a162cd0c9ffd.tar.bz2
Move brew-leaves into core
Closes #24371.
-rwxr-xr-xLibrary/Contributions/cmd/brew-leaves.rb29
-rw-r--r--Library/Contributions/manpages/brew.1.md3
-rw-r--r--Library/Homebrew/cmd/leaves.rb29
-rw-r--r--share/man/man1/brew.16
4 files changed, 37 insertions, 30 deletions
diff --git a/Library/Contributions/cmd/brew-leaves.rb b/Library/Contributions/cmd/brew-leaves.rb
index b1296598b..e69de29bb 100755
--- a/Library/Contributions/cmd/brew-leaves.rb
+++ b/Library/Contributions/cmd/brew-leaves.rb
@@ -1,29 +0,0 @@
-# Outputs formulae that are installed but are not a dependency for
-# any other installed formula.
-# See: http://github.com/mxcl/homebrew/issues/issue/1438
-
-require 'formula'
-require 'set'
-require 'tab'
-
-installed = Formula.installed
-deps_of_installed = Set.new
-
-installed.each do |f|
- deps = []
-
- f.deps.each do |dep|
- if dep.optional? || dep.recommended?
- tab = Tab.for_formula(f)
- deps << dep.name if tab.with?(dep.name)
- else
- deps << dep.name
- end
- end
-
- deps_of_installed.merge(deps)
-end
-
-installed.each do |f|
- puts f.name unless deps_of_installed.include? f.name
-end
diff --git a/Library/Contributions/manpages/brew.1.md b/Library/Contributions/manpages/brew.1.md
index 6ba333e06..280664704 100644
--- a/Library/Contributions/manpages/brew.1.md
+++ b/Library/Contributions/manpages/brew.1.md
@@ -197,6 +197,9 @@ Note that these flags should only appear after a command.
If `--git` is passed, Homebrew will create a Git repository, useful for
creating patches to the software.
+ * `leaves`:
+ Show installed formulae that are not dependencies of another installed formula.
+
* `ln`, `link [--overwrite] [--dry-run] [--force]` <formula>:
Symlink all of <formula>'s installed files into the Homebrew prefix. This
is done automatically when you install formula, but can be useful for DIY
diff --git a/Library/Homebrew/cmd/leaves.rb b/Library/Homebrew/cmd/leaves.rb
new file mode 100644
index 000000000..bffa332d6
--- /dev/null
+++ b/Library/Homebrew/cmd/leaves.rb
@@ -0,0 +1,29 @@
+require 'formula'
+require 'tab'
+require 'set'
+
+module Homebrew extend self
+ def leaves
+ installed = Formula.installed
+ deps_of_installed = Set.new
+
+ installed.each do |f|
+ deps = []
+
+ f.deps.each do |dep|
+ if dep.optional? || dep.recommended?
+ tab = Tab.for_formula(f)
+ deps << dep.name if tab.with?(dep.name)
+ else
+ deps << dep.name
+ end
+ end
+
+ deps_of_installed.merge(deps)
+ end
+
+ installed.each do |f|
+ puts f.name unless deps_of_installed.include? f.name
+ end
+ end
+end
diff --git a/share/man/man1/brew.1 b/share/man/man1/brew.1
index 8878a7f79..980cbb07b 100644
--- a/share/man/man1/brew.1
+++ b/share/man/man1/brew.1
@@ -218,6 +218,10 @@ Download and patch \fIformula\fR, then open a shell\. This allows the user to ru
If \fB\-\-git\fR is passed, Homebrew will create a Git repository, useful for creating patches to the software\.
.
.TP
+\fBleaves\fR
+Show installed formulae that are not dependencies of another installed formula\.
+.
+.TP
\fBln\fR, \fBlink [\-\-overwrite] [\-\-dry\-run] [\-\-force]\fR \fIformula\fR
Symlink all of \fIformula\fR\'s installed files into the Homebrew prefix\. This is done automatically when you install formula, but can be useful for DIY installations\.
.
@@ -560,7 +564,7 @@ If set, Homebrew will not use the GitHub API for e\.g searches or fetching relev
.
.TP
HOMEBREW_INSTALL_BADGE
-Text printed before the installation summary of each successful build. Defaults to the beer emoji\.
+Text printed before the installation summary of each successful build\. Defaults to the beer emoji\.
.
.TP
HOMEBREW_SOURCEFORGE_MIRROR