3228 Commits

Author SHA1 Message Date
Xu Cheng
39eb93e0f5 test-bot: simplify Test#initialize 2016-01-17 14:52:09 +08:00
Xu Cheng
4a8632e54d unpack: preserve file attributes like mtime
Closes Homebrew/homebrew#48068.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-01-15 16:26:04 +08:00
Xu Cheng
7958343f16 bottle: read source modified time from tabfile
* Avoid unnecessary stage overhead
* Support different download strategy, e.g. `git`.
2016-01-15 16:26:04 +08:00
Xu Cheng
01b92edb7b test-bot: fix missing ? 2016-01-14 19:43:33 +08:00
Xu Cheng
e6159eb579 test-bot: always return tap object
Also simplify the code and add Travis auto detect.

Closes Homebrew/homebrew#48060
2016-01-14 19:32:53 +08:00
Xu Cheng
31da9b266a audit: enforce revision check
Add two checks:
* revision should be reset to 0 for new version.
* revision should not decrease inside the same version interval.

Closes Homebrew/homebrew#48032.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-01-14 15:26:21 +08:00
Xu Cheng
5f22586389 audit: check url/checksum/mirror outside of stable block
Closes Homebrew/homebrew#48033.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-01-14 13:35:36 +08:00
bigbes
5e25b08fe4 bottle: merging problem when head conatins commas
If `head` sections contains commas (e.g. `url "https://github.com/tarantool/tarantool.git", :branch => "1.6", :shallow => false`)
then re thinks that it reached the end and inserts `bottle do <-> end`
block before it, that leads to problems in ` brew audit --devel tarantool --strict --online`:

```
==> audit problems
tarantool:
 * `head` (line 11) should be put before `bottle block` (line 7)
```

It blocks Homebrew/homebrew#47495

Closes Homebrew/homebrew#47931.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-01-14 03:48:03 +00:00
Dominyk Tiller
cbcfbacf22 test-bot: restore no-bottle support
This feature is still quite useful, particularly because of the somewhat
buggy behaviour of `default_formula` which means when attempting to build
a bottle it'll attempt to force the installation of that formula.

That is particularly problematic for taps like homebrew/homebrew-fuse because
the `default_formula` in osxfuse conflicts with the osxfuse binary we install
via the Caskroom, which is actively breaking every CI build.

Closes Homebrew/homebrew#48000.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-01-12 22:16:59 +00:00
Dominyk Tiller
f4f2266923 audit: check for more unused shorthand
Adding a strict check for usage that should be using pkgshare.

Pulled onto two unique checks to provide a better problem message, with a
clearer solution, but open to thoughts.

 * Use pkgshare instead of (share/"example")
 * Use #{pkgshare} instead of #{share}/example

Closes Homebrew/homebrew#47900.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-01-11 09:49:54 +00:00
Martin Afanasjew
bcedfe64e8 doctor: simplify handling of slow checks
Some (rather slow) checks should run after all other checks. Make that
more obvious by removing them from the sorted list of all checks and
then re-appending them to the resulting list. (Should be slightly more
efficient than the `<array>.reverse.uniq.reverse` incantation, though
that hardly matters given the cumulated run time of all the checks.)

Slightly extend the list after verifying what the slowest checks are for
various Homebrew installations (slowest check last).

Closes Homebrew/homebrew#47753.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-09 18:52:41 +01:00
Xu Cheng
885022a5e3 add Keg#empty_installation?
Avoid using `FormulaAuditor` in `FormulaInstaller`.

Closes Homebrew/homebrew#47887.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-01-09 20:28:15 +08:00
Zhiming Wang
81dc194ebf reinstall: add --interactive and --git options
Closes Homebrew/homebrew#47622.

Closes Homebrew/homebrew#47647.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-01-09 10:33:19 +00:00
Joseph Frazier
91d4ba7158 update: abbreviate hashes to at least 7 characters
Abbreviations will be longer if needed to preserve uniqueness.

This makes it more consistent with `git rev-parse --short`,
https://github.com/Homebrew/homebrew/commits, etc.

For example, instead of:

    Updated Homebrew from 40d1e9c2 to 90b9bdf4.

We see:

    Updated Homebrew from 40d1e9c to 90b9bdf.

See 0c48248b6555353c8d60b61973639c8423ce586c for the original
introduction of eight-character abbreviations.
2016-01-08 15:56:43 +01:00
Martin Afanasjew
319ea4273e list: exclude Ruby from unbrewed
Those are created by the `ruby` formula in core and various Ruby
formulae from `homebrew/versions` and contain Gems and other stuff that
is to be retained across updates. Treat it like Python in this regard.

This avoids spurious output in `brew list --unbrewed` when a brewed
`ruby` is used to, e.g., install Gems.

Closes Homebrew/homebrew#47750.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-06 21:59:33 +01:00
Martin Afanasjew
2c2f5ade6a list: exclude Homebrew logs from unbrewed
Treat it like the cache, i.e., if the logs directory is inside the
Homebrew prefix, skip it instead of listing all the logs.

This avoids spurious output in `brew list --unbrewed` when the Homebrew
logs directory is a subdirectory of the Homebrew prefix.
2016-01-06 21:59:33 +01:00
Baptiste Fontaine
f11bea0153 audit: typo 2016-01-06 17:58:16 +01:00
Baptiste Fontaine
0472b3f340 doctor: use respond_to? instead of NoMethodError
Closes Homebrew/homebrew#47715.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-05 17:51:54 +01:00
Baptiste Fontaine
9f1442db14 doctor: move code away from cmd/
Closes Homebrew/homebrew#47665.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-05 14:33:06 +01:00
Dominyk Tiller
dafa11af9a doctor: add explicit anaconda warning
Closes Homebrew/homebrew#47540.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-01-04 17:22:53 +00:00
Martin Afanasjew
bd4f633673 tests: use predefined commit author for robustness
Some tests, that construct a Git repository for testing, will silently
fail if the global Git user isn't properly set up. There are valid use
cases for this, thus use a fixed commit author/committer for all tests
instead of relying on the user's configuration.
2016-01-04 16:26:36 +01:00
Martin Afanasjew
cc632acd07 update: avoid unnecessarily recreating 'master'
This only affects the behavior of `brew update` while being on a branch
`feature` that doesn't track the upstream branch. For simplicity, the
upstream branch is assumed to be called `master` (`@upstream_branch` in
the code). Consider the following simplified commit history:

        master      origin/master (current state of remote)
        |           |
A---B---C---D---E---F
     \
      G---H---I
              |
              feature (HEAD)

If `origin/master` is equal to `master` and also points at commit `C`,
then `brew update` will update both `master` and `origin/master` to `F`
and report on the changes in the range `C..F`.

However, if `origin/master` is equal to `E` because some commits have
been already fetched with `git fetch origin`, then `brew update` will
recreate `master` from `origin/master` and then pull in the commits from
the remote to update both to `F`. Because `master` gets recreated from
a younger `origin/master`, the report will only contain changes from the
range `E..F` (thus omitting the changes from `C..E`).

This commit adjusts the logic to not recreate `master` if it can be
safely fast-forwarded to `origin/master` (the common case). This fixes
the problem from the second scenario and again reports on the desired
range `C..F`.

Closes Homebrew/homebrew#46951.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-04 16:25:32 +01:00
Baptiste Fontaine
9bdd6619e2 cleanup: move code away from cmd/
Closes Homebrew/homebrew#47484.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-04 13:17:21 +01:00
Dominyk Tiller
821dbab5f8 doctor: extend curl warning 2016-01-04 03:10:10 +00:00
Dominyk Tiller
8183f75dda config: split conditional
Stops Rubocop moaning about one line conditionals.

Closes Homebrew/homebrew#47537.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-01-03 19:08:11 +00:00
Rakesh
090b133a01 cleanup: display total disk space to be cleared
Closes Homebrew/homebrew#45642.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-30 08:12:03 +00:00
Jason Tedor
4b2eb86bbf audit: allow whitelisting of versioned Kibana.
This commit modifies the whitelisting of the Kibama formula from the
npm audit check to allow the versioned Kibana formulae to receive the
same whitelisting.

Closes Homebrew/homebrew#47500.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-29 19:17:55 +00:00
Mike McQuaid
d73a97be6b test-bot: print ARGV temporarily.
Will help debug possible Travis issues.
2015-12-29 11:55:49 +00:00
Mike McQuaid
618123e4bf test-bot: skip more building.
There should be no compilation happening with `--fast`.
2015-12-29 11:54:43 +00:00
Jason Tedor
076cbf55be kibana 4.3.0
Closes Homebrew/homebrew#46593.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-28 19:08:51 +00:00
Baptiste Fontaine
b7e98b129c cmd/options.rb: move common code in options.rb
Closes Homebrew/homebrew#47423.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-27 22:16:46 +01:00
Baptiste Fontaine
169b8fc039 Revert "minor perf improvements"
This reverts commit 16a2a8274a7808e63a6c78475e12a7c0ef5812ef.
2015-12-26 23:00:38 +01:00
Baptiste Fontaine
48681c3f3a minor perf improvements
Closes Homebrew/homebrew#47224.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-26 22:58:26 +01:00
Xu Cheng
f37f8b5c7a bottle: prevent bottling formula outside core or taps
Closes Homebrew/homebrew#47233.
2015-12-26 18:08:44 +08:00
Joao Antunes
61a47a4c0f doctor: check_access_usr_local mention Cocktail.
Added mention to Cocktail app cleanup/repair/optimizations, that has
some features that when run they restore the /usr/local directory to
the original 'not writable' state in OS X 10.11 .

Closes Homebrew/homebrew#47379.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-26 07:37:44 +00:00
Xu Cheng
c318a9a03e tap: improve arguments resolution
* Use `ARGV.include?` instead of `ARGV.first ==`, so users can pass
  `-v`/`-d` before the function flags(i.e. `--list-pinned` etc)
* Restore the ability to call `brew tap --flags tap/name`.
2015-12-26 13:01:52 +08:00
Mike McQuaid
75ae0cfb3a tap: don't backtrace on invalid options.
Closes Homebrew/homebrew#47162.
2015-12-25 18:25:01 +00:00
Baptiste Fontaine
86bd9c9f39 tests: pass --trace and named args to rake
Closes Homebrew/homebrew#47279.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-23 12:33:32 +01:00
Øyvind Ingebrigtsen Øvergaard
cf2bf08ec9 bottle: don't read mtime from nonexistant files
If the source contains a broken symlink, `brew bottle` would fail for no
good reason when trying to determine the most recently modified
file. To avoid this, we ignore any files for which stat(2) fails.

Closes Homebrew/homebrew#47111.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-21 07:54:30 +00:00
Xu Cheng
51efa46fcc test-bot: enable coverage on travis 2015-12-21 12:14:48 +08:00
Xu Cheng
0f84b976ba move CoreFormulaRepository into separate file
For users whose local brew is at around 2015-06-11 to 2015-08-06,
running `brew update` will emit following error:

  Error: uninitialized constant Formulary::CoreFormulaRepository

This is caused by the same bug described in Homebrew/homebrew#42553.

This commit workarounds this issue and restores `brew update` compatibility
for users mentioned above.

Also cleanup legacy `require "cmd/tap"`.
2015-12-19 22:05:30 +08:00
Xu Cheng
f72d4f1722 readall: use Tap object to locate alias directory
Let's hide implementation detail on where to find alias directory.
This will benefit future core code and formulae separation.

Also let `brew readall` check aliases for all taps.
2015-12-19 22:05:30 +08:00
Xu Cheng
430cfbb557 readall: allow interrupt 2015-12-19 22:05:30 +08:00
Xu Cheng
0f60f76f26 lsyncd: use MACOS_FULL_VERSION
This commit partial reverts beed39e46fa021dd1c133c2c8eaaa81b524e68c7.

For users whose local brew is at around 2015-06-02 to 2015-06-11,
running `brew update` will emit following error:

  Error: undefined method 'full_version' for OS::Mac:Module

This is caused by the same bug described in Homebrew/homebrew#42553.

Let's use `MACOS_FULL_VERSION` for now to restore `brew update` compatibility
for these users.

TODO: revert this commit after core code and formulae separation.
2015-12-19 21:14:12 +08:00
Dominyk Tiller
e00216e4e5 cmd/cleanup: cleanup java_cache 2015-12-18 23:32:56 +00:00
Martin Afanasjew
02cd2c899a bottle: fix Ruby 1.8 breakage
`OpenStruct` (of which `Tab` is a subclass) doesn't support subscripting
with square brackets. Use normal dot notation to restore compatibility.
2015-12-16 02:12:50 +01:00
Mike McQuaid
b0e39203fe bottle: don't use empty tab. 2015-12-15 17:05:24 +00:00
Baptiste Fontaine
50f94e5233 audit: don't fail if there's no tap
Closes Homebrew/homebrew#47041.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-15 15:52:05 +01:00
Mike McQuaid
214c865167 bottle: make bottle checksums reproducible.
I've set all the variable data to versions that are dependent on the
latest source file date and various modification dates also to the
latest source file date. With this if you rerun `brew bottle`
multiple times in a row you will see the same checksum even if you have
`brew reinstall`ed (as long as upstream does not hardcode e.g. the
build date).

I debugged this with diffoscope and worked on this as part of the
Athens 2015 reproducible builds workshop:
https://reproducible-builds.org/events/athens2015/

Closes Homebrew/homebrew#46587.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-15 14:24:18 +00:00
Martin Afanasjew
b0b5d22af1 man: modernize and reduce code duplication
Also use `popen_read` instead of `safe_system` for cleaner argument
passing and write the output with `atomic_write`.

Closes Homebrew/homebrew#46826.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2015-12-13 22:18:27 +01:00