9036 Commits

Author SHA1 Message Date
Andrea Kao
4f95f7ff84 tests: add cmd/irb integration test (#501) 2016-07-19 17:33:36 +02:00
Andrea Kao
4b40a87ca4 tests: nest HOMEBREW_TEMP inside TEST_TMPDIR (#554) 2016-07-19 17:23:44 +02:00
Martin Afanasjew
5768e32ad2 test-bot: fix coverage on Travis CI
Make sure to call `brew tests` only once with `--coverage` to avoid
expensive multiple runs and to prevent later runs from overwriting
previously sent results to Coveralls. (The previous setup overwrote the
results from a regular run with results from the `--generic` run.)

The `--no-compat` variant without any other options specified seemed to
be the most appropriate for a coverage report.

Closes #546.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-07-19 02:04:41 +02:00
Martin Afanasjew
9cf508c6e0 tests: use SimpleCov 0.12.0 and Coveralls 0.8.14
SimpleCov 0.12.0 brings some moderate speed improvements and soon (sadly
not yet) can be switched back to a stable release. Update to matching
Coveralls release, fortunately with fewer dependencies than before.
2016-07-19 02:04:40 +02:00
Martin Afanasjew
c6983aade9 tests: strip Homebrew prefix from coverage report
Make `Library/Homebrew` the new root now that *all* implementation files
are in this directory. Update filters/groups accordingly.

Note that paths in filters/groups are not anchored at the root and are
always matched against the full path. Our rules are effectively anchored
because they always include the `/Homebrew/` path component.
2016-07-19 02:04:40 +02:00
ilovezfs
45bfd2b94a inreplace: support for audit arg in non-block form
Provides feature parity between the block and non-block forms of
inreplace by creating a four-argument version of the non-block form,
where the fourth argument is an optional Boolean value, defaulting to
true, which specifies whether a failed inreplace should cause an
InreplaceError error to be raised. The fourth argument is passed along
to StringInreplaceExtension#gsub!, which already supports an optional
audit_result argument.

This resolves the Catch-22 that single replacements aren't permissible
in the block form (in that they now cause `brew audit` to complain), but
the audit_result argument is not available in the non-block form.

Closes #552.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-07-18 09:24:08 -07:00
Xu Cheng
d7ee541293
reinstall: handle new options
Since we are loading options as Formula#build from tab, we will have to explicitly read
options from ARGV as well.

Fixes #3066.

Closes #537.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-07-18 18:11:54 +08:00
Xu Cheng
820b6347b8
remove unnecessary Tab.for_formula
We already loaded tab in ARGV.resolved_formulae or Formulary.from_rack
2016-07-18 18:11:53 +08:00
Xu Cheng
e008f6e53c
remove unnecessary build options manipulation for test and postinstall
We already loaded build options in ARGV.resolved_formulae for test and
postinstall
2016-07-18 18:11:53 +08:00
Xu Cheng
91a47a9ed6 LinkageChecker: simplify logic (#538)
BuiltOptions#without? already handles the option_names for dependencies.

Also check disabled recommended deps.
2016-07-18 18:07:00 +08:00
Dominyk Tiller
a3a6a8381d
mac/diagnostic: add check_for_prerelease_xcode
Closes #524.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-07-17 23:39:16 +01:00
Dominyk Tiller
a59d346fcf
xcode: track prerelease releases 2016-07-17 23:39:15 +01:00
Xu Cheng
b6772c1fde
create: path.version may be nil
Fixes https://github.com/Homebrew/homebrew-core/issues/3067.
2016-07-18 00:03:56 +08:00
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
Margaret Lewicka
b512834243 audit: prevent crash from nil exitstatus (#532)
If rubocop invocation from brew audit exits with nil exitstatus,
brew audit fails with 'undefined method `>' for nil:NilClass'.
2016-07-16 22:58:47 +02:00
Uladzislau Shablinski
242508fca4 software_spec: use version dups for resources (#534)
Also prevent the commit of formula's HeadVersion from passing to the resource. 

This is a fix of #531
2016-07-17 04:49:32 +08:00
Martin Afanasjew
ccb11935f6 os/mac/xcode: fix CVS/GCC check if no Xcode
On systems prior to 10.9, formulae that use CVS as a download source
check whether the installed Xcode already provides CVS to avoid adding
a dependency on the `cvs` formula. Unfortunately, if no Xcode is
installed the check fails with

  undefined method `<' for nil:NilClass

causing the formula to become unloadable. This in turn causes some taps
to be untappable since #396 added the `readall` check on `tap`.

Closes #508.
2016-07-16 21:31:17 +02:00
Xu Cheng
f49233c89b
Tab#for_formula: using Formula#installed_prefix
Closes #529.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-07-17 02:23:37 +08: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
1eaa95b805
Keg#link: run optlink first
This prevents a link conflict during `brew upgrade` causing opt link
stuck to old version. At this point, users will have to run `brew switch`
to fix it.

Closes #533.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-07-17 02:16:18 +08:00
Xu Cheng
177d988917
brew.sh: make sudo-checker cross-platform 2016-07-17 02:07:06 +08:00
ilovezfs
356018501b ENV: fix homebrew_extra_pkg_config_paths
Switch to HOMEBREW_LIBRARY since HOMEBREW_LIBRARY_PATH already includes
"/Homebrew" and HOMEBREW_LIBRARY is less confusing.

Closes #530.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-07-16 08:09:43 -07:00
Vlad Shablinsky
4b2c4ef258
Update and test eligible_kegs_for_cleanup
Closes #478.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-07-16 20:39:14 +08:00
Vlad Shablinsky
3fb5d70a72
Unify Version.create usage
Substitue each Version.new and HeadVersion.new with Version.create
to unify Version and HeadVersion instantiation among core code.

Note that this does not relate to Mac::OS::Version class.
2016-07-16 20:39:13 +08:00
Vlad Shablinsky
454003c4c1
test_formula: test new HEAD methods
* Test `Formula#update_head_version`
* Test `Formula#latest_head_prefix`
2016-07-16 20:39:13 +08:00
Vlad Shablinsky
458f9a008c
Apply tests to new HEAD format 2016-07-16 20:39:13 +08:00
Vlad Shablinsky
00cdd5f481
Add HeadVersion tests 2016-07-16 20:39:13 +08:00
Vlad Shablinsky
2e916110e4
Use HeadVersion for install/reinstall 2016-07-16 20:39:13 +08:00
Vlad Shablinsky
8a968a0b60
resource: detect HEAD versions 2016-07-16 20:39:13 +08:00
Vlad Shablinsky
9ac5836604
pkg_version: allow HeadVersion and HEAD revisions 2016-07-16 20:39:13 +08:00
Vlad Shablinsky
80489dcb49
version: introduce HeadVersion 2016-07-16 20:39:13 +08:00
Mike McQuaid
90e84453f9 test-bot: re-add update-test. (#521) 2016-07-16 07:05:51 +01:00
Josh Hagins
4abdeb7b5e update: Don't report formulae that are moved within a tap but not renamed (#480) 2016-07-16 07:18:30 +02:00
Mike McQuaid
91d32e77ad Deprecate homebrew/binary. (#512)
We're moving more stuff to Homebrew Cask which is better maintained and run.
2016-07-15 22:05:03 +01:00
Dominyk Tiller
3d06f883b9
osxfuse_requirement: update PKG_CONFIG_PATH 2016-07-15 21:25:02 +01:00
Mike McQuaid
0d0519d48d update.sh: fix Git path.
Closes https://github.com/Homebrew/brew/issues/519
Closes https://github.com/Homebrew/homebrew-core/issues/3029
2016-07-15 19:38:27 +01:00
Mike McQuaid
a07ab8bb92 brew.{rb,sh}: move to Library/Homebrew. (#506) 2016-07-15 19:33:30 +01:00
Mike McQuaid
a02be9eea2 ENV: move to new paths. (#507)
Move some stuff formerly in `Library/ENV` around:
- Move `Library/ENV/$XCODE_VERSION` to `Library/Homebrew/env/super` as they are
  all superenv wrappers and all symlinks to the same version. We never needed
  the "separate shims for separate versions" functionality and it just adds
  confusion.
- Move `Library/ENV/pkgconfig` to `Library/Homebrew/env/pkgconfig` to get more
  things under `Library/Homebrew`
- Move `Library/ENV/scm` to `Library/scm` as these wrappers are not actually
  used by or related to superenv (or stdenv) in any way.
2016-07-15 19:03:45 +01:00
Xu Cheng
de366f71b9 respect user's curlrc file (#516)
Users may have ~/.curlrc file to include options like proxies.
However, since we overwrite HOME environment variable during the build
and test, curl won't be able to find it.

This commit solves this issue by using CURL_HOME environment variable,
which will be pointed to the original HOME path.

From `curl(1)`:
> 1) curl tries to find the "home dir": It first  checks  for  the
     CURL_HOME and then the HOME environment variables. Failing that,
     it uses getpwuid() on Unix-like systems (which returns the  home
     dir  given the current user in your system). On Windows, it then
     checks for the APPDATA variable, or as a last resort the '%USER-
     PROFILE%\Application Data'.
2016-07-15 20:55:34 +08:00
Mike McQuaid
2b078be186 test-bot: remove Jenkins Git debugging. 2016-07-15 13:21:13 +01:00
Mike McQuaid
3260397632 test-bot: more reset/cleanup tweaks. 2016-07-15 13:19:44 +01:00
Mike McQuaid
d34b93fa1c test-bot: print out git commands on Jenkins. 2016-07-15 13:14:52 +01:00
Mike McQuaid
ec1da60941 test-bot: don't cleanup brew repo twice. 2016-07-15 13:10:39 +01:00
Xu Cheng
3995d237dd
formulary: add missing keg.rack 2016-07-15 19:59:35 +08:00
Xu Cheng
b62a2c7e7f
add more test
Closes #514.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-07-15 19:57:23 +08:00
Xu Cheng
30bbb93f21
tab: add missing methods
This makes `Tab` compatible with `BuildOptions`.
2016-07-15 19:57:23 +08:00
Xu Cheng
c021f37525
add Formulary#from_keg 2016-07-15 19:57:23 +08:00
Xu Cheng
7452dcf508
ARGV#resolved_formulae: also load build options 2016-07-15 19:57:23 +08:00