191 Commits

Author SHA1 Message Date
Markus Reiter
0424940496 Add types for ENV extensions. 2020-11-23 02:06:37 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Mike McQuaid
f161e56ce0 ENV: check SDK exists when setting up.
Reuse code from `brew doctor` that checks and produces a fatal error
and from `install.rb` that runs it.

Closes #8646
2020-09-11 12:05:22 +01:00
Markus Reiter
276c570c16 Pass individual args explicitly to ENV extensions. 2020-07-28 02:52:45 +02:00
Markus Reiter
25b3632c4c Pass args to ENV instead of using global args. 2020-07-25 03:57:43 +02:00
Mike McQuaid
d5ff4f5327
Remove ARGV.env
Replace with `Homebrew.args.env`.

Part of #5730.
2020-05-23 13:49:38 +01:00
Cheng XU
66697d4290
ENV: add sensitive_environment function
ENV#sensitive_environment is used to list all sensitive environments.

Also refactor the code on determining whether an environment is sensitive.
2019-07-18 15:06:33 +08:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Alyssa Ross
84dda31e82
Add tests for ENV#clear_sensitive_environment! 2018-03-01 17:48:08 +00:00
Mike McQuaid
9358f678a3 Clear/mask passwords as well as tokens. 2017-11-07 07:54:34 +00:00
Mike McQuaid
cf5fdeef1d Rubocop: manual rule fixes. 2017-09-24 21:23:59 +01:00
Mike McQuaid
d02b4f321d Hide sensitive tokens from install/test/post.
Hide these tokens to avoid malicious subprocesses e.g. sending them
over the network. Also, support using these tokens with environment
filtering and clear `HOMEBREW_PATH` from subprocesses to stop them
sniffing it. Finally, use `HOMEBREW_PATH` to detect Homebrew’s user’s
PATH for e.g. `brew doctor` etc.
2017-04-22 16:31:19 +01:00
Mike McQuaid
416e51bca9 ENV: only check Superenv if necessary. (#451) 2016-07-06 10:43:42 +01: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
Jack Nagel
6cdc76452b Only directories are candidates for superenv bin 2014-04-22 15:39:59 -05:00
Jack Nagel
722a5af4eb Simplify conditions for superenv activation
`MacOS::Xcode.without_clt? && MacOS.sdk_path.nil?` should never be true.

In its earliest form, this would raise a bare RuntimeError in an effort
to have the bug reported. Later, it was changed to silently disable
superenv. But we don't want to do that. If there's a bug, or the user's
system is misconfigured, we want to know, so that we can fix the bug, or
the user can fix their system. So let's remove the condition.
2014-04-22 15:37:34 -05:00
Jack Nagel
c7a54f8da1 Use ARGV.env 2014-03-13 16:37:11 -05:00
Jack Nagel
e0574b854e More robust implementation of ENV.with_build_environment 2013-08-19 12:32:59 -05:00
Jack Nagel
dd9c269c69 Rename HomebrewEnvExtension to Stdenv 2013-08-19 12:32:59 -05:00
Jack Nagel
9a5b15bb61 Move common ENV methods to a shared module 2013-08-19 12:32:59 -05:00
Jack Nagel
cc18f5e0c4 Move superenv.rb to extend/ENV/super.rb 2013-08-19 12:32:59 -05:00
Jack Nagel
ce31c16a14 Reference self, not ENV, in ENV.fortran 2013-08-19 12:32:58 -05:00
Jack Nagel
d09e23c8b1 Move extra stdenv setup to extended callback 2013-08-19 12:32:57 -05:00
Jack Nagel
eebc04ec9b Move common stuff to extend/ENV.rb 2013-08-19 12:32:57 -05:00
Jack Nagel
e998132406 This is a backreference, not an embedded NUL 2013-08-16 20:50:20 -05:00
Misty De Meo
1333b8d666 ENV.universal_binary: use as_arch_flags 2013-08-15 23:04:26 -07:00
Misty De Meo
ef1f2b4a79 Add Hardware::CPU.arch_(32|64)_bit
This replaces hardcoding of i386/x86_64 all over the code.
2013-08-15 22:46:55 -07:00
Adam Vandenberg
20986e3ff5 ENV: add usage note to ncurses_define 2013-08-05 14:47:02 -07:00
Jack Nagel
38c1d25036 Remove unreachable branch in ENV.fortran
Now that this is handled by a Requirement with a default formula, this
code cannot be triggered under normal circumstances.

The advice given has now been moved to the Formula Cookbook on the wiki.
2013-07-11 13:03:25 -05:00
Adam Vandenberg
aafe2f20d0 Add Fortran ENV helpers 2013-06-24 07:38:25 -07:00
Jack Nagel
5539c97191 Fix another constant reference 2013-06-14 11:49:00 -05:00
Jack Nagel
a463398a8b Fix constant reference 2013-06-14 11:09:53 -05:00
Jack Nagel
eee5a09202 Favor compound if over compound unless 2013-06-14 10:34:20 -05:00
Jack Nagel
9427704176 Use ||= instead of unless 2013-06-14 10:34:20 -05:00
Jack Nagel
e73f869d84 Remove outdated comment 2013-06-14 10:34:20 -05:00
Jack Nagel
381255adec Assign this inline 2013-06-14 10:34:19 -05:00
Jack Nagel
3252f9a2c9 Delete rather than assign nil 2013-06-14 10:34:19 -05:00
Jack Nagel
723f7ed111 Simplify nested conditional 2013-06-14 10:34:19 -05:00
Jack Nagel
4e4a5af731 Use has_key? rather than accessing the value 2013-06-14 10:34:18 -05:00
Jack Nagel
020a505970 Rename single-letter variable 2013-06-14 10:34:18 -05:00
Jack Nagel
a458555ccb Make flag lists into constants 2013-06-14 10:34:18 -05:00
Jack Nagel
7d6371cd19 ENV: clean up set_cpu_flags and set_cpu_cflags usage 2013-06-14 10:34:18 -05:00
Jack Nagel
50db35e5d3 Use Hardware::CPU module 2013-06-14 10:34:17 -05:00
Misty De Meo
c9c5e56363 Add :ld64 dependency
This allows formulae which won't build with Tiger's ld to conditionally
request a dependency on the ld64 formula. This modifies the build
environment appropriately, and will only be active on Tiger.
2013-06-08 19:10:38 -05:00
Jack Nagel
159b9d8e2d Move oldest_cpu to Hardware 2013-06-06 16:02:27 -05:00
Samuel John
4dac954cdb ENV.userpaths! Hotfix to prefer brewed stuff
The depends_on 'nose' => :python

tests fails even if people did `pip install nose`
with their brewed pythons because during
the tests the PATH is set up such that
/usr/bin comes before HOMEBRE_PREFIX/bin.

This is a hot fix. Proper fix need resorting
the PATH.
2013-06-04 22:33:24 +02:00
Jack Nagel
41af459205 Require hardware where it is needed 2013-06-01 19:38:48 -05:00
Jack Nagel
4276d03fe4 Fix set_cpu_flags invocations in ENV.fortran
Fixes Homebrew/homebrew#19013.
Fixes Homebrew/homebrew#19862.
Fixes Homebrew/homebrew#19921.
2013-05-19 11:18:53 -05:00
Mike McQuaid
ad5c1b81cd Fix --build-bottle CFLAGS.
The CFLAGS were previously not generic enough.

References Homebrew/homebrew#18944.
References Homebrew/homebrew#19179.
2013-05-11 12:18:25 +01:00