Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Can’t brew upgrade (with no arguments) #8576

Closed
s4y opened this issue Nov 14, 2011 · 2 comments
Closed

Can’t brew upgrade (with no arguments) #8576

s4y opened this issue Nov 14, 2011 · 2 comments
Labels

Comments

@s4y
Copy link

s4y commented Nov 14, 2011

When I ran brew upgrade for the first time after updating to cfd9d50, I got this:

==> Upgrading 6 outdated packages, with result:
lame 3.99.1, ffmpeg 0.8.6, gnutls 2.12.14, node 0.6.1, plt-racket 5.2, wireshark 1.7.0
==> Upgrading lame
This command requires a formula argument

brew upgrade lame worked, but now brew upgrade gives me this:

==> Upgrading 5 outdated packages, with result:
ffmpeg 0.8.6, gnutls 2.12.14, node 0.6.1, plt-racket 5.2, wireshark 1.7.0
==> Upgrading ffmpeg
This command requires a formula argument

Any ideas?

@Sharpie
Copy link
Contributor

Sharpie commented Nov 14, 2011

Ahh... it appears pull request #7784 exposed a weird corner case in ARGV.formulae:

def formulae
  require 'formula'
  @formulae ||= downcased_unique_named.map{ |name| Formula.factory name }
  raise FormulaUnspecifiedError if @formulae.empty?
  @formulae
end

@jacknagel @mxcl @MikeMcQuaid @adamv

Should ARGV.formulae really raise a FormulaUnspecifiedError if it comes up with an empty list? What is wrong with having an empty list?

@Sharpie
Copy link
Contributor

Sharpie commented Nov 14, 2011

Allright, pushed a hotfix for this.

I still think an empty list is a valid return value for ARGV.formulae and that it shouldn't be throwing exceptions. But that is a cleanup task for another day.

wrigleyster pushed a commit to wrigleyster/homebrew that referenced this issue Nov 17, 2011
The `filtered_args` method added to the `FormulaInstaller` makes a call
`ARGV.formulae`. Unfortunately, `ARGV.formulae` will throw a
`FormulaUnspecifiedError` instead of returning an empty list. This patch
avoids the issue by checking `ARGV.named.empty?` before calling
`ARGV.formulae`.

Fixes Homebrew#8576.
etehtsea pushed a commit to etehtsea/homebrew that referenced this issue Dec 24, 2011
The `filtered_args` method added to the `FormulaInstaller` makes a call
`ARGV.formulae`. Unfortunately, `ARGV.formulae` will throw a
`FormulaUnspecifiedError` instead of returning an empty list. This patch
avoids the issue by checking `ARGV.named.empty?` before calling
`ARGV.formulae`.

Fixes Homebrew#8576.
etehtsea pushed a commit to etehtsea/homebrew that referenced this issue Dec 27, 2011
The `filtered_args` method added to the `FormulaInstaller` makes a call
`ARGV.formulae`. Unfortunately, `ARGV.formulae` will throw a
`FormulaUnspecifiedError` instead of returning an empty list. This patch
avoids the issue by checking `ARGV.named.empty?` before calling
`ARGV.formulae`.

Fixes Homebrew#8576.
snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
The `filtered_args` method added to the `FormulaInstaller` makes a call
`ARGV.formulae`. Unfortunately, `ARGV.formulae` will throw a
`FormulaUnspecifiedError` instead of returning an empty list. This patch
avoids the issue by checking `ARGV.named.empty?` before calling
`ARGV.formulae`.

Fixes Homebrew#8576.
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants