def sha(file, use_sha_file=false)
      if use_sha_file and File.exists?("#{file}.sha1")
        # reading the file is faster than doing a hash, so we keep the hash in the file
        # then we read back and compare.  There is no reason to perform sha1 everytime
        begin
          File.open("#{file}.sha1", 'r') { |f| f.read().strip}
        rescue
          Digest::SHA1.file(File.expand_path(file)).hexdigest
        end
      else
        Digest::SHA1.file(File.expand_path(file)).hexdigest
      end
    end
def sha(file, use_sha_file=false)
      if use_sha_file and File.exists?("#{file}.sha1")
        # reading the file is faster than doing a hash, so we keep the hash in the file
        # then we read back and compare.  There is no reason to perform sha1 everytime
        begin
          File.open("#{file}.sha1", 'r') { |f| f.read().strip}
        rescue
          Digest::SHA1.file(File.expand_path(file)).hexdigest
        end
      else
        Digest::SHA1.file(File.expand_path(file)).hexdigest
      end
    end
returns the sha1 of the file