182 Commits

Author SHA1 Message Date
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
Misty De Meo
2476801613 Hardware: separate out CPU values into CPU module
* CPU functions now exist in Hardware::CPU
* Added compatibility functions in compat/hardware_compat.rb
* Names are less specific to Mac hardware, e.g. CPU.family instead of
  Hardware.intel_family
* Hardware::CPU.family works for both Intel and PowerPC
* New helper methods on CPU, like .sse4? and .altivec?

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2013-03-23 13:40:18 -05:00
Misty De Meo
29af53d451 Replace remaining shelled-out whiches 2013-03-21 08:37:51 -05:00
Jack Nagel
e463016428 ENV: clear influential include path vars 2013-03-16 13:51:30 -05:00
Mike McQuaid
98352b3b41 Don't run certain functions on non-MACOS. 2013-03-11 18:26:25 +00:00
Jack Nagel
878747d458 Index pkgconfig directories by MacOS.version 2013-03-09 14:46:01 -06:00
Jack Nagel
f037be5148 Don't shadow outer local variables 2013-02-18 12:13:36 -06:00
Jack Nagel
d06824c357 ENV.with_build_environment 2013-01-21 17:24:10 -06:00
Adam Vandenberg
2a40ff08a2 Only add -F if the frameworks folder exists
Closes Homebrew/homebrew#16901.
2013-01-04 21:30:10 -08:00
Jack Nagel
9c8a73cf41 Allow requirements to specify env options 2012-12-26 14:37:03 -06:00