2303 Commits

Author SHA1 Message Date
Xu Cheng
190902e98f tap: ensure git is installed
Closes Homebrew/homebrew#43463.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-02 15:24:53 +08:00
Xu Cheng
03f7e19ca6 update: ensure git is installed 2015-09-02 15:24:53 +08:00
Alex Dunn
79ea14b738 cmd/search: fix filtering of aliases in results
By directly modifying the results array with
`results[i] = "#{name} (installed)"`, it appeared on successive
iterations that the canonical name was no longer in the array, so
aliases were not removed.

See 9efe5b554c (commitcomment-12969631)

Closes Homebrew/homebrew#43433.
2015-08-31 07:54:59 -07:00
Baptiste Fontaine
5dd0f089a3 config: show HOMEBREW_REPOSITORY
Closes Homebrew/homebrew#43423.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-08-31 09:21:51 +02:00
Alex Dunn
431ebba7af cmd/search: mark installed formulae
`brew search emacs`, with homebrew/emacs tapped:
```
real    0m2.586s
user    0m1.138s
sys     0m0.121s
```
Previously:
```
real    0m2.831s
user    0m1.385s
sys     0m0.087s
```

`brew search s`:
```
real    0m2.260s
user    0m1.201s
sys     0m0.114s
```

Previously:
```
real    0m5.953s
user    0m4.827s
sys     0m0.226s
```

Closes Homebrew/homebrew#35696.
Closes Homebrew/homebrew#42662.
2015-08-30 11:29:13 -07:00
Mike McQuaid
2c959a7d58 More API documentation.
And remove the documented stuff from the `example-formula.rb`.

Closes Homebrew/homebrew#43241.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-29 15:43:16 +01:00
Xu Cheng
a5aba7f7d8 tap: rmdir when tap failed or interrupted
Fixes Homebrew/homebrew#43280.

Closes Homebrew/homebrew#43352.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-28 17:15:23 +08:00
Xu Cheng
3458b99d6e update: secure formula loading in rename
For update, all formula loading need to be secured by `rescue`.
Otherwise it's easy to crash `brew update` for vasty reasons, e.g.
new Formula DSL.

Closes Homebrew/homebrew#43353.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-28 17:15:18 +08:00
Martin Afanasjew
1288e3110d update: always report changes to branch 'master'
If the user's working copy is *not* on the 'master' branch, the revision
recorded after the update to the 'master' branch is not the one of the
updated 'master' branch but that of whatever the user's current branch
is. This tends to be not very helpful.

This change records the revision *after* the update to the 'master'
branch, but *before* switching back to the user's current branch prior
to the update, effectively causing the report to show changes to the
'master' branch.

Closes Homebrew/homebrew#42074.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-27 13:53:28 +01:00
Vlad Shablinsky
fc445d97d3 outdated: update error for different taps
Closes Homebrew/homebrew#43269.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-27 13:51:05 +01:00
Vlad Shablinsky
b68562d941 install: fix if isn't migrated 2015-08-27 13:51:04 +01:00
Mike McQuaid
59bd08e992 pull: more formulae fetch outside of main loop.
Closes Homebrew/homebrew#43313.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-27 13:41:06 +01:00
Tim D. Smith
c2dfcf913d test-bot: don't consider optional deps for compiler selection
Fixes test-bot mishandling of optional cross-tap dependencies. Without
this change, since formula.stable.deps includes the optional dependencies but
formula.recursive_dependencies does not, test-bot was trying to select a
compiler for an untapped formula, which raised an error.

Our suspect handling of optional dependencies was exposed by Homebrew/homebrew#43145 /
7184348e822d6745d8a103de104ff9626536bf1e.

Closes Homebrew/homebrew#43237.
2015-08-27 00:27:31 -07:00
Dominyk Tiller
c992749986 doctor: add system curl <10.7 check
Closes Homebrew/homebrew#43283.

Closes Homebrew/homebrew#43298.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2015-08-26 23:56:10 +01:00
Dominyk Tiller
94bb92b4c1 doctor: add check for SSL_CERT_DIR
Closes Homebrew/homebrew#43154.

Closes Homebrew/homebrew#43277.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2015-08-26 17:30:36 +01:00
Dominyk Tiller
98499d1d29 sandbox: permit /var/tmp & DerivedData
Long term it would be nice to sandbox everything that writes to DerivedData
but it is essentially a cache directory of sorts.

The downside of allowing stuff to write there particularly is that DerivedData
is notoriously bad at getting cleaned up, so if you do a lot of Xcode-using
installations very quickly, you can chew your disk space up.

Closes Homebrew/homebrew#43276.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2015-08-25 22:01:24 +01:00
Mike McQuaid
166e33c2ff pull: do fetch after everything else, sleep more.
Use an exponential back-off on the sleep and try the fetch more times.

Hopefully this will mean that we spent less time waiting for Bintray.

Closes Homebrew/homebrew#43240.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-25 16:43:37 +01:00
Daniel Lee Harple
4e5d92dc10 audit: spelling fix
Closes Homebrew/homebrew#43273.

Signed-off-by: Tim D. Smith <git@tim-smith.us>
2015-08-25 08:24:04 -07:00
Baptiste Fontaine
eb93b82cf2 tap-pin: simplify logic 2015-08-25 17:13:37 +02:00
Baptiste Fontaine
86a5d75dff tap-unpin: simplify logic
Closes Homebrew/homebrew#43260.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-08-25 14:15:38 +02:00
Baptiste Fontaine
e779be1453 update: #each.map is redundant 2015-08-25 09:45:21 +02:00
Xu Cheng
a88c40b8c8 core file style update 2015-08-22 13:15:33 +08:00
Misty De Meo
727239e12f Merge bottle install without Xcode branch
Merge branch 'bottle_hooks'
2015-08-21 11:04:22 -07:00
William Woodruff
04a0b2aafe Mark TODO in brew doctor (future PR) 2015-08-21 11:02:33 -07:00
William Woodruff
56795ec1ed Call check_xcode check for CLT, too 2015-08-21 11:02:33 -07:00
William Woodruff
1face808f5 Add guards to calls that would trigger Xcode install requests
add guard in Formula#file_modified? to prevent git popup

add guard in Superenv.bin before calling MacOS::Xcode.version

add guard against missing Xcode/CLT in Xcode.uncached_version

return nil instread of 0 in uncached_version when Xcode/CLT are not present, to distinguish from linuxbrew behavior

checks against pour_bottle? and needs_relocation?, add guard around keg.relocate_install_names to check pour_bottle?/needs_relocation? as well

needs_relocation? becomes skip_relocation?, use cellar attr to indicate relocation instead of does_not_need_relocation

MacOS.can_build? becomes MacOS.has_apple_developer_tools?
2015-08-21 11:02:33 -07:00
William Woodruff
f58506ea6f FormulaInstaller: add prevent_build_flags to eliminate code repetition
remove unneeded definition

change variable in FormulaInstaller.check_build_flags from bf to build_flags
2015-08-21 10:59:35 -07:00
William Woodruff
91e598cf3f Install: add BuildToolsError and BuildFlagsError
Add these new errors, and guards in formula installation and
cmd/{,un,re}install to match, move can_build? to the MacOS module,
flatten conditions, remove redundant can_build? check

reinstate removed (doctor) check
2015-08-21 10:59:09 -07:00
William Woodruff
85187bf6d3 MacOS: update locate_cctool
This becomes MacOS.{install_name_tool,otool}, only do check_xcode if
xcode is installed, otherwise emit a warning
2015-08-21 10:58:13 -07:00
William Woodruff
b46d5de492 Requirements: add CctoolsRequirement
Install it as a dependency unless already satisfied by Xcode.

require cctools_requirement

cctools_requirement should be satisfied by cctools present in opt

add build_env => false to the satify block options in CctoolsRequirement
2015-08-21 10:57:20 -07:00
William Woodruff
4d65b817ec Install: remove check_for_bad_install_name_tool
Until it can be adapted to not call otool on systems w/o XCode/CLT
2015-08-21 10:56:46 -07:00
Xu Cheng
d09d2690ca tap: add --list-pinned 2015-08-21 20:08:13 +08:00
Xu Cheng
ac71386373 test-bot: tap TapDependency recursively
Closes Homebrew/homebrew#43145.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-21 15:17:21 +08:00
Xu Cheng
62d1636144 update: only update renamed when necessary 2015-08-20 20:12:02 +08:00
Vlad Shablinsky
e4480cf6bf update: add formula renames to report 2015-08-20 19:55:35 +08:00
Xu Cheng
4740d7fad4 uninstall: simplify logic
Also reduce unnecessary disk operations

Closes Homebrew/homebrew#43024.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-18 15:58:07 +08:00
Baptiste Fontaine
8ba0fb9fcf unnecessary calls to .select simplified
These are minor perf optimizations.

Closes Homebrew/homebrew#43028.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-08-18 00:18:22 +02:00
Baptiste Fontaine
f690b54621 Suggest 'brew uninstall' everywhere for consistency
Mixing 'brew remove' with 'brew uninstall' can confuse users.

Closes Homebrew/homebrew#43026.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-08-17 20:36:02 +02:00
Xu Cheng
a380ec636e enable sandbox on test-bot
Closes Homebrew/homebrew#43014.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-17 14:12:11 +08:00
Dominyk Tiller
63a7f29270 cleanup: require thread 2015-08-16 21:01:52 +01:00
Xu Cheng
c4df86eb9d cleanup: speed up rm_DS_Store by multithread
Before

```
$ time brew cleanup -s
brew cleanup -s  0.73s user 3.52s system 58% cpu 7.297 total
```

After

```
$ time brew cleanup -s
brew cleanup -s  0.69s user 2.57s system 139% cpu 2.341 total
```

Closes Homebrew/homebrew#42968.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-17 01:54:03 +08:00
Vlad Shablinsky
d3037f7044 update opt for renamed formula
After the formula gets renamed oldname opt is created and
it points to the linked keg. However if we then upgrade newname
oldname opt still points to the same keg it pointed before upgrade.
The commit fixes this behaviour thus that oldname opt links at the
same keg opt point.
2015-08-17 01:53:58 +08:00
Mike McQuaid
9025719968 cleanup: fix reversed prune time. 2015-08-16 17:50:33 +01:00
Mike McQuaid
76316a82cb cleanup: tweak prune code. 2015-08-16 16:57:12 +01:00
Martin Afanasjew
e85e57b217 cleanup: make --force less aggressive
Change behavior for `brew cleanup` as follows:

- If `--force` is supplied, remove only outdated keg-only packages.
- If `--prune=<days>` is supplied, remove both logs and cached downloads
  older than the specified number of days. Use `--prune=all` to remove
  all logs and cached downloads irrespective of age.
- By default, remove logs after 14 days and cached downloads never.

Also centralizes handling of `--prune`, thus removing duplicate logic.

This is motivated by commit 17eee232838d4639b25f863aa342b1dda61b81bc
that made `--force` much more aggressive and made it override whatever
was specified via `--prune`, completely removing all:

- outdated keg-only packages
- cached downloads irrespective of age
- logs irrespective of age

This made it impossible to remove outdated keg-only packages without
also deleting all cached downloads, which is at least inconvenient for
people with limited bandwidth wanting to rebuild packages later.

Closes Homebrew/homebrew#42970.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-16 16:47:24 +01:00
Xu Cheng
3c45e1e81d update: only compute tapd_basename when necessary 2015-08-15 18:32:22 +08:00
Xu Cheng
0bf2f92f46 outdated: remove unnecessary nested if 2015-08-15 16:18:17 +08:00
Xu Cheng
c518e50320 install: f.oldname can be nil 2015-08-15 15:56:57 +08:00
Mike McQuaid
02d8bfe10b install: mention if installed formula isn't migrated.
Closes Homebrew/homebrew#42940.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-14 15:18:45 +01:00
Mike McQuaid
49dce3e7ae outdated: check if formula needs to be migrated.
Closes Homebrew/homebrew#42938.
2015-08-14 15:18:45 +01:00