From 9fd859b860f376e3a120e7a51dee7e69cd587c77 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 13 May 2014 15:47:36 +0000 Subject: make-snapshot: -digests option * tool/make-snapshot (package): add -digests option to select digest algorithms to be shown. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/make-snapshot | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tool/make-snapshot b/tool/make-snapshot index 99f80de560..f154ac435a 100755 --- a/tool/make-snapshot +++ b/tool/make-snapshot @@ -22,6 +22,7 @@ options: -keep_temp keep temporary working directory -patch_file=PATCH apply PATCH file after export -packages=PKG[,...] make PKG packages (#{PACKAGES.keys.join(", ")}) + -digests=ALG[,...] show ALG digests (#{DIGESTS.join(", ")}) version: trunk, stable, branches/*, tags/*, X.Y.Z, X.Y.Z-pL each versions may be followed by optional @revision. @@ -74,6 +75,12 @@ $packages &&= $packages.split(/[, ]+/).tap {|pkg| } $packages ||= PACKAGES.keys +$digests &&= $digests.split(/[, ]+/).tap {|dig| + dig -= DIGESTS + dig.empty? or abort "#{File.basename $0}: unknown digests - #{dig.join(", ")}" +} +$digests ||= DIGESTS + $patch_file &&= File.expand_path($patch_file) path = ENV["PATH"].split(File::PATH_SEPARATOR) %w[YACC BASERUBY RUBY MV MINIRUBY].each do |var| @@ -332,7 +339,7 @@ revisions.collect {|rev| package(rev, destdir)}.flatten.each do |name| str = open(name, "rb") {|f| f.read} puts "* #{name}" puts " SIZE: #{str.bytesize} bytes" - DIGESTS.each do |alg| + $digests.each do |alg| printf " %-8s%s\n", "#{alg}:", Digest.const_get(alg).hexdigest(str) end end -- cgit v1.2.3