Running brew audit --strict --online on a formula with a GitHub
homepage/url would crash if HOMEBREW_NO_GITHUB_API is set because
GitHub.repository returns `nil` and the audit code assumes it always
returns a hash.
ClosesHomebrew/homebrew#50054.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
Looks like the bintray publish_wait_for_secs was being ignored because the
content type wasn't being set, so it defaulted to x-www-form-urlencoded
instead of application/json.
Changes the timeout to 0 to preserve current non-blocking behavior, which
we want in case multiple formulae are being updated.
ClosesHomebrew/homebrew#49951.
Signed-off-by: Andrew Janke <andrew@apjanke.net>
This needs to be `Homebrew $HOMEBREW_VERSION` so we can be adequately
filtered.
ClosesHomebrew/homebrew#49961.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Per document:
> -f, --force
> When git fetch is used with <rbranch>:<lbranch> refspec, it refuses
> to update the local branch <lbranch> unless the remote branch
> <rbranch> it fetches is a descendant of <lbranch>. This option
> overrides that check.
If it's not a tap, we test formula on CoreTap. This can happen
if we run test on a fork, e.g. Linuxbrew or future Homebrew/brew.
ClosesHomebrew/homebrew#49844.
Signed-off-by: Xu Cheng <xucheng@me.com>
* Better variable/class name. `update-report` isn't response to actual
update.
* Use abstraction offered by Reporter and ReproterHub class.
* Failure on one tap won't affect migration preformed by other taps.
* Simplify logic and prepare for core/formula separation.
* Better variable/class name.
* Remove obsolete update_renamed, this is now handled inside each
reporter.
* Remove obsolete formula file path to name computation, which is also
handled by reporter.
* Hide low lever implementation detail to offer better abstraction.
Use `add(reporter)` instead of `Hash#update` to add new report.
* Avoid tons of unnecessary file path manipulation. Use abstraction
offered by Tap class if possible.
* Handle formula rename/tap migration inside reporter in per tap basis.
* Avoid duplicated computation.
* Remove redundant/dead code.
When there are merge conflicts we fail pretty hard. This is still
possible after this commit but at least we've given Git enough pointers
to make it less likely.
ClosesHomebrew/homebrew#49299.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This should help to prevent situations where a user accidentally ends up
"stranded" in a branch indefinitely.
Additionally, the stash is never popped automatically at the end of a
successful update, but the stash-pop message is printed if something is
stashed.
When an interrupt occurs, the original behavior is still in place
(switch back to the old branch and revision, and pop the stash), though
this could be changed as well.
This commit modifies the behavior of both `brew update` and
"update-bash.sh" in the manner described above.
The idea for this approach is from Mike McQuaid.
Issue Homebrew/homebrew#48812ClosesHomebrew/homebrew#48993.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Check to see if `HEAD` is the same as what we have locally. If it is:
don't bother to `git fetch`.
ClosesHomebrew/homebrew#47888.
ClosesHomebrew/homebrew#49219.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
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.