diff --git a/lib/ood_packaging/package.rb b/lib/ood_packaging/package.rb index 242da0b..1cf466f 100644 --- a/lib/ood_packaging/package.rb +++ b/lib/ood_packaging/package.rb @@ -238,7 +238,7 @@ def tar! end tar_file = "#{dir}/#{tar_name}.tar.gz" cmd.concat ["--transform 's,^,#{tar_name}/,'"] - cmd.concat ['-h', '-T', '-', '|', "gzip > #{tar_file}"] + cmd.concat ['-h', '--hard-dereference', '-T', '-', '|', "gzip > #{tar_file}"] sh "rm #{tar_file}" if File.exist?(tar_file) puts "Create tar archive #{tar_file}".blue diff --git a/spec/ood_packaging/package_spec.rb b/spec/ood_packaging/package_spec.rb index e19a79d..0eec42d 100644 --- a/spec/ood_packaging/package_spec.rb +++ b/spec/ood_packaging/package_spec.rb @@ -78,7 +78,7 @@ expected_cmd = [ 'git', 'ls-files', '.', '|', 'tar', '-c', "--transform 's,^,package-0.0.1/,'", - '-h', '-T', '-', '|', 'gzip >', File.join(config[:package], 'packaging/rpm', 'package-0.0.1.tar.gz') + '-h', '--hard-dereference', '-T', '-', '|', 'gzip >', File.join(config[:package], 'packaging/rpm', 'package-0.0.1.tar.gz') ] expect(package).to receive(:sh).with(expected_cmd.join(' '), verbose: false) package.tar! @@ -93,7 +93,7 @@ 'git', 'ls-files', '.', '|', 'tar', '-c', "--transform 'flags=r;s,packaging/deb,debian,'", "--transform 's,^,package-0.0.1/,'", - '-h', '-T', '-', '|', 'gzip >', File.join(config[:package], 'build', 'package-0.0.1.tar.gz') + '-h', '--hard-dereference', '-T', '-', '|', 'gzip >', File.join(config[:package], 'build', 'package-0.0.1.tar.gz') ] FileUtils.mkdir_p(File.join(config[:package], 'build')) expect(package).to receive(:sh).with("mkdir -p #{File.join(config[:package], 'build')}") @@ -107,7 +107,7 @@ 'git', 'ls-files', '.', '|', 'tar', '-c', "--transform 'flags=r;s,packaging/deb,debian,'", "--transform 's,^,package-0.0.1/,'", - '-h', '-T', '-', '|', 'gzip >', File.join(config[:package], 'deb/build', 'package-0.0.1.tar.gz') + '-h', '--hard-dereference', '-T', '-', '|', 'gzip >', File.join(config[:package], 'deb/build', 'package-0.0.1.tar.gz') ] FileUtils.mkdir_p(File.join(config[:package], 'deb', 'build')) expect(package).to receive(:sh).with("mkdir -p #{File.join(config[:package], 'deb', 'build')}")