Return true if given path would present a Formula file in this Tap.
Accepts both absolute path and relative path (relative to this Tap's path)
It offer an abstraction such that caller would not need to worry about
low level file system in the tap.
It will be used in `brew pull` and `brew update`.
ClosesHomebrew/homebrew#49191.
Signed-off-by: Xu Cheng <xucheng@me.com>
Also, rename the existing updater to `update-ruby` to allow using as
a fallback. It will eventually be removed.
ClosesHomebrew/homebrew#49109.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
We execute too many `git fetch` at once for this to be useful. Just let
them fail instead and make it up to users to setup username/password
caching or SSH agents.
We allow certain special regex characters in formula names, and if
those aren't escaped when interpolating them into a regex, they'll be
interpreted as special regex characters.
This can cause regex compile errors on Ruby 1.8 (for example, with
"libxml++3", which has nested match characters), and more subtle
matching bugs in general.
Refs an issue surfaced in Homebrew/homebrew#48744.
ClosesHomebrew/homebrew#49005.
Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
`Formula[name]` gets called with an unqualified name and thus will throw
`TapFormulaAmbiguityError` exceptions (silently ignored) if both the old
and the new tap are present and changes for the new tap are pulled
before the migrated formulae are removed from the old tap.
The result is an empty or incomplete `changed_formulae`, causing issues
with pulling the corresponding bottles and possibly other problems, too.
* Use git function instead of refreshing bash cache on `git` path.
* Better `which_git`:
* Take user's setting of `HOMEBREW_GIT` and `GIT` env variable into
account.
* Always expand git path.
* Only check Xcode installation for OS X.
ClosesHomebrew/homebrew#48508.
Signed-off-by: Xu Cheng <xucheng@me.com>
* Make sure `.git` directory be deleted at any error. So we won't have a
stale setup.
* Run `git fetch` and `git reset` when initialize git in the first time.
Otherwise, we will get error and merging problem afterwards.
ClosesHomebrew/homebrew#48509.
Signed-off-by: Xu Cheng <xucheng@me.com>
Otherwise Bash can cache a relative PATH and then get upset when it
changes directory and cannot find it any more.
ClosesHomebrew/homebrew#48493.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This should help to avoid collisions with external commands and other
shell functions in the future and is closer to what we do in Ruby, where
commands are namespaced by being methods of the `Homebrew` module.
Remove the executable bit from the file to make it clear it is not
supposed to be executed directly. This should make the shebang line and
the early check also unnecessary.
Allow people to run this command (so we can ask people to test it)
without having to set `HOMEBREW_DEVELOPER`.
ClosesHomebrew/homebrew#48260.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
* only set HOMEBREW_UPDATE_BEFORE inside pull instead of fetch.
* fix HOMEBREW_UPDATE_BEFORE/AFTER variable settings. They should be set
to INITIAL_REVISION and CURRENT_REVISION correspondingly.
* avoid unnecessary duplicated shellout.
* remove unused variable.
* make sure exit after reset.
* more wide guardian range. We should trap reset_on_interrupt as soon as
we are about to change any files.
* check INITIAL_BRANCH against UPSTREAM_BRANCH
* use HOMEBREW_REPOSITORY instead of HOMEBREW_PREFIX
* better performance:
* update-bash: avoid shellout
* update-report: use strip_prefix and tr
* more robust:
* explicitly handle the case when repo is HOMEBREW_REPOSITORY to avoid
to handle the trailing backslash.
* handle both lower case and upper case when stripping non alpha and
digital characters.
Simplify running a single test (or even a single method from a single
test), which is useful when developing or debugging a test. Instead of
`brew test TEST=test_diagnostic.rb TESTOPTS=--name=test_check_DYLD_vars`
it is now possible to run `brew tests --only=diagnostic/check_DYLD_vars`
to get the same effect. Similarly, `brew tests --only=diagnostic` maps
to `brew test TEST=test_diagnostic.rb`.
ClosesHomebrew/homebrew#48279.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
This parameter is printed by every `brew tests` run and feeding it back
into the test suite allows to get an identical run. Make it easier to
do that by accepting the argument as it is printed during `brew tests`.
This requires a slight adjustment to named-argument passing as the
number that follows `--seed` is also seen as a named argument, but we
usually only want to pass `TEST=<something>` and `TESTOPTS=<something>`.