146 Commits

Author SHA1 Message Date
Uladzislau Shablinski
092d4712a1 Update commit when resolving the formula (#536) 2016-07-17 16:56:13 +08:00
Martin Afanasjew
2633f888d4 extend/ARGV: avoid assignment in argument list
Aside from being bad style, this also assigns to an unused variable.
2016-07-17 02:31:07 +02:00
Xu Cheng
7e14ec0ba6
ARGV#kegs: using installed_prefix to locate keg 2016-07-17 02:23:37 +08:00
Xu Cheng
f811a45fe4
ARGV#resolved_formulae: check whether input is a formula file 2016-07-17 02:23:37 +08:00
Xu Cheng
7452dcf508
ARGV#resolved_formulae: also load build options 2016-07-15 19:57:23 +08:00
Martin Afanasjew
1087df1016 ARGV: fix 'value' method, make it more predictable
The fix changes behavior in same cases, but those cases were all either
broken or showed unexpected behavior. The new behavior is very simple:

- If an argument starts with `--<option-name>=`, return whatever comes
  after the equals sign.

Prior to this change, `ARGV.value` showed some unexpected behavior:

- `ARGV.value("foo")` returned `nil` for `--foo=` because at least one
  character needed to be present after the equals sign. (All other
  option parser implementations I'm aware of allow for empty values.)

- `ARGV.value("bar")` returned `"baz"` for `--foo=--bar=baz` because the
  regular expression was not anchored to the start of the argument.

- `ARGV.value("++")` raised an exception because the string wasn't
  escaped for use in the regular expression. (An unlikely corner case.)

Closes #231.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-05-12 08:09:19 +02:00
Andrew Janke
d887dd39ec brew install: make -s apply only to given formula, not deps (#205) 2016-05-06 12:02:13 -07:00
Andrew Janke
acc9a7ca85 brew test, install, update-test: add --keep-tmp option
Also enables sandbox for --interactive and --debug use of install
and test, using automatic retention.

Closes #66.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-18 12:23:08 -04:00
Martin Afanasjew
c6536066dc ARGV: remove unused 'usage' method
Also remove related helper method `Homebrew.help_s`.
2016-04-18 00:52:32 +02:00
Xu Cheng
73b79de7bc ARGV: switch? should only has one dash
If user inputs argument such as `-with-flag`, we can assume it's a bad flag.

Closes Homebrew/homebrew#49256

Closes Homebrew/homebrew#49550.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-26 16:50:55 +08:00
Martin Afanasjew
70ec2a7875 ARGV: stop supporting --homebrew-developer option
Homebrew developers have the corresponding variable permanently set in
their environment and wanting to appear like a Homebrew developer for a
single invocation is exceedingly rare. Additionally, the option won't be
recognized by `bin/brew`. (It is also undocumented.)

Using `HOMEBREW_DEVELOPER=1 brew <command>` is still possible, and not
more inconvenient than passing the `--homebrew-developer` option.

Closes Homebrew/homebrew#48322.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-02-11 13:15:37 +01:00
Mike McQuaid
307ca85e0e ARGV: add explicit option for disabling sandbox. 2015-11-10 09:09:03 +00:00
Xu Cheng
a88c40b8c8 core file style update 2015-08-22 13:15:33 +08:00
Misty De Meo
727239e12f Merge bottle install without Xcode branch
Merge branch 'bottle_hooks'
2015-08-21 11:04:22 -07:00
William Woodruff
8793a68ee4 Add no-Xcode documentation for all classes, methods 2015-08-21 11:02:33 -07:00
William Woodruff
91e598cf3f Install: add BuildToolsError and BuildFlagsError
Add these new errors, and guards in formula installation and
cmd/{,un,re}install to match, move can_build? to the MacOS module,
flatten conditions, remove redundant can_build? check

reinstate removed (doctor) check
2015-08-21 10:59:09 -07:00
Xu Cheng
e1779503b7 ARGV#resolved_formula: use to_rack 2015-08-10 21:59:50 +08:00
Vlad Shablinsky
6a0dcc8324 don't use new name rack if old name rack is a dir
Everything that used HOMEBREW_CELLAR/canonical_name
could point to something that doesn't exist because
loader_for tries to load new name formula if no old
name found. However there can be software installed
from path with the same name that renamed formulae
had and we still need to link/unlink/uninstall etc
that software. The solution is Formulary#to_rack
method that returns rack for given name.
- Add Formulary#to_rack
- Update ARGV.kegs
- Update cmd/switch
2015-08-10 13:57:59 +01:00
CNA-Bld
194618beb8 implement formulary#find_with_priority 2015-08-10 12:17:26 +01:00
Xu Cheng
df999067d6 ARGV#resolved_formulae: use canonical_name to locate rack
Closes Homebrew/homebrew#42537.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-09 20:09:57 +08:00
Misty De Meo
176e55386c ARGV: don't downcase bottle filenames
Fixes Homebrew/homebrew#42470.
2015-08-05 09:51:37 -07:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Xu Cheng
640109f73d ARGV#resolved_formulae: auto resolve spec 2015-07-31 19:44:03 +08:00
Xu Cheng
773db6a3ba ARGV#spec: allow pass default value 2015-07-31 19:44:02 +08:00
Xu Cheng
d2f7a2c410 ARGV#kegs: try to load fomrula from rack 2015-05-27 13:53:40 +08:00
Xu Cheng
60383be032 ARGV: add resolved_formulae method 2015-05-27 13:53:40 +08:00
Xu Cheng
2f529220e7 preliminary write control only sandbox
Closes Homebrew/homebrew#38361.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-04-09 17:42:54 +08:00
Mike McQuaid
52cda8fd80 Allow searching/installing Homebrew Casks.
People want to install things like GIMP using Homebrew so let's make it
easier for them to find a decent installation method.

Closes Homebrew/homebrew#34496.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-11-30 17:59:02 +00:00
Jack Nagel
3c9cc18c17 Add ARGV.git? 2014-11-03 21:39:11 -06:00
Jack Nagel
b14851903c Add a method for retrieving only flags from ARGV 2014-08-29 19:38:32 -05:00
Jack Nagel
db04b04135 Simplify implementation of ARGV.flag? and ARGV.switch? 2014-08-28 22:11:08 -05:00
Jack Nagel
54348f55d8 Use two-argument form of String#slice 2014-08-28 22:11:08 -05:00
Jack Nagel
e18da89f3c Implement ARGV.named in terms of ARGV.options_only 2014-08-28 22:11:08 -05:00
Jack Nagel
7a5e4f5cca ARGV.spec should be private 2014-08-28 21:35:52 -05:00
Phillip Calvin
d4b6d8ec96 Remove commentary from error message
It might be best not to use the word "lame" here, as it's often considered to be an ableist slur.

Closes Homebrew/homebrew#30915.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-07-17 12:11:57 -05:00
Jack Nagel
ef9f6ec4af Accept -s as shorthand for --build-from-source
This is experimental and will be reverted if it causes problems.

Closes Homebrew/homebrew#30392.
2014-07-02 23:15:22 -05:00
Jack Nagel
70f22fc31e Use canonical_name in the exception message 2014-06-26 22:59:45 -05:00
Jack Nagel
cfd02fd415 Use canonical_name when checking LinkedKegs and opt
name is the user-provided string and may be an alias, path, or URL.
2014-06-26 22:57:49 -05:00
Jack Nagel
401bc1c6c7 The rack variable is only used inside the block now 2014-06-26 22:36:49 -05:00
Jack Nagel
301f1b20e6 Remove a dead branch from ARGV.kegs
rack cannot be nil at the point where FormulaUnavailableError is raised,
so we don't need a branch to deal with that.
2014-06-26 22:28:00 -05:00
Jack Nagel
dce7b04ea5 Simplify NoSuchKegError condition
dirs will be empty if the rack directory does not exist.
2014-06-26 22:26:13 -05:00
Jack Nagel
4d9d01893e Move deprecated Formula class methods to compat
These have all been moved to Formulary.
2014-06-22 15:03:17 -05:00
Jack Nagel
445dd80e44 Remove ARGV.filter_for_dependencies 2014-06-20 21:32:36 -05:00
Jack Nagel
10fda9e9b9 Decouple spec selection from ARGV 2014-06-20 21:32:36 -05:00
Adam Vandenberg
2c61e3c02a --help and --version only apply as first argument
This fixes external commands that provide their own
help and version subcommands.

Closes Homebrew/homebrew#26755.
2014-05-27 21:03:05 -07:00
Jack Nagel
d8bdcf84af Remove obsolete guards around canonical_name return value 2014-04-05 22:03:49 -05:00
Jack Nagel
ce1f598e98 Avoid realpath where it is not necessary
Symlinks in opt and LinkedKegs point directly at a keg in the cellar, so
only resolving one symlink should suffice, and make it clear what path
we are actually interested in.
2014-04-05 12:17:19 -05:00
Jack Nagel
e0216d95af Prefer opt prefix over linked keg entry when picking active keg 2014-03-15 16:57:37 -05:00
Jack Nagel
3b3b782ba9 Add an extra sanity check 2014-03-15 16:56:51 -05:00
Jack Nagel
13f8c7ab95 Refactor ARGV.kegs 2014-03-15 16:56:40 -05:00