New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`brew bundle check` should list whats missing #147

Closed
0xdevalias opened this Issue Feb 8, 2016 · 7 comments

Comments

3 participants
@0xdevalias

0xdevalias commented Feb 8, 2016

The current message could be improved if it said what dependencies aren't currently installed, rather than the opaque message:

brew bundle can't satisfy your Brewfile's dependencies.

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Feb 8, 2016

Member

When the solution is just to run brew bundle does it matter what the message says?

Member

MikeMcQuaid commented Feb 8, 2016

When the solution is just to run brew bundle does it matter what the message says?

@0xdevalias

This comment has been minimized.

Show comment
Hide comment
@0xdevalias

0xdevalias Feb 8, 2016

If you blindly follow messages hen probably not. Personally I like to know why something is required/what it wants to do before it does.
For example, I can't imagine why there would be any differences since I just dumped the bundle file from my currently installed stuff, yet it tells me it needs to install. If it said what was missing it's be far easier to track it down.

0xdevalias commented Feb 8, 2016

If you blindly follow messages hen probably not. Personally I like to know why something is required/what it wants to do before it does.
For example, I can't imagine why there would be any differences since I just dumped the bundle file from my currently installed stuff, yet it tells me it needs to install. If it said what was missing it's be far easier to track it down.

@ilovezfs

This comment has been minimized.

Show comment
Hide comment
@ilovezfs

ilovezfs Feb 10, 2016

Contributor

@alias1 Funny you asked about this. I just noticed this issue, but I'd already implemented it locally. Something must be in the water.

Josephs-MacBook-Pro:~ joe$ brew bundle check --global
xz
libgcrypt
emacs --with-cocoa --with-x11 --with-gnutls --HEAD
node
homebrew/dupes/rsync
brew bundle can't satisfy your Brewfile's dependencies.
Install missing dependencies with `brew bundle install`.
Josephs-MacBook-Pro:~ joe$
From 84cedca0ab2dbefd24d3ff09c13927c2481cb7b3 Mon Sep 17 00:00:00 2001
From: ilovezfs <ilovezfs@icloud.com>
Date: Sat, 6 Feb 2016 22:16:46 -0800
Subject: [PATCH] `check` should report missing and upgradable

Currently, this only supports the Homebrew subset.
---
 lib/bundle/commands/check.rb | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/bundle/commands/check.rb b/lib/bundle/commands/check.rb
index 648618b..709c197 100644
--- a/lib/bundle/commands/check.rb
+++ b/lib/bundle/commands/check.rb
@@ -30,6 +30,13 @@ module Bundle::Commands
     def self.any_formulae_to_install?
       @dsl ||= Bundle::Dsl.new(Bundle.brewfile)
       requested_formulae = @dsl.entries.select { |e| e.type == :brew }.map(&:name)
+      needs = []
+      requested_formulae.each do |f|
+        if !Bundle::BrewInstaller.formula_installed_and_up_to_date?(f)
+          needs << @dsl.entries.select { |e| e.name == f }.map { |e| args = e.options[:args] ; args.nil? ? e.name : e.name + " " + "--" + args.join(" --") }
+        end
+      end
+      puts needs.flatten.join("\n")
       requested_formulae.any? do |f|
         !Bundle::BrewInstaller.formula_installed_and_up_to_date?(f)
       end
-- 
2.7.1


Contributor

ilovezfs commented Feb 10, 2016

@alias1 Funny you asked about this. I just noticed this issue, but I'd already implemented it locally. Something must be in the water.

Josephs-MacBook-Pro:~ joe$ brew bundle check --global
xz
libgcrypt
emacs --with-cocoa --with-x11 --with-gnutls --HEAD
node
homebrew/dupes/rsync
brew bundle can't satisfy your Brewfile's dependencies.
Install missing dependencies with `brew bundle install`.
Josephs-MacBook-Pro:~ joe$
From 84cedca0ab2dbefd24d3ff09c13927c2481cb7b3 Mon Sep 17 00:00:00 2001
From: ilovezfs <ilovezfs@icloud.com>
Date: Sat, 6 Feb 2016 22:16:46 -0800
Subject: [PATCH] `check` should report missing and upgradable

Currently, this only supports the Homebrew subset.
---
 lib/bundle/commands/check.rb | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/bundle/commands/check.rb b/lib/bundle/commands/check.rb
index 648618b..709c197 100644
--- a/lib/bundle/commands/check.rb
+++ b/lib/bundle/commands/check.rb
@@ -30,6 +30,13 @@ module Bundle::Commands
     def self.any_formulae_to_install?
       @dsl ||= Bundle::Dsl.new(Bundle.brewfile)
       requested_formulae = @dsl.entries.select { |e| e.type == :brew }.map(&:name)
+      needs = []
+      requested_formulae.each do |f|
+        if !Bundle::BrewInstaller.formula_installed_and_up_to_date?(f)
+          needs << @dsl.entries.select { |e| e.name == f }.map { |e| args = e.options[:args] ; args.nil? ? e.name : e.name + " " + "--" + args.join(" --") }
+        end
+      end
+      puts needs.flatten.join("\n")
       requested_formulae.any? do |f|
         !Bundle::BrewInstaller.formula_installed_and_up_to_date?(f)
       end
-- 
2.7.1


@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Feb 10, 2016

Member

The problem is: we don't check to find everything that's missing for speed as it's much slower than just looking for a single thing that's missing.

Member

MikeMcQuaid commented Feb 10, 2016

The problem is: we don't check to find everything that's missing for speed as it's much slower than just looking for a single thing that's missing.

@ilovezfs

This comment has been minimized.

Show comment
Hide comment
@ilovezfs

ilovezfs Feb 10, 2016

Contributor

@MikeMcQuaid Yeah, if this were to actually be integrated, I think it would probably need to be either

  1. an option to pass to check (neither verbose nor debug is quite accurate) (e.g., brew bundle check --assess=[first|all|missing|upgradable] or brew bundle check --report-all)
  2. a dry-run/-n option for the subcommandless invocation (i.e., brew bundle --dry-run)
  3. its own command (e.g., brew bundle assess [first|all|missing|upgradable|formula] or brew bundle assess [--first|--all|--missing|--upgradable]|<formulae>)
  4. something else
Contributor

ilovezfs commented Feb 10, 2016

@MikeMcQuaid Yeah, if this were to actually be integrated, I think it would probably need to be either

  1. an option to pass to check (neither verbose nor debug is quite accurate) (e.g., brew bundle check --assess=[first|all|missing|upgradable] or brew bundle check --report-all)
  2. a dry-run/-n option for the subcommandless invocation (i.e., brew bundle --dry-run)
  3. its own command (e.g., brew bundle assess [first|all|missing|upgradable|formula] or brew bundle assess [--first|--all|--missing|--upgradable]|<formulae>)
  4. something else
@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Feb 10, 2016

Member

a dry-run/-n option for the subcommandless invocation (i.e., brew bundle --dry-run)

This seems like the best idea to me. I had to check this option wasn't already there because I thought it was.

Member

MikeMcQuaid commented Feb 10, 2016

a dry-run/-n option for the subcommandless invocation (i.e., brew bundle --dry-run)

This seems like the best idea to me. I had to check this option wasn't already there because I thought it was.

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Feb 15, 2016

Member

Passing on this issue as-is but would accept a --dry-run pull request.

Member

MikeMcQuaid commented Feb 15, 2016

Passing on this issue as-is but would accept a --dry-run pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment