Skip to content

Commit

Permalink
Fix handling of symlinks when creating tar file
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock committed Apr 17, 2024
1 parent 0820ac2 commit 50b53f6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
ood_packaging (0.14.0)
ood_packaging (0.14.1)
rake (~> 13.0.1)

GEM
Expand Down
2 changes: 1 addition & 1 deletion lib/ood_packaging/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def tar!
end
tar_file = "#{dir}/#{tar_name}.tar.gz"
cmd.concat ["--transform 's,^,#{tar_name}/,'"]
cmd.concat ['-T', '-', '|', "gzip > #{tar_file}"]
cmd.concat ['-h', '-T', '-', '|', "gzip > #{tar_file}"]

sh "rm #{tar_file}" if File.exist?(tar_file)
puts "Create tar archive #{tar_file}".blue
Expand Down
2 changes: 1 addition & 1 deletion lib/ood_packaging/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Version code for OodPackaging
module OodPackaging
VERSION = '0.14.0'
VERSION = '0.14.1'
PACKAGE_VERSION = {
'ondemand-release' => {
'(ubuntu|debian)' => '3.1.1',
Expand Down
6 changes: 3 additions & 3 deletions spec/ood_packaging/package_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
expected_cmd = [
'git', 'ls-files', '.', '|', 'tar', '-c',
"--transform 's,^,package-0.0.1/,'",
'-T', '-', '|', 'gzip >', File.join(config[:package], 'packaging/rpm', 'package-0.0.1.tar.gz')
'-h', '-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!
Expand All @@ -93,7 +93,7 @@
'git', 'ls-files', '.', '|', 'tar', '-c',
"--transform 'flags=r;s,packaging/deb,debian,'",
"--transform 's,^,package-0.0.1/,'",
'-T', '-', '|', 'gzip >', File.join(config[:package], 'build', 'package-0.0.1.tar.gz')
'-h', '-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')}")
Expand All @@ -107,7 +107,7 @@
'git', 'ls-files', '.', '|', 'tar', '-c',
"--transform 'flags=r;s,packaging/deb,debian,'",
"--transform 's,^,package-0.0.1/,'",
'-T', '-', '|', 'gzip >', File.join(config[:package], 'deb/build', 'package-0.0.1.tar.gz')
'-h', '-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')}")
Expand Down

0 comments on commit 50b53f6

Please sign in to comment.