30 Commits

Author SHA1 Message Date
Andrew R. McBurney
010207b982 Changed cache usage behavior.
1. Running `brew linkage some_package` does not set the cache.
2. Running `brew linkage --cached some_package` when `DatabaseCache.empty?` returns `true` should build the cache.
3. Running `brew linkage --cached some_package` when `DatabaseCache.empty?` returns `false` should use the cache.
2018-05-21 17:36:30 -04:00
Andrew R. McBurney
e93e8f3266 Lazily load db of type DBM instance variable for DatabaseCache so the corresponding database file isn't created in the .use block for a DatabaseCache. 2018-05-18 16:37:01 -04:00
Andrew R. McBurney
cd6f89ca76 Made DatabaseCache.new private, and changes instances in code that call it to use DatabaseCache.use instead. 2018-05-18 10:06:30 -04:00
AndrewMcBurney
916247b920 Merge remote-tracking branch 'origin/master' into cache-optimization 2018-04-24 16:49:51 -04:00
Mike McQuaid
4a03145c1c linkage: fix --test exit code.
Ensure that a non-zero exit code is set both for missing random dylibs
and random missing dependencies.

Additionally, while we are here, drastically trim down the public
interface for this class to the bare minimum and allow getting the
output from `display_test_output` as a variable.

Fixes issue mentioned by @ilovezfs in:
https://github.com/Homebrew/brew/pull/3940#issuecomment-383794520
2018-04-24 09:52:51 +01:00
AndrewMcBurney
bc76a8afcb Changed default behavior of brew linkage command to build cache instead of using cached output. Cached output may be printed with --cached flag. 2018-03-14 16:36:56 -04:00
AndrewMcBurney
831fcfa5dd Merge remote-tracking branch 'origin/master' into cache-optimization 2018-03-06 11:46:23 -05:00
Shaun Jackman
97932c1abf Move linkage_checker from os/mac to generic 2018-02-28 11:18:27 -08:00
AndrewMcBurney
d7765dd223 Separated os/mac/cache_store.rb into cache_store.rb and os/mac/linkage_cache_store.rb. 2018-02-28 10:39:15 -05:00
AndrewMcBurney
14256faa47 Added flag to flush_cache in LinkageChecker. Format ruby hash as JSON string before storing in dbm. 2018-02-27 13:05:19 -05:00
AndrewMcBurney
4bc6459ed7 Removed redundant documentation, use database_cache as a block, and use symbolic keys over string keys in function calls. 2018-02-25 12:14:11 -05:00
AndrewMcBurney
69b590012d Berkeley db cache optimization for brew linkage command. 2018-02-12 16:31:41 -05:00
EricFromCanada
1d2b4ed321 docs: add more missing option descriptions
and improve wording or formatting where necessary.
2018-02-01 16:06:17 -05: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
Markus Reiter
0ab750bf24 Use module_function for commands. 2016-10-02 00:24:47 +02:00
Mike McQuaid
ebdb879fe4 Add --help to all developer commands.
Also, flag those that we never want to be in a manpage.
2016-09-08 09:05:00 +01:00
Xu Cheng
13730a9dad
move LinkageChecker to standalone file 2016-07-14 15:23:33 +08:00
ilovezfs
454645263d Revert "linkage: check undeclared dependencies for --test"
This reverts commit 080ddd8804be14f4b18f9558b58270456ff313c2.
2016-07-07 13:00:40 -07:00
ilovezfs
b35da247af Revert "linkage: update --test documentation"
This reverts commit 310d7067e01952cdcefe8b2c877bc4c792654de2.
2016-07-07 12:59:45 -07:00
Martin Afanasjew
310d7067e0 linkage: update --test documentation
Adjust the wording to be in sync with the changes made in #424.
2016-07-04 08:16:23 +02:00
Xu Cheng
a97661a548
linkage: document --reverse 2016-07-03 16:50:55 +08:00
Xu Cheng
9167fbf876
linkage: fix edge cases for undeclared_deps
* take requirements into account.
* handle full qualified formula name.
* filter out build time or unused optional deps/requirements.

Closes #424.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-07-03 16:45:30 +08:00
Xu Cheng
080ddd8804
linkage: check undeclared dependencies for --test
Also allowing access results for LinkageChecker
2016-07-03 16:45:29 +08:00
Tim D. Smith
abca5936f2 Add --reverse to brew linkage
For each dylib the keg references, print the dylib followed by the
binaries which link to it.

Closes #431.
2016-07-02 23:58:07 -07:00
Martin Afanasjew
806cfeee18 linkage: simplify display logic
Move check for emptiness into the display method, avoiding repetitive
checks on the call site.

Closes #381.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-06-19 23:53:25 +02:00
Martin Afanasjew
e65d8e17e7 linkage: fix code style issues 2016-06-19 23:53:25 +02:00
Martin Afanasjew
7812b500b8 linkage: avoid checking symlinks/directories
Prevent raising an error when `HOMEBREW_RUBY_MACHO=1` is set. Skipping
symlinks and directories while iterating over a directory structure to
find Mach-O binaries makes sense and similar logic is applied elsewhere.
2016-06-19 23:53:25 +02:00
Xu Cheng
612f70fba1 linkage: fix Ruby syntax warning
Library/Homebrew/dev-cmd/linkage.rb:113: warning: shadowing outer local variable - label
2016-04-19 15:08:38 +08:00
Xu Cheng
684c44f356 linkage: load formula from rack
This is to avoid TapFormulaAmbiguityError.
We should load formula based on what we installed,
rather than just name.
2016-04-19 13:55:47 +08:00
Andrew Janke
da34fba151 test-bot: check all dependents for broken dylibs
Pulls 'brew linkage' in to main brew repo as a dev-cmd, and has test-bot
use it to detect dylib breakage, which usually means a revision bump is
needed. Checks all dependents, not just those with a 'test do' block
defined, since we can do this without formula support.

Closes #107.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-18 13:37:34 -04:00