747 Commits

Author SHA1 Message Date
Lionell
610dfe0fc2 audit: fixed with PR comments. Refactored get_repo_license api call and audit_license only new_formula 2020-06-18 00:44:33 +08:00
Mike McQuaid
854e96c7c5
Merge pull request #7686 from maxim-belkin/test_ruby_update
utils/ruby.sh: update `test-ruby` (and rename to test_ruby)
2020-06-12 09:13:15 +01:00
Bo Anderson
87931e1c03 utils/ruby.sh: set TERMINFO_DIRS to bundled terminfo 2020-06-10 14:36:18 +01:00
Maxim Belkin
23d24dfed7
utils/ruby.sh: rely on test_ruby's exit code
Instead of printing "true" or "false", test_ruby now returns 1 when
tested Ruby is not usable and 0 if it is.
2020-06-10 07:56:37 -05:00
Maxim Belkin
9751d3bb8c
Fix calls to 'test_ruby' in conditional statements
Co-authored-by: Shaun Jackman <sjackman@gmail.com>
2020-06-06 12:03:51 -05:00
rmnull
a7405601f3
Use Gem to install gems instead of invoking system 2020-06-04 11:36:58 +05:30
Maxim Belkin
58f3e49c0b
utils/ruby.sh: rename test-ruby to test_ruby. Cosmetic changes 2020-06-03 18:01:38 -05:00
Mike McQuaid
b615de1bc3
utils/gems: always ensure default Gems are in GEM_PATH.
Fixes #7608.
2020-06-03 10:02:46 +01:00
Mike McQuaid
aa81982aba
brew style --fix 2020-06-02 09:49:23 +01:00
Sean Molenaar
a99d428f6d
Only search pull requests for artifacts 2020-05-28 15:14:32 +02:00
Mike McQuaid
0b6ae538d1
Merge pull request #7545 from maxim-belkin/keep_ruby_path_set
utils/ruby.sh: search PATH for Ruby on Linux. update.sh: keep HOMEBREW_RUBY_PATH set.
2020-05-27 15:19:12 +01:00
Sean Molenaar
3567892802
Add notibility checks for casks 2020-05-26 14:21:25 +02:00
Mike McQuaid
ef95b59ed4
Remove HomebrewArgvExtension
Fixes #5730
2020-05-23 19:39:11 +01:00
Mike McQuaid
e1f3c8d2b3
Merge pull request #7579 from MikeMcQuaid/deprecations
Update deprecations
2020-05-23 14:38:10 +01:00
Maxim Belkin
5d3456f485
utils/ruby.sh: make code more readable
1. Repurpose 'vendor_ruby_current_version' variable:
   now this is not a pointer to a file but actual version number
2. Introduce 'vendor_ruby_latest_version' variable:
   it holds the value of the latest version of portable Ruby
2020-05-21 17:15:14 -05:00
Maxim Belkin
db561eb7b9
utils/ruby.sh: setup-ruby: handle 'vendor-install' cmd early
Exit from the 'setup-ruby' function when user issued
`vendor-install` command.
We do so instead of wrapping everything in

```sh
if [[ "$HOMEBREW_COMMAND" != "vendor-install" ]]
```

`git diff` when whitespaces are ignored:

$ git diff -w
diff --git a/Library/Homebrew/utils/ruby.sh b/Library/Homebrew/utils/ruby.sh
index 7974e909c..4be204309 100644
--- a/Library/Homebrew/utils/ruby.sh
+++ b/Library/Homebrew/utils/ruby.sh
@@ -27,8 +27,11 @@ If there's no Homebrew Portable Ruby available for your processor:

   unset HOMEBREW_RUBY_PATH

-  if [[ "$HOMEBREW_COMMAND" != "vendor-install" ]]
+  if [[ "$HOMEBREW_COMMAND" == "vendor-install" ]]
   then
+    return 0
+  fi
+
   if [[ -x "$vendor_ruby_path" ]]
   then
     HOMEBREW_RUBY_PATH="$vendor_ruby_path"
@@ -85,7 +88,6 @@ If there's no Homebrew Portable Ruby available for your processor:
       HOMEBREW_RUBY_PATH="$vendor_ruby_path"
     fi
   fi
-  fi

   export HOMEBREW_RUBY_PATH
 }
2020-05-21 15:06:21 -05:00
Maxim Belkin
8dcb1636ce
utils/ruby.sh: add explanatory comments 2020-05-20 12:29:45 -05:00
Mike McQuaid
1ebb1c2885
Merge pull request #7580 from tharun208/brew-cask-analytics
Added analytics for cask info
2020-05-20 08:06:46 +01:00
Maxim Belkin
dcc486fa9e
utils/ruby.sh: find usable Ruby from PATH only 2020-05-19 12:24:00 -05:00
Tharun
7186600a5c renamed get_formulae_api 2020-05-19 14:59:43 +05:30
Mike McQuaid
4f75a77b08
Update deprecations
Add more deprecations, disable deprecations and remove disabled code.
2020-05-18 13:50:46 +01:00
Mike McQuaid
b9f493a7f6
Pass FormulaInstaller#display_options to BuildError.
This should improve the output in analytics.
2020-05-18 12:46:25 +01:00
Mike McQuaid
f5b6a90fd0
utils/analytics: fix options reporting.
Check we have a non-empty `options` and convert them all to human
readable strings.
2020-05-18 08:50:51 +01:00
Maxim Belkin
b4267d80e4
utils/ruby.sh: avoid nested ifs 2020-05-17 16:32:06 -05:00
Tharun
2a62be0875 Refractored analytics to support analytics for cask 2020-05-17 01:38:11 +05:30
Tharun
139ca1d374 Updated analytics method name for cask info 2020-05-17 00:31:12 +05:30
Maxim Belkin
083f56fafe
utils/ruby.sh: quote HOMEBREW_RUBY_PATH when calling test-ruby 2020-05-15 16:35:42 -05:00
Maxim Belkin
f7e0705164
utils/ruby.sh: try installing portable Ruby ...
when no usable Ruby is found.
2020-05-15 15:12:20 -05:00
Maxim Belkin
44ef1abd1f
utils/ruby.sh: suppress standard error in test-ruby 2020-05-15 15:04:06 -05:00
Maxim Belkin
ec6e449f4f
utils/ruby.sh: unset HOMEBREW_RUBY_PATH unconditionally 2020-05-15 14:21:51 -05:00
Maxim Belkin
d21ecffae6
utils/ruby.sh: break down long ruby code in test-ruby 2020-05-15 14:20:03 -05:00
Maxim Belkin
cbc266bf0e
utils/ruby.sh: split long line in test-ruby() function
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-05-15 13:49:22 -05:00
Maxim Belkin
328c75fc33
Move logic related to HOMEBREW_RUBY_PATH to utils/ruby.sh 2020-05-15 10:30:45 -05:00
Shaun Jackman
133ee7966d shell: Use .profile unless .bash_profile exists 2020-05-13 09:30:02 -07:00
Mike McQuaid
84a110744a
utils/fork: check for inner exception command.
If it's not present then `ErrorDuringExecution` and `BuildError` don't
work correctly so better to fall back to a default `RuntimeError`.
2020-05-12 10:26:09 +01:00
Mike McQuaid
6123cdb767
Improve Homebrew Portable Ruby messaging
As-of https://github.com/Homebrew/homebrew-portable-ruby/pull/100 we've
removed ARM builds for Portable Ruby due to months of breakage.
Similarly, when we last bumped Portable Ruby the ARM build was much
delayed but, despite Homebrew/brew being completely unusable to anyone
using it on ARM in that case, no-one complained or filed issues.

Instead of attempting to maintain and update a Portable Ruby on niche
(Homebrew) platforms like ARM (or, in past/future PPC) improve the
messaging to provide users with a workaround.

Now we allow only a major/minor version match it should be pretty
doable for those users to install e.g. a prebuilt Ruby binary from a PPA
or built it from source if needed using `ruby-build` and `rbenv`.

The messaging could be improved further but we're somewhat limited by
`ruby.sh` and `vendor-install.sh` being separate. I'm tempted to combine
them (or at least have `vendor-install.sh` not be so generic as to not
be able to give Ruby-specific advice).
2020-05-02 13:53:45 +01:00
Eric Knibbe
fa1ce146e4 ruby.sh: allow running on older ruby versions 2020-04-22 17:36:00 -04:00
EricFromCanada
0acfb4b819 Add line break and indent to subcommand descriptions 2020-04-19 11:50:28 -04:00
Jonathan Chang
286488f753 github: add sponsors GraphQL API 2020-04-17 17:16:54 +10:00
Jonathan Chang
951cf09d4b pr-pull: eliminate another curl call
We're setting the basename, so no need to make a curl call to figure out
what it ought to be. This should speed up bottle pulls even more.
2020-04-14 13:41:35 +10:00
Bo Anderson
a6d3e3c47c utils/github: form encode workflow branch 2020-04-13 21:22:01 +01:00
Jonathan Chang
c1ba9975b8 pr-pull: fetch artifacts with no-resume strategy 2020-04-13 19:59:22 +10:00
Mike McQuaid
73df5891ef
Merge pull request #7283 from claui/fix-make-tmpfile
Ensure TMPDIR is set for Xcode’s `make`
2020-04-11 13:11:30 +01:00
Claudia
29538c89cd
Set TMPDIR for Xcode’s make
This fixes an issue where at least in Xcode 11.0, `make` uses
`/var/tmp` as a fallback for temporary files unless `TMPDIR` is set:

```
$ strings "$(xcrun -f make)" | grep -B 3 fopen
TMPDIR
/var/tmp/
GmXXXXXX
fopen (temporary file)
```

Given that Homebrew filtered `TMPDIR`, and the `/var/tmp` directory may
not be writable for non-root users, this would cause Homebrew’s
build environment to error out:

```
$ brew ruby -e 'puts ENV["TMPDIR"]; puts `: | make -f -`'
```

```
Ignoring bigdecimal-2.0.0 because its extensions are not built. Try: gem pristine bigdecimal --version 2.0.0
[…]
Ignoring zlib-1.1.0 because its extensions are not built. Try: gem pristine zlib --version 1.1.0
make: *** fopen (temporary file): Permission denied.  Stop.
```

In practice, this would break `brew audit`, `brew style`, and other
commands, which would run `make` to build native gem extensions.

This commit sets `TMPDIR` to `${HOMEBREW_TEMP}` in the gem environment, which
mirrors the behaviour we already have in other places.
We choose `HOMEBREW_TEMP` because that’s user-controlled but also falls
back to `/tmp` in case `TMPDIR` is not set in the user’s environment.

Thanks to Bo Anderson for helping find the bug.

CC: Bo Anderson <mail@boanderson.me>
2020-04-11 08:01:05 +02:00
Mike McQuaid
3381cbf5c7
Use Homebrew::EnvConfig. 2020-04-07 09:58:26 +01:00
Bo Anderson
846166c62f utils/gems: prioritise Homebrew's chosen Ruby 2020-04-05 15:38:10 +01:00
Dawid Dziurla
e1ce5c852d
github: return output if JSON parsing is not desired 2020-04-01 13:23:54 +02:00
Jonathan Chang
39040fba8b utils/github: properly use token scopes 2020-03-31 22:11:06 +11:00
Jonathan Chang
5b1d0786a4 utils/github: add fetch_artifact API 2020-03-30 22:18:19 +11:00
Vítor Galvão
2e8aa3eb97 Use long --disable instead of short -q in curl 2020-03-29 20:04:37 +01:00