Permalink
Browse files

Fix tarball creation in the build process

* add -z to tar to compress the file (to match the name)
* Use rsync instead of cp -r to exclude directories/files from the tarball.
* Fix noisy_system
  • Loading branch information...
1 parent 65f4297 commit 37f1db8b25b254a0cfc41df983a0bfa793bb23fe @erikogan erikogan committed Dec 2, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 build/rpm.rb
View
@@ -30,7 +30,7 @@ def sources_dir
end
def noisy_system(*args)
- puts args.join ' ' if @verbosity > 0
+ puts(args.join) ' ' if @verbosity > 0
system(*args)
end
@@ -40,8 +40,8 @@ def create_tarball(verbosity = 0)
FileUtils.rm_rf(working_dir, :verbose => verbosity > 0)
begin
FileUtils.mkdir_p("#{working_dir}/#{sub_dir}", :verbose => verbosity > 0)
- FileUtils.cp_r('.', "#{working_dir}/#{sub_dir}", :verbose => verbosity > 0)
- noisy_system('tar', "c#{verbosity >= 2 ? 'v' : ''}", "-C", working_dir, '-f', "#{sources_dir}/#{sub_dir}.tar.gz", sub_dir)
+ noisy_system(*(%w{rsync -ra --exclude=.git --exclude=rpm/pkg --exclude=rpm/yum-repo --exclude=*.o --exclude=*.so} + (@verbosity > 2 ? %w{-v} : []) + (@verbosity > 3 ? %w{--progress} : []) + ['.', "#{working_dir}/#{sub_dir}/."] ))
+ noisy_system('tar', "cz#{verbosity >= 2 ? 'v' : ''}", "-C", working_dir, '-f', "#{sources_dir}/#{sub_dir}.tar.gz", sub_dir)
ensure
FileUtils.rm_rf("#{working_dir}", :verbose => verbosity > 0)
end

0 comments on commit 37f1db8

Please sign in to comment.