Skip to content

Commit

Permalink
Merge pull request #2 from antifuchs/patch-1
Browse files Browse the repository at this point in the history
Include a formula's revision in its version number
  • Loading branch information
timsutton committed May 8, 2014
2 parents 41a815f + 86840d9 commit 630b72f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion brew-pkg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def pkg
name = f.name
identifier = identifier_prefix + ".#{name}"
version = f.version.to_s
version += "_#{f.revision}" if f.revision.to_s != '0'

# Make sure it's installed first
if not f.installed?
Expand All @@ -61,9 +62,12 @@ def pkg

pkgs.each do |pkg|
formula = Formula.factory(pkg.to_s)
dep_version = formula.version.to_s
dep_version += "_#{formula.revision}" if formula.revision.to_s != '0'

ohai "Staging formula #{formula.name}"
# Get all directories for this keg, rsync to the staging root
dirs = Pathname.new(File.join(HOMEBREW_CELLAR, formula.name, formula.version.to_s)).children.select { |c| c.directory? }.collect { |p| p.to_s }
dirs = Pathname.new(File.join(HOMEBREW_CELLAR, formula.name, dep_version)).children.select { |c| c.directory? }.collect { |p| p.to_s }
dirs.each {|d| safe_system "rsync", "-a", "#{d}", "#{staging_root}/" }

# Write out a LaunchDaemon plist if we have one
Expand Down

0 comments on commit 630b72f

Please sign in to comment.