Commit 139f3c33 authored by Marin Jankovski's avatar Marin Jankovski

Merge branch 'deb_packager_fixes' into gitlab_omnibus

parents a20b6cad 655c74db
......@@ -263,7 +263,7 @@ module Omnibus
def write_md5_sums
path = "#{staging_dir}/**/*"
hash = FileSyncer.glob(path).inject({}) do |hash, path|
if File.file?(path) && !File.symlink?(path)
if File.file?(path) && !File.symlink?(path) && !(File.dirname(path) == debian_dir)
relative_path = path.gsub("#{staging_dir}/", '')
hash[relative_path] = digest(path, :md5)
end
......
<% md5sums.each do |path, checksum| -%>
<%= checksum %> <%= path %>
<%= checksum %> <%= path %>
<% end -%>
......@@ -198,6 +198,8 @@ module Omnibus
create_file("#{staging_dir}/.filea") { ".filea" }
create_file("#{staging_dir}/file1") { "file1" }
create_file("#{staging_dir}/file2") { "file2" }
create_file("#{staging_dir}/DEBIAN/preinst") { "preinst" }
create_file("#{staging_dir}/DEBIAN/postrm") { "postrm" }
end
it 'generates the file' do
......@@ -209,9 +211,12 @@ module Omnibus
subject.write_md5_sums
contents = File.read("#{staging_dir}/DEBIAN/md5sums")
expect(contents).to include("9334770d184092f998009806af702c8c .filea")
expect(contents).to include("826e8142e6baabe8af779f5f490cf5f5 file1")
expect(contents).to include("1c1c96fd2cf8330db0bfa936ce82f3b9 file2")
expect(contents).to include("9334770d184092f998009806af702c8c .filea")
expect(contents).to include("826e8142e6baabe8af779f5f490cf5f5 file1")
expect(contents).to include("1c1c96fd2cf8330db0bfa936ce82f3b9 file2")
expect(contents).to_not include("0c5bc033075b0c1062e861f18219f8fd DEBIAN/preinst")
expect(contents).to_not include("4e8ed96bd90c2c964c0e9d36865e53e5 DEBIAN/postrm")
expect(contents).to_not include("1c1c96fd2cf8330db0bfa936ce82f3b9 file2")
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment