Skip to content

Commit

Permalink
Updated packager to pad 0s for shorter CRCs
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonjei committed Aug 19, 2016
1 parent 4ff87d9 commit 15ea54d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
files.keys.each do |key|
crcs[key] = {}
files[key].each do |file|
crcs[key][file] = Zlib::crc32(File.read("#{paths[key]}#{file}")).to_s(16)
crcs[key][file] = Zlib::crc32(File.read("#{paths[key]}#{file}")).to_s(16).rjust(8, '0')
end

puts "cd #{paths[key]}; rm #{products}#{key}.zip; zip -r #{products}#{key}.zip #{files[key].join(" ")}"
Expand All @@ -114,13 +114,13 @@

files.keys.each do |key|
files[key].each do |file|
i[key][file] = Zlib::crc32(File.read("#{paths[key]}#{file}")).to_s(16)
i[key][file] = Zlib::crc32(File.read("#{paths[key]}#{file}")).to_s(16).rjust(8, '0')
end
end

files.keys.each do |key|
i['downloads'][key] = "#{url}#{key}.zip"
i['checksums'][key] = Zlib::crc32(File.read("#{products}#{key}.zip")).to_s(16)
i['checksums'][key] = Zlib::crc32(File.read("#{products}#{key}.zip")).to_s(16).rjust(8, '0')
end

File.write("#{products}download.ini", i.to_s)

0 comments on commit 15ea54d

Please sign in to comment.