1238 Commits

Author SHA1 Message Date
Martin Afanasjew
78f8c60343 tests: fix external command test and code style (#281)
The check that `t4` is not an external command would always succeed, but
not because the file wasn't executable, but because it wasn't even found
due to the missing `brew-` prefix.

Also change the valid but atypical file mode from 0744 to 0755 and apply
minor code style fixes.
2016-05-27 23:12:26 +02:00
Mike McQuaid
375efe0945 Remove LLVM-GCC support. (#252)
At this point it's never a good compiler to use so let's just remove it.
2016-05-22 09:40:08 +01:00
Paolo G. Giarrusso
2f20a42292 Synchronize counts for link and unlink (#242)
Closes #239.
2016-05-15 12:07:58 +01:00
Mike McQuaid
0158fc6da8 test_integration_cmds: print output on failure. (#213)
Makes it easy to debug what’s gone wrong.
2016-05-08 17:12:31 +01:00
Mike McQuaid
61614d3529 test_integration_cmds: add cleanup test. 2016-05-08 17:11:57 +01:00
Mike McQuaid
e316cc9296 Make development tools code cross-platform. 2016-05-08 16:51:22 +01:00
Mike McQuaid
931e292bf1 Make bottle code cross-platform. 2016-05-08 16:51:22 +01:00
Score_Under
b5007c48e0 Tty: Avoid truncating if not sensible
This causes truncate to simply return the original string if the
terminal is not very wide, or if the terminal is unsupported.
2016-05-03 15:56:47 +01:00
Martin Afanasjew
02289fce42 Update Homebrew/homebrew references in code
Replace `homebrew` with `brew`, `homebrew-core`, or `legacy-homebrew`
depending on context.
2016-05-02 21:19:09 +02:00
Martin Afanasjew
8600b9edf1 Update Homebrew/homebrew references in comments
Replace `homebrew` with `brew`, `homebrew-core`, or `legacy-homebrew`
depending on context.
2016-05-02 21:19:09 +02:00
Christian Moritz
bc98fd3788 Language::Node.npm_install_args: add helper method (#37)
* add Language::Node helper module

This adds a language module for Node module based formulas.
It contains the 2 public methods `std_npm_install_args(libexec)` and
`local_npm_install_args`:

* `std_npm_install_args` is intended to be used in formulas for
  standard node modules and returns `npm install` args for a global
  style module installation to libexec.
* `local_npm_install_args` is for formulas, in which the `npm install`
  step is only one of multiple parts of the installation process and
  returns `npm install` args for a default local installation in place.

Both methods have in common, that they are

* making sure that a working copy of npm and node-gyp from node's
  libexec is prepended to the PATH (to not rely of a user managed npm)
* seting the npm cache to HOMEBREW_CACHE/npm, which fixes issues caused
  by overriding $HOME resulting in long install times + high disk usage
  (see https://github.com/Homebrew/brew/pull/37#issuecomment-208840366)

* audit: update npm install check for Language::Node

* cleanup: remove npm_cache too

* doc: add Node-for-Formula-Authors.md
2016-04-27 17:08:44 +01:00
Misty De Meo
f5f41f2079 doctor: remove autotools check 2016-04-21 09:36:30 -07:00
Martin Afanasjew
b53f0c5ada tests: expand help and help-related tests
Closes #114.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-20 13:46:10 +02:00
Martin Afanasjew
d183ff8065 tests: fix Ruby 1.8 syntax warnings
In `Library/Homebrew/test/`:

test_integration_cmds.rb:431: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:502: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:507: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:585: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:709: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:710: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:711: warning: (...) interpreted as grouped expression
2016-04-20 01:42:14 +02:00
Xu Cheng
71b6e0aa18 Tap#install: better TapRemoteMismatchError check
* remote check requires `git` installed.
* Do not perform check if user does not passing remote explicitly.

Fixes #108
2016-04-19 16:29:29 +08: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
144d86f733 tests: test FormulaClassUnavailableError
Closes #101.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-17 21:16:01 +02:00
Josh Hagins
0fe6acea3a tests: ensure desc prints short name only if there are conflicts
Fixes #70.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-04-16 16:15:08 +02:00
Xu Cheng
548be81b34 tap: various improvements (#77)
* make `read_or_set_private_config` private
* add doc
* add test
2016-04-12 18:51:43 +08:00
Martin Afanasjew
7771f3af81 tests: update prune --verbose test
Closes #15.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-06 10:31:54 +02:00
Martin Afanasjew
f2245adaa7 tests: update linkapps/unlinkapps tests 2016-04-06 10:31:54 +02:00
Dominyk Tiller
776a73da7c test_cmd_audit: add plist test 2016-04-05 23:57:53 +01:00
ilovezfs
fad235d8e8 tap: support --full even if installed
Makes `tap` re-runnable and unshallows when requested with `--full`.
Tapping with a different URL raises an exception.

The homebrew/core tap cannot be untapped with `untap` so running
`brew tap --full homebrew/core` is now a built-in way to get a full
clone of this tap without resorting to workarounds.

Closes #17.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-04-05 07:25:27 -07:00
Mike McQuaid
276a797d37 Update documentation after repository split. 2016-04-03 14:03:33 +01:00
Xu Cheng
deea4c82a4 fix brew tests
Fix the `brew tests` problem caused by core/formula separation.
2016-04-02 21:51:36 +08:00
Xu Cheng
91fd357c90 Pathname: improve compute_disk_usage
* Count .DS_Store disk usage but not file count.
* Count symlink's own disk usage instead of ignoring it.
* Count hardlinks disk usage only once.
* Add testcase.

Closes Homebrew/homebrew#50563.

Closes Homebrew/homebrew#50566.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-04-01 16:30:14 +08:00
Xu Cheng
b8a4677de0 --repository: support to show tap path
This can become handy when we separate core code and formulae. For
example, we could use `cd $(brew --repo homebrew/core)` to go to core
tap path.

Closes Homebrew/homebrew#50346.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-03-24 14:52:13 +08:00
Dominyk Tiller
4f70064d73 test_diagnostic: update expected wording 2016-03-22 18:55:19 +08:00
Xu Cheng
ce7b32cec8 add HOMEBREW_ENV_PATH internal variable
`Library/ENV` like `Library/Homebrew` is part of Homebrew basecode. It
should be able to be accessed during the `brew tests`.

By adding HOMEBREW_ENV_PATH variable, we allow test suit to locate these
codes.
2016-03-21 19:07:38 +08:00
Xu Cheng
28b4923dad fix tests for deprecating SHA1
Closes Homebrew/homebrew#50272.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-03-20 14:55:58 +08:00
Baptiste Fontaine
236a18debe audit: fix crash when HOMEBREW_NO_GITHUB_API is set
Running brew audit --strict --online on a formula with a GitHub
homepage/url would crash if HOMEBREW_NO_GITHUB_API is set because
GitHub.repository returns `nil` and the audit code assumes it always
returns a hash.

Closes Homebrew/homebrew#50054.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-03-14 19:39:15 +08:00
Mike McQuaid
041c8502c5 Set HOMEBREW_API_TOKEN from Git when available.
As requested in Homebrew/homebrew#46578. Falls back to existing functionality.

Closes Homebrew/homebrew#46578.

Closes Homebrew/homebrew#49846.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-03-08 20:52:11 +08:00
Xu Cheng
0cbc285701 test_update_report: simplify test
Closes Homebrew/homebrew#49874.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-03-08 20:36:19 +08:00
Mike McQuaid
0578ba0f42 install_renamed: handle recursive installs.
Closes Homebrew/homebrew#49845.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-03-08 13:47:29 +08:00
Xu Cheng
28f3dae8cd rename CoreFormulaRepository to CoreTap
Core tap will be separated from core code in the near future.
It makes sense to rename it to CoreTap.
2016-03-07 19:43:46 +08:00
Xu Cheng
9f96e41b40 tap: add methods to get git related information
These methods will be used in `brew --version`, `brew config`
and `brew doctor` after core/formula separation.

Closes Homebrew/homebrew#49796.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-03-06 13:51:06 +08:00
Xu Cheng
eb6f970b90 tap: support --quieter flag
Closes Homebrew/homebrew#49551.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-26 18:42:36 +08: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
Xu Cheng
ba147818cb test_formulary: use CoreFormulaRepository abstraction 2016-02-26 13:33:36 +08:00
Xu Cheng
2496bdf280 remove update-ruby
Closes Homebrew/homebrew#49523.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-25 23:05:39 +08:00
Xu Cheng
79a01a47cc test_update_report: fix test
Closes Homebrew/homebrew#48546.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-25 17:22:28 +08:00
Xu Cheng
87ecd621eb add Tap#tap_migrations
This enables tap migration feature in per tap case, which will
ultimately help core/formula separation.
2016-02-25 17:22:28 +08:00
Baptiste Fontaine
1208e26c74 audit: a couple more tests
Closes Homebrew/homebrew#49404.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-02-22 12:31:51 +01:00
Baptiste Fontaine
bb37aa2824 go: warn about no-op stage_deps calls
Closes Homebrew/homebrew#49389.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-02-21 21:21:23 +01:00
Dominyk Tiller
e00375e381 test_pathname: add append_lines tests
Closes Homebrew/homebrew#49233.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-02-21 04:22:23 +00:00
Alex Dunn
f15532452e version: correctly parse codeload URLs
Needed for Homebrew/homebrew#49346.

Closes Homebrew/homebrew#49354.

Signed-off-by: Alex Dunn <dunn.alex@gmail.com>
2016-02-19 17:36:42 -08:00
Martin Afanasjew
f8a86e5962 tests: add groups and project name to coverage
Groups make it easier to get an overview of the coverage without having
to scan through a single very long list of files. They also display a
possibly helpful per-group coverage.

The project name is normally derived from the `root` directory which
happens to be `Library` in our case, thus make it explicitly `Homebrew`.

Closes Homebrew/homebrew#49303.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-02-18 21:54:14 +01:00
Mike McQuaid
26ec9f9ea0 formula: add new pour_bottle DSL with reason.
This allows there to be a user-visible description of why a bottle is
not being installed.
2016-02-18 10:21:20 +00:00
Baptiste Fontaine
4c5aee7a56 version: fix GitHub releases URLs parsing
The current code doesn't work with releases that have more than one
digit in the third group, i.e.:

  .../releases/download/1.2.3/...  works
  .../releases/download/1.2.34/... doesn't work

Closes Homebrew/homebrew#49255.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-02-17 13:23:26 +01:00
Xu Cheng
4e51c0b8ea add Tap#formula_file?
Return true if given path would present a Formula file in this Tap.
Accepts both absolute path and relative path (relative to this Tap's path)

It offer an abstraction such that caller would not need to worry about
low level file system in the tap.

It will be used in `brew pull` and `brew update`.

Closes Homebrew/homebrew#49191.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-16 14:23:39 +08:00