diff --git a/rickshaw-run b/rickshaw-run index b14f4a41..bcd20b01 100755 --- a/rickshaw-run +++ b/rickshaw-run @@ -505,17 +505,14 @@ sub calc_image_md5 { my $item; # First is the Initial hash calc on workshop reqs - $item = $item_header . "Workshop Config Output:\n" . join("", @config_analysis_output) . "\n"; - $md5->add($item); - print $tag_fh $item; + print $tag_fh $item_header . "Workshop Config Output:\n" . join("", @config_analysis_output) . "\n"; + $md5->add(join("", @config_analysis_output)); # Second is the hashing contents of files for my $file (sort @files) { debug_log(sprintf "calc_image_md5(): adding '%s' to hash\n", $file); - $item = $item_header . "File: " . $file . "\nFile Contents:\n"; - $md5->add($item); - print $tag_fh $item; + print $tag_fh $item_header . "File: " . $file . "\nFile Contents:\n"; open(my $fh, $file); while(<$fh>) { @@ -526,14 +523,13 @@ sub calc_image_md5 { binmode($fh); $md5->addfile($fh); - $md5->add("\n"); close($fh); } my $base_hash = $md5->hexdigest; - print $tag_fh $item_header . "Hash: " . $base_hash . "\n"; - close($tag_fh); my $full_hash = $base_hash . "_" . $arch_suffix; + print $tag_fh $item_header . "Hash: " . $full_hash . "\n"; + close($tag_fh); debug_log(sprintf "calc_image_md5(): returning '%s'\n", $full_hash); return $full_hash;