13 Commits

Author SHA1 Message Date
Xu Cheng
c598e1afd5 ENV/scm/git: rewrite in Bash (#496) 2016-07-12 15:20:37 +08:00
Xu Cheng
842862c653 ENV/scm/git: only execute file (#493)
Fixes #491.
2016-07-11 22:33:48 +08:00
Martin Afanasjew
a8165b6dbd scm/git: allow introspecting path lookup
Print path of first detected Git instead of executing it. This is hidden
behind a `--homebrew=print-path` argument that is unlikely to conflict
with any existing or future Git flags.
2016-06-19 22:12:34 +02:00
Martin Afanasjew
d7aa0c0335 scm/git: prevent exec bomb with 'env :userpaths'
Using `git` from `Formula#install` can cause an exec bomb if used in a
formula with `env :userpaths` because that causes both `Library/ENV/4.3`
and `Library/ENV/scm` to be in PATH, both of which contain a `git`
binary that is the same SCM wrapper. Those will mutually exec each other
indefinitely as they fail to detect that they are the same wrapper.

Extend the exec-bomb protection to check the paths after all symbolic
links have been expanded to prevent this situation.

Fixes #43.
Fixes Homebrew/homebrew-core#133.
Fixed Homebrew/homebrew-core#143.

Closes #46.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-08 00:04:15 +02:00
Xu Cheng
8ca79a6df5 scm/git: handle no Xcode/CLT configuration
`/usr/bin/<tool>` will be a popup stub under such configuration.

The idea is to let `scm/git` to handle all of git location resolution
throughout Homebrew codebase.
2016-03-21 19:07:38 +08:00
Martin Afanasjew
5f049637d9 ENV: protect against environment being reset
We cannot really recover from this, but at least we'll provide a clearer
error message than trying to call `exec` with an empty string.
2016-02-05 22:07:07 +01:00
Martin Afanasjew
f9efa18be1 ENV: protect against RUBYLIB/RUBYOPT
Some things can break in hard to debug ways if users or build scripts
set these variables, causing our otherwise quite robust Ruby wrappers
to fail. In theory, we could also use `--disable-rubyopt`, but this is
not supported in Ruby 1.8 (and we still care about it).
2016-02-05 22:07:07 +01:00
Martin Afanasjew
49990ee93f ENV: use HOMEBREW_RUBY_PATH in compiler/SCM shims
Use the same interpreter for the shims that is also used to run the main
Homebrew process (the one invoked via `brew`). The magic basically lies
in executing `ruby` with the `-x` option (supported since at least 1.8)
and in the following shebang line.
2016-02-05 22:07:07 +01:00
Xu Cheng
b121e5fd7b more core file style updated by rubocop 2015-08-06 17:23:56 +08: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
21c329e0eb Simplify dispatch in git wrapper 2014-10-05 20:33:33 -05:00
Jack Nagel
5dd1092f5f Remove last usage of StrictSubversionDownloadStrategy
This strategy is only used in one formula, so we can just replace it
with a dependency. It could be done with a requirement, but since this
is a low-impact change (it only matters for head builds on Leopard), I'm
not sure it's worth the effort.

The constant is retained for compatibility, though I could find only one
other reference to it on GitHub, in a formula that was removed from core
almost two years ago.
2014-10-05 20:15:18 -05:00
Mike McQuaid
26c76381c8 Move SCM wrappers from Contributions to ENV/scm.
Closes Homebrew/homebrew#32615.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-10-02 16:03:23 -07:00