test-bot: only test the runtime dependencies.
Also add support to `brew uses` to ignore build or optional dependencies. Closes Homebrew/homebrew#36154. Closes Homebrew/homebrew#36656. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
		
							parent
							
								
									8e12390fc8
								
							
						
					
					
						commit
						105eaf3382
					
				| @ -363,7 +363,7 @@ module Homebrew | ||||
|       unchanged_dependencies = dependencies - @formulae | ||||
|       changed_dependences = dependencies - unchanged_dependencies | ||||
| 
 | ||||
|       dependents = `brew uses #{formula_name}`.split("\n") | ||||
|       dependents = `brew uses --skip-build --skip-optional #{formula_name}`.split("\n") | ||||
|       dependents -= @formulae | ||||
|       dependents = dependents.map {|d| Formulary.factory(d)} | ||||
| 
 | ||||
|  | ||||
| @ -11,15 +11,24 @@ module Homebrew | ||||
|     used_formulae = ARGV.formulae | ||||
|     formulae = (ARGV.include? "--installed") ? Formula.installed : Formula | ||||
|     recursive = ARGV.flag? "--recursive" | ||||
|     ignores = [] | ||||
|     ignores << "build?" if ARGV.flag? "--skip-build" | ||||
|     ignores << "optional?" if ARGV.flag? "--skip-optional" | ||||
| 
 | ||||
|     uses = formulae.select do |f| | ||||
|       used_formulae.all? do |ff| | ||||
|         begin | ||||
|           if recursive | ||||
|             f.recursive_dependencies.any? { |dep| dep.to_formula.name == ff.name } || | ||||
|             deps = f.recursive_dependencies.reject do |dep| | ||||
|               ignores.any? { |ignore| dep.send(ignore) } | ||||
|             end | ||||
|             deps.any? { |dep| dep.to_formula.name == ff.name } || | ||||
|               f.recursive_requirements.any? { |req| req.name == ff.name } | ||||
|           else | ||||
|             f.deps.any? { |dep| dep.to_formula.name == ff.name } || | ||||
|             deps = f.deps.reject do |dep| | ||||
|               ignores.any? { |ignore| dep.send(ignore) } | ||||
|             end | ||||
|             deps.any? { |dep| dep.to_formula.name == ff.name } || | ||||
|               f.requirements.any? { |req| req.name == ff.name } | ||||
|           end | ||||
|         rescue FormulaUnavailableError => e | ||||
|  | ||||
| @ -398,7 +398,7 @@ Note that these flags should only appear after a command. | ||||
|     If <formulae> are given, upgrade only the specified brews (but do so even | ||||
|     if they are pinned; see `pin`, `unpin`). | ||||
| 
 | ||||
|   * `uses [--installed] [--recursive] [--devel|--HEAD]` <formulae>: | ||||
|   * `uses [--installed] [--recursive] [--skip-build] [--skip-optional] [--devel|--HEAD]` <formulae>: | ||||
|     Show the formulae that specify <formulae> as a dependency. When given | ||||
|     multiple formula arguments, show the intersection of formulae that use | ||||
|     <formulae>. | ||||
| @ -407,6 +407,10 @@ Note that these flags should only appear after a command. | ||||
| 
 | ||||
|     If `--installed` is passed, only list installed formulae. | ||||
| 
 | ||||
|     By default, `uses` shows all formulae that specify <formulae> as a dependency. | ||||
|     To skip the `:build` type dependencies, pass `--skip-build`. Similarly, pass | ||||
|     `--skip-optional` to skip `:optional` dependencies. | ||||
| 
 | ||||
|     By default, `uses` shows usages of `formula` by stable builds. To find | ||||
|     cases where `formula` is used by development or HEAD build, pass | ||||
|     `--devel` or `--HEAD`. | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| .\" generated with Ronn/v0.7.3 | ||||
| .\" http://github.com/rtomayko/ronn/tree/0.7.3 | ||||
| . | ||||
| .TH "BREW" "1" "January 2015" "Homebrew" "brew" | ||||
| .TH "BREW" "1" "February 2015" "Homebrew" "brew" | ||||
| . | ||||
| .SH "NAME" | ||||
| \fBbrew\fR \- The missing package manager for OS X | ||||
| @ -426,7 +426,7 @@ Options for the \fBinstall\fR command are also valid here\. | ||||
| If \fIformulae\fR are given, upgrade only the specified brews (but do so even if they are pinned; see \fBpin\fR, \fBunpin\fR)\. | ||||
| . | ||||
| .TP | ||||
| \fBuses [\-\-installed] [\-\-recursive] [\-\-devel|\-\-HEAD]\fR \fIformulae\fR | ||||
| \fBuses [\-\-installed] [\-\-recursive] [\-\-skip\-build] [\-\-skip\-optional] [\-\-devel|\-\-HEAD]\fR \fIformulae\fR | ||||
| Show the formulae that specify \fIformulae\fR as a dependency\. When given multiple formula arguments, show the intersection of formulae that use \fIformulae\fR\. | ||||
| . | ||||
| .IP | ||||
| @ -436,6 +436,9 @@ Use \fB\-\-recursive\fR to resolve more than one level of dependencies\. | ||||
| If \fB\-\-installed\fR is passed, only list installed formulae\. | ||||
| . | ||||
| .IP | ||||
| By default, \fBuses\fR shows all formulae that specify \fIformulae\fR as a dependency\. To skip the \fB:build\fR type dependencies, pass \fB\-\-skip\-build\fR\. Similarly, pass \fB\-\-skip\-optional\fR to skip \fB:optional\fR dependencies\. | ||||
| . | ||||
| .IP | ||||
| By default, \fBuses\fR shows usages of \fBformula\fR by stable builds\. To find cases where \fBformula\fR is used by development or HEAD build, pass \fB\-\-devel\fR or \fB\-\-HEAD\fR\. | ||||
| . | ||||
| .TP | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Xu Cheng
						Xu Cheng