75 Commits

Author SHA1 Message Date
ilovezfs
6563043c75 bump-formula-pr: don't unset --mirror= value 2018-06-12 18:09:10 -07:00
Gautham Goli
e21b7618a9 cli_parser: Rename @bump_args to args 2018-06-01 21:13:36 +05:30
Gautham Goli
f5e5a81a7f
Merge pull request #4146 from GauthamGoli/global-args
cli: Store parsed args in Homebrew.args and access @args everywhere else
2018-06-01 20:01:26 +05:30
Mike McQuaid
33cf882e34 bump-formula-pr: improve bad argument handling. 2018-05-31 19:53:12 +01:00
Gautham Goli
fba52e2f74 cli_parser: Store parsed args in Homebrew.args and access args everywhere else 2018-05-30 00:05:39 +05:30
Mike McQuaid
1c91c83eac Merge branch 'master' into bot-comment 2018-05-21 17:16:19 +01:00
Mike McQuaid
c6f21f1dc1 bump-formula-pr: rename @args.
This shadows the Homebrew variable so let's rename it for now so that
`--force` works again.
2018-05-03 14:24:37 +01:00
Mike McQuaid
ea9c9494a6 bump-formula-pr: fix tag/revision argument.
Can't do `@args[hash_type]` if `hash_type` is `nil`.
2018-05-02 09:42:55 +01:00
Gautham Goli
07ee23d711 cli_parser: Refactor interface for depends, conflicts and add tests 2018-04-30 15:47:13 +05:30
Gautham Goli
26e77dd75c new-formula: Don't fail CI instead comment on PR about audit violations 2018-04-30 10:59:20 +05:30
Gautham Goli
36c1ad9f64 cli_parser: Add depends, conflicts option constraints 2018-04-14 21:44:47 +05:30
Gautham Goli
20155c8df9 bump-formula-pr: Use Parser to parse args 2018-04-14 21:44:47 +05:30
Mike McQuaid
010d593a8d
bump-formula-pr: sleep for fork creation. 2018-04-08 15:37:16 -07:00
Gautham Goli
1e0f9fb835 bump-formula-pr: Replace hub with GH API calls to fork and open Pull request 2018-03-31 19:44:55 +05:30
EricFromCanada
1d2b4ed321 docs: add more missing option descriptions
and improve wording or formatting where necessary.
2018-02-01 16:06:17 -05:00
ilovezfs
ccbe4945ad bump-formula-pr: improve version formula component regex. 2018-01-28 08:12:12 -08:00
ilovezfs
98e48a9da7 bump-formula-pr: regex escape urls in replacements. 2018-01-28 08:12:12 -08:00
ilovezfs
edd1c76d40 bump-formula-pr: detect download strategy from url.
Previously, CurlDownloadStrategy was hard coded.
2018-01-28 08:12:12 -08:00
ilovezfs
6460a34e65 bump-formula-pr: add Debian mirror handling. 2018-01-28 08:12:12 -08:00
ilovezfs
e46fbdd18d bump-formula-pr: update GNU mirror handling.
homebrew/core now uses ftp.gnu.org/gnu for the primary url and
ftpmirror.gnu.org for the mirror.
2018-01-28 08:10:53 -08:00
ilovezfs
99bb068ca7 bump-formula-pr: improve formula name guessing. 2018-01-28 08:10:53 -08:00
ilovezfs
5a3555eeee bump-formula-pr: only validate tar files. 2018-01-24 04:22:11 -08:00
ilovezfs
4a1a8b86ac bump-formula-pr: use "resource" not "rsrc" 2018-01-24 03:51:23 -08:00
Mike McQuaid
cdeb0b1f23 bump-formula-pr: use popen_read :err option. 2017-12-14 16:44:25 +00:00
Mike McQuaid
1babfb679d bump-formula-pr: improve error messages.
- Be clearer about how URLs/tags/revisions/versions are specified in
  error messages.
- Give a better error message if `hub` isn't configured.
2017-12-11 09:02:41 +00:00
Laurent Cozic
fd8262ef7d
Mentions how hub needs to be configured
This is to address issue #3531
2017-12-10 11:08:15 +00:00
ilovezfs
590ba4cbf6 bump-formula-pr: fix for when hub isn't configured 2017-11-21 08:16:12 -08:00
Mike McQuaid
441c212f2d
Merge pull request #3416 from zmwangx/bump-formula-pr-fix-message
bump-formula-pr: --message: add newlines before and after hr
2017-11-10 17:53:10 +00:00
Mike McQuaid
127bdfdc71 bump-formula-pr: use HOMEBREW_BROWSER. 2017-11-07 07:54:34 +00:00
Mike McQuaid
3f8f2c6726 bump-formula-pr: use GitHub vars under env filter.
Ensure that the various variables are passed through and reset
correctly. If we end up doing this in a bunch of places we may add some
helpers to simplify this.
2017-11-07 07:54:34 +00:00
Zhiming Wang
04367c4daf
bump-formula-pr: --message: add newlines before and after hr
Without an empty line before the horizontal rule (---), "Created with `brew
bump-formula-pr`." is treated as a setext header.

The newline before the hr is not part of the heredoc because putting it in
would trip up Rubocop.
2017-11-03 10:02:26 -04:00
Mike McQuaid
6ddf3f8796 bump-formula-pr: add --no-browse option.
If `--no-browse` is passed, don't pass the `--browse` argument to `hub`
which opens the pull request URL in a browser. Instead, output it to the
command line.
2017-10-30 09:14:53 +00:00
Mike McQuaid
e88fd4a868 bump-formula-pr: always use HOMEBREW_PATH.
Fixes this when using environment filtering.
2017-10-28 21:46:30 +01:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
ilovezfs
feda0242be bump-formula-pr: fix duplicates check
`return unless pull_requests && !pull_requests.empty?` and
`return unless pull_requests&.empty?` are not equivalent.
2017-09-25 23:03:19 -07:00
Mike McQuaid
cf5fdeef1d Rubocop: manual rule fixes. 2017-09-24 21:23:59 +01:00
Mike McQuaid
01e9ec9a9f Rubocop: automatic rule fixes. 2017-09-24 21:23:59 +01:00
Mislav Marohnić
80ae5b2660 bump-formula-pr: forward compatibility with hub fork
Due to limitations of `hub fork` in hub 2.2, scripts had to repeat the
command at least two times; the 2nd time was to read the fork name from
the "fatal: remote MYNAME already exists" message output from git.

In upcoming hub 2.3, the `hub fork` command is improved to always output
the remote name, regardless of whether one already existed or not. With
this approach, only one `hub fork` call will ever be necessary when hub
is up to date.
2017-08-15 17:32:12 +02:00
Bob W. Hogg
0ae22c0e36 dev-cmd/bump-formula-pr: search for tar
We first search for gtar in PATH, then
check if Homebrew's gtar is available,
then finally search for tar in PATH.

Signed-off-by: Bob W. Hogg <rwhogg@linux.com>
2017-08-08 23:07:27 -07:00
Mislav Marohnić
f8ec2332a2 Strip trailing newline 2017-06-29 13:28:55 +02:00
Mislav Marohnić
3701b11e42 Fix unshallowing taps in bump-formula-pr
Never try to unhshallow full clones.
2017-06-27 23:45:57 +02:00
Mislav Marohnić
b3ef9ccb8a Fix bump-formula-pr when working with a shallow git clone
Creating a fork and pushing to it doesn't work when the repository in
question is a shallow clone. By default, Homebrew clones all taps in
shallow mode unless `--full` was passed or $HOMEBREW_DEVELOPER was set.
2017-06-27 14:32:09 +02:00
Mike McQuaid
021cef4b2b Autocorrect Rubocop Style/SpecialGlobalVars. 2017-06-12 09:11:42 +01:00
ilovezfs
baf7ba6316 bump-formula-pr: check for version presence.
If it's not there, error out rather than fetching to avoid creating
versionless cache files, which cause `brew cleanup` to crash.
2017-03-01 04:25:10 -08:00
EricFromCanada
afc539f86e Update brew's man page formatting and grammar
Also update command specifications to match descriptions.
2017-02-25 17:37:57 -05:00
Zhiming Wang
81a7609213
bump-formula-pr: improve duplicate detection
Reduce the chance of false flagging by making sure that the existing pr
surfaced by GitHub.issues_for_formula actually contains the exact formula name
in its title.
2017-02-20 10:36:24 -05:00
ilovezfs
539120143b bump-formula-pr: block duplicate pull-requests 2017-02-12 10:36:24 -08:00
Mike McQuaid
c276a44eba bump-formula-pr: check for URL presence.
If it's not there, produce a nicer error.

Fixes #1805.
2017-01-09 12:16:55 +00:00
Zhiming Wang
3ebd7df62d
bump-formula-pr: fix removal of old mirrors
Previously, old mirrors are only removed if the requested spec is
stable, and if the mirror lines only have two leading spaces. This leads
to stale mirror line(s) when the formula a stable block like

    stable do
      url "http://example.com/v1.0.tar.gz"
      mirror "http://example.net/v1.0.tar.gz"
    end

where the mirror line is lead by four spaces.

In this commit, we discard the /(^ mirror .*\n)?/ pattern, and instead
create a pattern with the exact url and flexible leading spaces for each
mirror of the requested spec.
2016-12-22 00:54:08 -05:00
Zhiming Wang
417f27f40f
bump-formula-pr: use correct version in download
When a --version is specified, use this specified version in the name of
the downloaded file rather than the default that is parsed from the URL.
For instance,

  brew bump-formula-pr --devel \
    --url=http://www.zsh.org/pub/development/zsh-5.2-test-2.tar.gz \
    --version=5.2-test-2 zsh

should download to $HOMEBREW_CACHE/zsh-5.2-test-2.tar.gz (correct
behavior after this commit) rather than
$HOMEBREW_CACHE/zsh-2.tar.gz (wrong behavior before this commit).
2016-12-06 17:30:10 -05:00