Sha256: 02e52cb2e0fe1a3718f6f42a6652ec41297bb882f7aecfc6dc4266e78bd5745a
Contents?: true
Size: 702 Bytes
Versions: 6
Compression:
Stored size: 702 Bytes
Contents
#!/usr/bin/env ruby require 'rubygems' require 'digest/sha1' if ARGV.length != 2 puts "Usage: #{$0} checksum_file directory_to_compare" exit 1 end #if def cmd(cmd) puts cmd system(cmd) end #cmd checksum_file = ARGV[0] dir_to_compare = ARGV[1] # Downoad Packages from S3 cmd "ruby ./installer/utils/download_from_s3.rb #{dir_to_compare}" # Create the checksum to compare against the one from the S3 repo cmd "ruby ./installer/utils/create_sha1.rb #{dir_to_compare} ." old_sha1 = File.open(checksum_file) { |f| f.readline } new_sha1 = File.open('./checksum') { |f| f.readline } if !new_sha1.eql?(old_sha1) puts "Checksums do not match!" exit 2 else puts "Checksums match!" end #if
Version data entries
6 entries across 6 versions & 1 rubygems