Sha256: 5000b6763a7655b9b0f52a8f87ac7db47a77366224fe626abf6d7c182aeffbfd

Contents?: true

Size: 734 Bytes

Versions: 1

Compression:

Stored size: 734 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 }

puts Dir.ls_la dir_to_compare

if !new_sha1.eql?(old_sha1)
  puts "Checksums do not match!"
  exit 2
else
  puts "Checksums match!"
end #if

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rhoconnect-3.2.0 installer/utils/verify_checksum.rb