Skip to content

Commit

Permalink
Improve source file generation
Browse files Browse the repository at this point in the history
This guarantees the file is actually freshly generated and outputs the
generated filename. This avoids the need to glob.
  • Loading branch information
ekohl authored and mmoll committed Mar 15, 2019
1 parent 002af7b commit 6dcf5bf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,13 @@ namespace :pkg do
task :generate_source => [PKGDIR, "#{BUILDDIR}/modules"] do
version = File.read('VERSION').chomp
raise "can't find VERSION" if version.length == 0
filename = "#{PKGDIR}/foreman-installer-#{version}.tar.bz2"
File.unlink(filename) if File.exist?(filename)
Dir.chdir(BUILDDIR) { `tar -cf #{BUILDDIR}/modules.tar --exclude-vcs --exclude=spec --transform=s,^,foreman-installer-#{version}/, modules/` }
`git archive --prefix=foreman-installer-#{version}/ HEAD > #{PKGDIR}/foreman-installer-#{version}.tar`
`tar --concatenate --file=#{PKGDIR}/foreman-installer-#{version}.tar #{BUILDDIR}/modules.tar`
`bzip2 -9 #{PKGDIR}/foreman-installer-#{version}.tar`
puts filename
end
end

Expand Down

0 comments on commit 6dcf5bf

Please sign in to comment.