100 Commits
Author SHA1 Message Date
Alyssa Ross 864475e14f bump-formula-pr: use GitHub error message info
This saves an API call, and is more accurate, because the repo API
doesn't actually say whether forking is enabled, but this error message
does.

To do this, the original GitHub error message had to be accessible on
the GitHub exceptions.
2018-10-11 16:39:29 +01:00
Alyssa Ross 23984273f3 bump-formula-pr: always use base if unforkable 2018-10-11 16:34:40 +01:00
Alyssa Ross f4a82236b7 bump-formula-pr: add --no-fork
GitHub seems to be discouraging forking private repositories[0]:

> By default, new organizations are configured to disallow the forking
> of private repositories.

bump-formula-pr tries to create its pull requests from a fork, so it
can't be used for private taps set up in this way.

I've added a --no-fork option that will create PRs in the tap repo
itself, rather than in a fork, to accommodate this use case.

[0]: https://help.github.com/articles/allowing-people-to-fork-private-repositories-in-your-organization/
2018-10-11 13:23:56 +01:00
Alyssa Ross 472d1a22c5 Fix comparison with Version::NULL on RHS
This was accounted for in Version::NULL.<=>, but not in Version#<=>,
so these could only be compared if Version::NULL was the left hand
side.

The check had to go above the check that `other` is a version because
`Version::NULL`'s anonymous class does not inherit from `Version`.
(The type check feels like it's probably a smell, but out of scope).
2018-05-26 14:45:53 +02:00
Alyssa Ross bdfbc70c87 pull: only add gpg to path if enabled in git 2018-05-22 23:35:50 +02:00
Alyssa Ross 96b95a838a Fix brew pull with git commit.gpgsign enabled
Because of environment filtering, git tries to sign the commit but
can't find gpg, which means that the patch won't be applied.
2018-05-12 21:25:55 +01:00
Alyssa Ross 38ae15fe7d Remove completions for (un)linkapps commands
These were deleted in cffa5a9864.
2018-05-01 10:49:44 +01:00
Alyssa Ross 3c0443123f Test Formula with undeclared_deps
Changed in 10ec789660.
2018-04-07 12:17:12 +01:00
Alyssa Ross 264acb22f4 Restore Formula#declared_runtime_dependencies
This got lost in a merge.
2018-04-07 12:16:10 +01:00
Alyssa Ross 6bbc56c3a9 Merge branch 'master' into undeclared_runtime_dependencies 2018-03-30 12:39:13 +01:00
Alyssa Ross 6cd195723f Merge branch 'master' into undeclared_runtime_dependencies 2018-03-12 09:22:39 +00:00
Alyssa Ross 0a2f0ab456 Fix formula/linkage_checker infinite recursion 2018-03-12 09:20:24 +00:00
Alyssa Ross 69b9c11ae8 Fix style in brew create-generated formulae
- Fix indentation oddities
- Add empty lines where we expect them in submitted formulae
2018-03-12 09:04:07 +00:00
Alyssa RossandGitHub db7f0734c9 Merge pull request #3854 from alyssais/test_clear_sensitive_environment
Add tests for ENV#clear_sensitive_environment!
2018-03-02 08:31:19 +00:00
Alyssa Ross 84dda31e82 Add tests for ENV#clear_sensitive_environment! 2018-03-01 17:48:08 +00:00
Alyssa Ross af682d2d63 Merge branch 'master' into undeclared_runtime_dependencies 2018-03-01 17:39:49 +00:00
Alyssa Ross 51b27039be Revert "Only check undeclared dependencies on macOS"
This reverts commit fa5245f7ad.
2018-03-01 17:30:42 +00:00
Alyssa Ross fa5245f7ad Only check undeclared dependencies on macOS
We don't currently have a LinkageChecker on Linux, so can't do this.
2018-03-01 17:30:37 +00:00
Alyssa RossandGitHub 43c658a8fa Merge pull request #3852 from sjackman/linkage_checker
Move linkage_checker from os/mac to generic
2018-03-01 17:24:34 +00:00
Alyssa Ross adb8c252b0 info: sort HEAD keys by install date
This makes a lot more sense than sorting alphabetically by commit hash,
the previous behaviour.
2018-02-26 09:21:38 +00:00
Alyssa Ross 10ec789660 Don't include declared dependencies in undeclared
oops
2018-02-11 16:30:58 +00:00
Alyssa Ross 40ca03e975 Add undeclared dependencies to Tab when installing
An installed formula doesn't get optlinked until _after_ it's installed,
meaning that we can't rely on `opt_prefix` to get the right keg.

So, if not optlinked, fall back to the formula's prefix, which will be
that of the current installation.
2018-02-11 16:23:22 +00:00
Alyssa Ross 8386e6a8c1 Undeclared dependencies in runtime_dependencies
Fixes https://github.com/Homebrew/brew/issues/2173.
2018-02-11 13:44:20 +00:00
Alyssa Ross a9dc02a586 Don't suggest install from bottle if not available
It only makes sense to tell a user to try installing from a bottle if
there are bottles available for them to install for all the formulae
they specified.
2018-01-28 22:47:39 +00:00
Alyssa Ross 78c829790d Improve deprecation message for dependency tags
It took me a while to figure out what this deprecation actually did,
because the message wasn't accurate.
2018-01-18 21:16:19 +00:00
Alyssa Ross d88b50968c Load formula_support deprecations
We should probably write tests for these going forward. ;)
2018-01-18 21:09:21 +00:00
Alyssa Ross 8874d1fb13 prepend instead of alias hacks for deprecations 2018-01-18 21:08:41 +00:00
Alyssa RossandGitHub 9a82eb6212 Merge pull request #3679 from alyssais/zsh_cask_completion
Don't auto-tap caskroom/cask in ZSH completion
2018-01-13 13:53:43 +00:00
Alyssa RossandGitHub b9815797a1 Merge pull request #3675 from apjanke/update-bash-cask-completions
update brew cask bash completions
2018-01-13 11:12:11 +00:00
Alyssa Ross 2694fbd6a0 Don't auto-tap caskroom/cask in ZSH completion
The Bash completion just uses the directory tree rather than invoking
`brew cask`, so doesn't exhibit the same behaviour.
2018-01-13 11:03:34 +00:00
Alyssa RossandGitHub f06b54f1bb Merge pull request #3653 from alyssais/installed_on_request
Preserve installed_on_request for dependencies
2018-01-09 20:02:45 +00:00
Alyssa Ross ef82b188f2 Preserve installed_on_request for dependencies
Fixes https://github.com/Homebrew/brew/issues/3642.
2018-01-09 16:37:59 +00:00
Alyssa RossandGitHub 5dfc1ab5ac Merge pull request #3645 from mchao409/master
add a few missing periods
2018-01-09 14:54:46 +00:00
Alyssa Ross 144ae56c02 Update formulae.brew.sh URL
The Homebrew/formulae.brew.sh repo implies that this is now the
preferred URL.
2018-01-07 17:28:27 +00:00
Alyssa Ross 22a74b69c6 docs: fix audit warning in Python formula example
Auditing a formula with this structure (plus a `desc` statement)
results in an audit warning:

>   * C: 12: col 3: `include` (line 12) should be put before `desc` (line 2)
2018-01-07 17:09:09 +00:00
Alyssa Ross 78fe082a2b cask: exit successfully when given no arguments
Fixes https://github.com/Homebrew/brew/issues/3601.
2017-12-24 15:06:49 +00:00
Alyssa Ross b6d36003b3 Always output when tapping core
Hiding all output makes it look like Homebrew is hanging while the tap
operation (which can take a long time!) is running.

Closes #3053.
2017-09-07 12:12:22 +01:00
Alyssa Ross a6fa2f367b Don't fail to migrate repo because of empty dir
I just ran into an issue where a colleague's Homebrew couldn't update.
It seems to have been because it failed once just after the new repo
directory was created. Since there was nothing in this directory, there
really isn't any reason for us to fail here, so to avoid this problem in
the future, try to `rmdir` the directory before failing because it already
exists.
2017-08-31 12:17:01 +01:00
Alyssa Ross 4760f4e803 Raise an exception when double loading a formula
(As proposed in #2673)
2017-08-11 22:40:08 +01:00
Alyssa RossandGitHub 04420d07a4 Merge pull request #2666 from alyssais/patch_forwardable
patch: clean up with Forwardable
2017-05-23 10:18:56 +01:00
Alyssa Ross b01a9b0695 patch: clean up with Forwardable 2017-05-22 20:39:17 +01:00
Alyssa Ross 9e97eadccb rubocop: trailing comma in multiline method calls
Discussed in
https://github.com/Homebrew/brew/pull/1987/files#r100693581.

This was originally ommitted because it wasn't compatible with Ruby 1.8.
(See https://github.com/Homebrew/legacy-homebrew/pull/48144#r49928971).
2017-02-12 15:11:38 +00:00
Alyssa RossandGitHub c627939d5b Merge pull request #1983 from DanToml/dani_ci_diagnostic
Skip Xcode outdated check on CircleCI
2017-02-11 00:45:19 +00:00
Alyssa RossandGitHub 70b1c6de0b Merge pull request #1943 from alyssais/missing_requires
formulary: handle ScriptError in formula
2017-02-03 19:13:05 +00:00
Alyssa Ross ade8128a18 formulary: handle ScriptError in formula
I added a new `FormulaUnreadableError` subclass of
`FormulaUnavailableError` so existing `rescue`s of
`FormulaUnavailableError` handle this as well.

The new subclass will output the name of the formula with the error
(because this isn't always obvious from the original exception message)
followed by the original error message.

Fixes #1927.
2017-02-01 18:34:20 +00:00
Alyssa RossandGitHub 35045b2934 Merge pull request #1885 from alyssais/remove_1.8.7
Remove some remnants of Ruby 1.8.7 support
2017-01-24 11:54:44 +00:00
Alyssa Ross 5480a84114 tests: give e helper in UtilTests a better name 2017-01-24 11:25:26 +00:00
Alyssa Ross 65dde58057 tests: add some emoji tests 💯 2017-01-24 11:25:24 +00:00
Alyssa Ross 4291476fa3 man: remove an unnecessary else
`odie` causes the process to exit immediately, so there's no need for the
`regenerate_man_pages` call to be conditional.
2017-01-23 21:16:49 +00:00
Alyssa Ross b0fea9eb6c fileutils: update Ruby documentation URL 2017-01-23 17:56:33 +00:00
Alyssa Ross 13488183bd emoji: remove hack required for Ruby 1.8.7
Since this hack is no longer required, and `Emoji.tick` and `.cross` are
only called in one place, I think it's better to just inline them there
rather than having methods on `Emoji` that just return a one-character
String.
2017-01-23 17:56:33 +00:00
Alyssa RossandGitHub 2c1fbe1693 Merge pull request #1890 from alyssais/global_teardown_env
tests: automatically restore ENV in teardown
2017-01-23 17:54:31 +00:00
Alyssa Ross 62a0c3a6f5 tests: remove env helper 2017-01-23 13:39:33 +00:00
Alyssa Ross 19e61355b3 tests: remove with_git_env method
A common git environment is now used in all tests, so this is no longer
required.
2017-01-22 20:54:37 +00:00
Alyssa Ross b53ce62ffb tests: use more recent git committer date
This will allow the `brew bundle` test to use the default git
environment.
2017-01-22 20:45:15 +00:00
Alyssa Ross 9c3d01c682 tests: remove unnecessary comment
See https://github.com/Homebrew/brew/pull/1890#discussion_r97229473.
2017-01-22 19:59:13 +00:00
Alyssa Ross 1e1de8c111 tests: remove remainder of ARGV stubs
I was waiting for confirmation that there wasn't a good reason for these
to be stubbed before I removed them.
2017-01-22 19:53:58 +00:00
Alyssa Ross a736c7e317 tests: set verbose in ENV instead of stubbing ARGV 2017-01-22 19:53:58 +00:00
Alyssa Ross 0c1d665568 tests: set developer in ENV rather than stubbing 2017-01-22 19:53:58 +00:00
Alyssa Ross 116ed3ec80 tests: automatically restore ENV in teardown 2017-01-22 19:53:58 +00:00
Alyssa Ross 6e0f1366b0 tests: extract a common using_git_env method 2017-01-22 19:52:34 +00:00
Alyssa RossandGitHub 6f305ad3dc Merge pull request #1892 from alyssais/global_teardown_fs
tests: clean up file system for all tests
2017-01-22 19:47:38 +00:00
Alyssa Ross 6861451f87 tests: remove more per-test file system cleanup
These locations are now all automatically cleaned up after every test.
2017-01-22 11:15:18 +00:00
Alyssa Ross 1aee7c6945 tests: remove explicit tmpdir deletions
These are no longer necessary.
2017-01-22 11:15:18 +00:00
Alyssa Ross d7b8420aaa tests: clean up file system for all tests
(No longer just integration tests.)
2017-01-22 11:15:18 +00:00
Alyssa RossandGitHub 7c27bfd37a Merge pull request #1891 from alyssais/global_teardown_argv
tests: reset ARGV in teardown
2017-01-22 11:06:07 +00:00
Alyssa Ross d86342a251 tests: reset ARGV in teardown 2017-01-21 15:08:20 +00:00
Alyssa Ross 2d550b5008 tests: clear tab cache in global teardown 2017-01-21 14:24:19 +00:00
Alyssa Ross 70a381a00f tests: enforce super in lifecycle hooks
This will allow us to have global setup and teardown for tests.

For example, we can automatically clear caches after each test, to avoid
annoying intermittent failures like #1879 and #1886.
2017-01-21 11:34:52 +00:00
Alyssa Ross 245944d359 keg: use Forwardable to methods delegated to #path 2017-01-19 17:06:38 +00:00
Alyssa Ross 34e13fc527 keg: don't conditionally switch alias target
This seems to be a remnant of Ruby 1.8.
2017-01-19 17:06:38 +00:00
Alyssa Ross 366ee0b267 tests: revert modification to ARGV at end of test
Similar to 6fc1747e05. I hadn't seen any
test failures caused by this, but I noticed it in the process of
trackign that down and it's an accident waiting to happen.
2017-01-19 13:21:39 +00:00
Alyssa Ross 6fc1747e05 tests: add a missing Tab cache clear
This was responsible for the sporadic failures I encountered in #1878.
2017-01-19 13:16:08 +00:00
Alyssa Ross 9475622c07 uses: restore formula-level exception handler
This is a temporary measure until:

- #1862 is merged
- I can a test on `brew uses` against every formula in the official
  taps to verify that exceptions are no longer raised.
2017-01-16 23:28:26 +00:00
Alyssa Ross 0b216798bb Revert "Revert "uses: properly handle untapped fo…
…rmulae in recursive dependency expansion""

This reverts commit dc9819b86c.
2017-01-16 23:28:26 +00:00
Alyssa Ross 36c1c8e9b0 uses: fix recursive requirement resolution
Fixes #1848 by sharing recursive dependency resolution between
dependencies and requirements.

Coincidentally, this also fixes the errors introduced by #1784 that
necessitated it being reverted in #1797.
2017-01-16 23:04:26 +00:00
Alyssa Ross 33b955a3f2 tests: fix style of recursive_requirements tests 2017-01-16 21:58:59 +00:00
Alyssa Ross 0d9020838f tests: test Formula#recursive_requirements 2017-01-15 19:50:07 +00:00
Alyssa Ross e466a65b8d formula: correct grammar in comments 2017-01-05 12:21:50 +00:00
Alyssa Ross 536b6e2396 uses: properly handle recursive deps exceptions
Fixes #1776.

If any known formula had a dependency on an untapped tap,
Formula#recursive_dependencies would throw an exception, which would be
caught by the outer exception handler, causing the rest of the
dependencies for that formula to be skipped and incomplete output to be
generated.

To fix this, I added a check to avoid analysing the dependencies of
formulae from uninstalled taps.

Additionally, I removed the aforementioned outer exception handler added
in 5fdb89aed9, because the only other
place that should be capable of throwing such an exception is the
statement that was surrounded by another wider exception handler in
Homebrew/legacy-homebrew#40682.
2017-01-05 00:33:44 +00:00
Alyssa Ross 4c061fc183 dependency: TapDependency#tap returns a Tap
Previously, this returned a String, but a Tap instance seems much more
sensible.

I couldn't find anywhere this method was actually used, so the change
shouldn't break anything.
2017-01-05 00:22:56 +00:00
Alyssa Ross 56d6695bf3 tab: set homebrew_version in Tab.empty 2017-01-04 00:56:06 +00:00
Alyssa Ross b7e10ba239 tests: remove temp tab homebrew_version override
This had to be added in #1750 to work around special-casing for tabs
generated with Homebrew versions < 1.1.6. Now that 1.1.6 is the current
version, we can remove this hack.
2017-01-04 00:46:44 +00:00
Alyssa Ross a175a1241e license: remove copyright ending year
See https://github.com/Homebrew/brew/pull/1771#issuecomment-270143292.
2017-01-03 18:13:36 +00:00
Alyssa Ross 6ecf2ca013 cask: remove license
See https://github.com/Homebrew/brew/pull/1771#issuecomment-270179479.
2017-01-03 18:08:02 +00:00
Alyssa Ross e1d7d44e5a tests: optlink fake kegs in uninstall test 2017-01-01 14:27:24 +00:00
Alyssa Ross e4856143a6 keg: check installed dependencies iff optlinked 2017-01-01 14:27:24 +00:00
Alyssa Ross 94ead55772 keg: keg_only kegs can have installed dependents 2017-01-01 14:26:28 +00:00
Alyssa Ross 05b85a7bef keg: update installed dependency resolution
Closes #1525. (See there for a motivation for this change.)
2017-01-01 14:26:28 +00:00
Alyssa Ross 524d9ce8f3 keg: test dep fallback with unknown formulae 2016-12-31 17:53:06 +00:00
Alyssa Ross 8b30abe060 keg: handle dependencies of moved/renamed formulae
In #1497 I switched from Keg#to_formula for comparing kegs to formulae
to comparing the name and tap in the keg's tab to the name and tap of
the formula.

However, this fails to match if the name and tap of the formula have
changed since the keg was installed, so it's clearly better to use
Keg#to_formula where possible, and fall back to the information in the
tab when #to_formula can't be used.
2016-12-31 17:53:06 +00:00
Alyssa Ross fb920668c8 keg: don't return nil dependencies
This is a proper fix to the problem addressed by #1510.

The problem arises when f_kegs is nil, which can happen if the name and
tap used to install a keg don't match the name and tap currently
associated with its formula (i.e. if it's been renamed or moved).
2016-12-31 14:16:38 +00:00
Alyssa Ross 49310667b4 Revert "uninstall: remove nil requireds/dependents"
This reverts commit d7e72899e6.
2016-12-31 12:23:53 +00:00
Alyssa Ross b0a38c06bf docs: improve Keg.find_some_installed_dependencies
See https://github.com/Homebrew/brew/pull/1752#discussion_r94257147
2016-12-30 22:22:13 +00:00
Alyssa Ross d998a3fcce tab: remove #reliable_runtime_dependencies?
See https://github.com/Homebrew/brew/pull/1750#discussion_r94243825 for
discussion.

Removes Tab#reliable_runtime_dependencies? in favour of returning nil
from Tab#runtime_dependencies if the list is unreliable.

Because Homebrew 1.1.6 hasn't been tagged yet, tabs created in tests
aren't created with a homebrew_version that marks the
runtime_dependencies in the Tab as reliable, so there are some tests
that fail. To work around this, I've had to add a line to some tests
that explicitly overrides the homebrew_version in the Tab. This is
really ugly though, so they should be removed as soon as possible after
1.1.6 is released.
2016-12-30 20:34:14 +00:00
Alyssa Ross 01e1f7d49e keg: fix fallback dependencies with multiple kegs
Fixes #1524.
2016-12-30 18:41:14 +00:00
Alyssa Ross 4322c1c562 tests: explain Homebrew version checking in tabs 2016-12-30 18:19:26 +00:00
Alyssa Ross c41d1d8148 tab: remove #homebrew_tag
This method isn't used any more
2016-12-30 18:16:49 +00:00
Alyssa Ross ce454bd141 tab: parse full Homebrew version string
It didn't occur to me that this would work, but it does! Magic.
2016-12-30 18:15:35 +00:00
Alyssa Ross bbf53ad4ab uninstall: don't comma-seperate kegs in example
The example command given in the dependency errors/warnings previously
comma-seperated the kegs, which was incorrect syntax. This fixes that.
2016-12-30 17:45:37 +00:00