Repository: buildr
Updated Branches:
  refs/heads/master a38d1b1a0 -> 3cfd57824


Add support for sha512 digests to be generated for files during the upload


Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/3cfd5782
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/3cfd5782
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/3cfd5782

Branch: refs/heads/master
Commit: 3cfd5782426de99638fed4e087ad9a497cabfdb4
Parents: a38d1b1
Author: Peter Donald <pe...@realityforge.org>
Authored: Fri Mar 2 21:55:03 2018 +1100
Committer: Peter Donald <pe...@realityforge.org>
Committed: Fri Mar 2 21:55:03 2018 +1100

----------------------------------------------------------------------
 CHANGELOG                     | 3 +++
 lib/buildr/core/transports.rb | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/buildr/blob/3cfd5782/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index ea5b799..d02783d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,9 @@
 * Change: JaCoCo Addon: Update JaCoCo version to 0.8.0 which in turns supports 
Java9.
 * Added:  GWT Addon: Added support for `:gwtc_args` parameter to supply 
arbitrary parameters to
           the GWT compiler.
+* Added:  Add support for sha512 digests to be generated for files during the 
upload. This is typically
+          configured by adding `sha512` to the list of digests via a line such 
as:
+          `repositories.release_to[:options] = {:digests => [:md5, :sha1, 
:sha512]}`
 
 1.5.5 (2017-12-06)
 * Fixed:  The concatenation extension released as part of 1.5.4 changed the 
way zip archives were

http://git-wip-us.apache.org/repos/asf/buildr/blob/3cfd5782/lib/buildr/core/transports.rb
----------------------------------------------------------------------
diff --git a/lib/buildr/core/transports.rb b/lib/buildr/core/transports.rb
index 7d6d7fa..6898fbd 100644
--- a/lib/buildr/core/transports.rb
+++ b/lib/buildr/core/transports.rb
@@ -211,7 +211,7 @@ module URI
         end
       elsif source.respond_to?(:read)
         digests = (options[:digests] || [:md5, :sha1]).
-          inject({}) { |hash, name| hash[name] = 
Digest.const_get(name.to_s.upcase).new ; hash }
+          inject({}) { |hash, name| hash[name] = name.to_s == 'sha512' ? 
Digest::SHA2.new(512) : Digest.const_get(name.to_s.upcase).new ; hash}
         size = source.stat.size rescue nil
         write (options).merge(:progress=>verbose && size, :size=>size) do 
|bytes|
           source.read(bytes).tap do |chunk|

Reply via email to