9434 Commits

Author SHA1 Message Date
Xu Cheng
2d84fc56fe update-bash: improve reset_on_interrupt
* 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
2016-01-21 21:14:55 +08:00
Xu Cheng
fafe8f0f53 update: implement rename_taps_dir_if_necessary in bash
rename_taps_dir_if_necessary must be performed before actual update.
Otherwise, it will report that `HOMEBREW_UPDAET_BEFORE<REPO_VAR>` is
unset.
2016-01-21 21:14:55 +08:00
Xu Cheng
ca59d6fbee update: improve repo_var
* 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.
2016-01-21 21:14:55 +08:00
Xu Cheng
9cd2658073 update-bash: avoid shellout for stripping prefix 2016-01-21 21:14:55 +08:00
Xu Cheng
83e1373376 update-bash: use odie and chdir from bin/brew 2016-01-21 21:14:55 +08:00
Xu Cheng
bc78f81032 update-bash: always use [[ 2016-01-21 21:14:55 +08:00
Xu Cheng
826f65cc2f update-report: skip non git tap 2016-01-21 21:14:55 +08:00
Xu Cheng
bb5cf70a02 update-bash: fix incorrect argument parsing 2016-01-21 21:14:55 +08:00
Martin Afanasjew
89f97295b8 tests: speed up integration test runs
While running a command from the integration tests, invoke `.result` to
trigger a save of the result set, but don't call `.format!` to avoid
(re)generating the HTML output with every run. The final output will
still be written once the main unit test run completes.

This significantly speeds up the integration tests, that take about 1/3
less time to complete when not generating the intermediate output.

Closes Homebrew/homebrew#48280.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-21 05:42:23 +01:00
Martin Afanasjew
274640c97a tests: use unique identifiers w/ integration tests
Commands executed during integration testing are executed in a separate
process and thus generate a new result set for each command. To avoid
that these results override each other, they need to have a unique
`command_name`. Derive this name from the test class/name and the index
of the command inside that test, resulting in identifiers like
`IntegrationCommandTests#test_prefix.1 brew --prefix`.

Also replaces `TEST_TMPDIR` in the arguments with `"@TMPDIR@"` to get a
cleaner command identifier that is independent of the temporary
directory that changes with every run.
2016-01-21 05:42:23 +01:00
Martin Afanasjew
5786f36b62 tests: add --only=<test>[/<method>] flag
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`.

Closes Homebrew/homebrew#48279.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-21 05:42:06 +01:00
Martin Afanasjew
0d1e72f55f tests: allow passing --seed <number>
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>`.
2016-01-21 05:42:06 +01:00
Martin Afanasjew
a12c5816aa tests: remove useless filter for coverage tests
The filter for `vendor/bundle/` is useless because this directory is
located in `Homebrew/test/` and that one is already filtered. Moreover,
SimpleCov already loads the `bundler_filter` profile (that installs
basically the same filter) in its default configuration.
2016-01-21 05:42:06 +01:00
Baptiste Fontaine
5775d3b326 command: support .sh commands
Closes Homebrew/homebrew#48192.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-20 22:27:13 +01:00
Baptiste Fontaine
c1e673e19a commands: support .sh commands 2016-01-20 22:27:13 +01:00
Alex Dunn
b8547eab2c update test for Homebrew/homebrew-emacs#158
Closes Homebrew/homebrew#48131.

Signed-off-by: Alex Dunn <dunn.alex@gmail.com>
2016-01-20 11:42:36 -08:00
Alex Dunn
0cde5dd060 test: add metafiles to testball 2016-01-20 11:42:36 -08:00
Alex Dunn
37e61aed62 build#install: install metafiles in buildpath
This came up in https://github.com/Homebrew/homebrew-emacs/pull/158#issuecomment-172031003;  `install_metafiles` is passed the current directory, which can be changed during installation by `Dir.chdir`.

There may be cases where the metafiles are in a subdirectory, but my
guess is those are rare and this is brittle and undocumented behavior
anyway.
2016-01-20 11:42:36 -08:00
Baptiste Fontaine
f9fd251605 tap-readme: fix for Ruby 1.8
Closes Homebrew/homebrew#48281.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-20 20:15:34 +01:00
Baptiste Fontaine
da500eec6a tests: ExternalPatch test added 2016-01-20 20:15:34 +01:00
Baptiste Fontaine
343f431c46 tests: exceptions tests added 2016-01-20 20:15:34 +01:00
Baptiste Fontaine
4ba4812d1d tests: tap-readme integration test added 2016-01-20 20:15:34 +01:00
Baptiste Fontaine
36c734b392 tests: cmd/edit & cmd/info tests added 2016-01-20 20:15:34 +01:00
Baptiste Fontaine
861910b85f sh: flush stdout before executing the shell
Closes Homebrew/homebrew#48268.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-20 11:37:42 +01:00
Martin Afanasjew
026363e1ed diagnostic: fix autoconf check
Xcode can only provide autotools if it is installed, thus check that
first. Skipping this check will try to compare a `nil` Xcode version to
4.3, the first version of Xcode to not provide autotools.

Fixes Homebrew/homebrew#48208.

Closes Homebrew/homebrew#48278.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-20 10:23:21 +01:00
Martin Afanasjew
4ffe25adc8 doc: move images into their own directory
By doing this, make the GitHub directory listing for the documentation
directory more useful and less cluttered.

Closes Homebrew/homebrew#48219.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-20 09:44:33 +01:00
Martin Afanasjew
ca676d4d6f doc: remove unused images
These files were imported from the wiki, but they are not referenced by
any of the other documentation files.
2016-01-20 09:44:33 +01:00
Xu Cheng
2d65caaee9 bin/brew: use not operator inside [[ 2016-01-20 16:04:02 +08:00
Xu Cheng
318ce388d7 bin/brew: use full path for xcode-select
Closes Homebrew/homebrew#48197.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-01-20 13:55:07 +08:00
Xu Cheng
f51587ee74 brew.rb: fix style problem
Generated by `brew style --fix Library/brew.rb`
2016-01-20 13:55:06 +08:00
Xu Cheng
27e8577f94 brew.rb: fix overeager help flag matching 2016-01-20 13:55:06 +08:00
Xu Cheng
b324d61f35 bin/brew: remove unpin from sudo check list
We only need to check sudo for commands which create files.
2016-01-20 13:55:06 +08:00
Xu Cheng
e3011dfe91 bin/brew: include alias in sudo check 2016-01-20 13:55:06 +08:00
Xu Cheng
e12e1a5d5d bin/brew: introduce odie function 2016-01-20 13:55:06 +08:00
Xu Cheng
3fdf1a623b bin/brew: always use [[ for consistency 2016-01-20 13:55:06 +08:00
Xu Cheng
29c50d2567 bin/brew: remove unnecessary check
HOMEBREW_BASH_COMMAND variable will always exist. So we only need to
check whether the corresponding file exist or not.
2016-01-20 13:55:06 +08:00
Xu Cheng
f9b33e26e0 brew: remove duplicated logic
This is now handled by `bin/brew`
2016-01-20 13:55:06 +08:00
Xu Cheng
6b5b8757bf bin/brew: fix incorrect argument manipulation
Shifting `-v` argument is all we need to do. We shouldn't enumerate
arguments.
2016-01-20 13:55:06 +08:00
Baptiste Fontaine
92a71a534f os/mac: use start_with? when possible
Closes Homebrew/homebrew#48071.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-19 14:00:01 +01:00
Dominyk Tiller
7faae5adf2 keg: mkpath on lua shares
Closes Homebrew/homebrew#48134.
2016-01-19 12:54:00 +00:00
Mike McQuaid
84a85b97ff Revert "formula_installed: tweak source build behaviour."
This reverts commit 5dd200c6b40f4fa9cc3a70cbc9ca2885e4626943.

Closes Homebrew/homebrew#47889.
2016-01-19 10:16:59 +00:00
Baptiste Fontaine
44a264376b tests: rm the coverage cache before each run
Closes Homebrew/homebrew#48209.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-19 00:28:41 +01:00
Misty De Meo
89c63279d4 Remove cleanup --force from bash completion 2016-01-18 10:15:01 -08:00
Misty De Meo
d1440e504e Update manpage to remove cleanup --force 2016-01-18 10:14:56 -08:00
Misty De Meo
09ba000be1 Permit cleanup to remove outdated keg-only formulae
This check is not really relevant anymore; old-style, pre-opt installs
date from 2012 at the very latest, so it is very unlikely that any
packages remain which still link against these.

Refs Homebrew/homebrew#48139.
2016-01-18 10:10:09 -08:00
Mike McQuaid
b118539c8c bin/brew: use a function to avoid issues.
Otherwise when `bin/brew` is updated in-place Bash will carry on from
the offset and this can cause issues.

Thanks to `@UniqMartin` for pointing this out.
2016-01-18 09:37:46 +00:00
Mike McQuaid
5b7dd99e99 Revert "Revert "dependency: don't recurse infinitely.""
This reverts commit fa43883dd1cd82f234b79c4a322339f03b9c098d.

Closes Homebrew/homebrew#48187.
2016-01-18 08:59:52 +00:00
John Zeringue
a600262f68 formula: output recommended/optional deps in JSON.
Fixes Homebrew/homebrew#47914 by distinguishing between required, optional, and
recommended dependencies when using `brew info --json=v1`. This is done
by adding the `optional_dependencies` and `recommended_dependencies`
fields to the JSON output.

A good example of this fix is `brew info --json=v1 dtrx`.

Closes Homebrew/homebrew#48196.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-01-18 08:45:58 +00:00
Josh Bode
b6729191fa diagnostic: update check for findutils.
Check for non-prefixed findutils in path via gnubin symlinks or directly

Closes Homebrew/homebrew#46987.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-01-18 08:44:47 +00:00
Grant Hutchins
624ca35f42 diagnostic: note El Capitan upgrade permissions.
On all of the machines I have upgraded to OS X El Capitan, my /usr/local
directory has changed ownership. Since this message shows up as an error
during `brew update`, I figured it would be good to beef up the
explanation.

Closes Homebrew/homebrew#44670.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-01-17 21:57:44 +00:00