instance method
Gem::Commands::RebuildCommand#compare
compare(source_date_epoch, old_file, new_file)
lib/rubygems/commands/rebuild_command.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/commands/rebuild_command.rb, line 131
def compare(source_date_epoch, old_file, new_file)
date = Time.at(source_date_epoch.to_i).strftime("%F %T %Z")
old_hash = sha256(old_file)
new_hash = sha256(new_file)
say
say "Built at: #{date} (#{source_date_epoch})"
say "Original build saved to: #{old_file}"
say "Reproduced build saved to: #{new_file}"
say "Working directory: #{options[:build_path] || Dir.pwd}"
say
say "Hash comparison:"
say " #{old_hash}\t#{old_file}"
say " #{new_hash}\t#{new_file}"
say
if old_hash == new_hash
say "SUCCESS - original and rebuild hashes matched"
else
say "FAILURE - original and rebuild hashes did not match"
say
if options[:diff]
if system("diffoscope", old_file, new_file).nil?
alert_error "error: could not find `diffoscope` executable"
end
else
say "Pass --diff for more details (requires diffoscope to be installed)."
end
terminate_interaction 1
end
end
No documentation available