Sha256: 5eb16cc361bdcee28840903a8eeee7acc6a3f2a6ebad24c853218a99f6cc465d
Contents?: true
Size: 703 Bytes
Versions: 11
Compression:
Stored size: 703 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
11 entries across 11 versions & 1 rubygems