Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

brew-info: specify whether poured or built. #18475

Closed
wants to merge 1 commit into from

1 participant

@mikemcquaid
Owner
  • Store in the tab if a bottle was poured for the build.
  • Add an additional line of output to brew info outputting whether the formula was built from source or poured from a bottle.

Closes #18430.

@mikemcquaid mikemcquaid referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@mikemcquaid mikemcquaid referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@mikemcquaid mikemcquaid brew-info: specify whether poured or built.
- Store in the tab if a bottle was poured for the build.
- Add an additional line of output to `brew info` outputting whether
  the formula was built from source or poured from a bottle.

Closes #18430.
Closes #18475.
e332c58
@mikemcquaid
Owner

@mistydemeo Added to to_hash, used from_keg and the case statement. Let me know if it looks good to you and I'll merge it (or feel free to merge it). Thanks!

@mikemcquaid mikemcquaid closed this pull request from a commit
@mikemcquaid mikemcquaid brew-info: specify whether poured or built.
- Store in the tab if a bottle was poured for the build.
- Add an additional line of output to `brew info` outputting whether
  the formula was built from source or poured from a bottle.

Closes #18430.
Closes #18475.
5010dca
@mikemcquaid mikemcquaid deleted the branch
@molinari molinari referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@Sharpie Sharpie referenced this pull request from a commit in Sharpie/homebrew
@mikemcquaid mikemcquaid brew-info: specify whether poured or built.
- Store in the tab if a bottle was poured for the build.
- Add an additional line of output to `brew info` outputting whether
  the formula was built from source or poured from a bottle.

Closes #18430.
Closes #18475.
9778d77
@nesv nesv referenced this pull request from a commit in nesv/homebrew
@mikemcquaid mikemcquaid brew-info: specify whether poured or built.
- Store in the tab if a bottle was poured for the build.
- Add an additional line of output to `brew info` outputting whether
  the formula was built from source or poured from a bottle.

Closes #18430.
Closes #18475.
113d006
@rajeeja rajeeja referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@shelhamer shelhamer referenced this pull request from a commit
@mikemcquaid mikemcquaid brew-info: specify whether poured or built.
- Store in the tab if a bottle was poured for the build.
- Add an additional line of output to `brew info` outputting whether
  the formula was built from source or poured from a bottle.

Closes #18430.
Closes #18475.
351f1f0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 15, 2013
  1. @mikemcquaid

    brew-info: specify whether poured or built.

    mikemcquaid authored
    - Store in the tab if a bottle was poured for the build.
    - Add an additional line of output to `brew info` outputting whether
      the formula was built from source or poured from a bottle.
    
    Closes #18430.
    Closes #18475.
This page is out of date. Refresh to see the latest.
View
7 Library/Homebrew/cmd/info.rb
@@ -103,6 +103,13 @@ def info_formula f
print " *" if keg.linked?
puts
tab = Tab.for_keg keg
+
+ # Intentionally print no message if this is nil because it's unknown.
+ case tab.poured_from_bottle
+ when true then puts "Poured from bottle"
+ when false then puts "Built from source"
+ end
+
unless tab.used_options.empty?
puts " Installed with: #{tab.used_options*', '}"
end
View
3  Library/Homebrew/formula.rb
@@ -504,7 +504,8 @@ def to_hash
hsh["installed"] << {
"version" => keg.basename.to_s,
"used_options" => tab.used_options.map(&:flag),
- "built_as_bottle" => tab.built_bottle
+ "built_as_bottle" => tab.built_bottle,
+ "poured_from_bottle" => tab.poured_from_bottle
}
end
end
View
4 Library/Homebrew/formula_installer.rb
@@ -97,6 +97,10 @@ def install
if pour_bottle?
pour
@poured_bottle = true
+ tab = Tab.for_keg f.prefix
+ tab.poured_from_bottle = true
+ tab.tabfile.delete rescue nil
+ tab.write
end
rescue
opoo "Bottle installation failed: building from source."
View
3  Library/Homebrew/tab.rb
@@ -21,6 +21,7 @@ def self.create f, args
:unused_options => f.build.unused_options,
:tabfile => f.prefix.join(FILENAME),
:built_as_bottle => !!ARGV.build_bottle?,
+ :poured_from_bottle => false,
:tapped_from => f.tap,
:time => Time.now.to_i, # to_s would be better but Ruby has no from_s function :P
:HEAD => sha
@@ -53,6 +54,7 @@ def self.dummy_tab f=nil
Tab.new :used_options => [],
:unused_options => (f.build.as_flags rescue []),
:built_as_bottle => false,
+ :poured_from_bottle => false,
:tapped_from => "",
:time => nil,
:HEAD => nil
@@ -93,6 +95,7 @@ def to_json
:used_options => used_options.to_a,
:unused_options => unused_options.to_a,
:built_as_bottle => built_as_bottle,
+ :poured_from_bottle => poured_from_bottle,
:tapped_from => tapped_from,
:time => time,
:HEAD => send("HEAD")})
Something went wrong with that request. Please try again.