summaryrefslogtreecommitdiff
path: root/lib/rake/packagetask.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rake/packagetask.rb')
-rw-r--r--lib/rake/packagetask.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/rake/packagetask.rb b/lib/rake/packagetask.rb
index 08c1a8c..029caa6 100644
--- a/lib/rake/packagetask.rb
+++ b/lib/rake/packagetask.rb
@@ -51,13 +51,16 @@ module Rake
# Directory used to store the package files (default is 'pkg').
attr_accessor :package_dir
- # True if a gzipped tar file (tgz) should be produced (default is false).
+ # True if a gzipped tar file (tgz) should be produced (default is
+ # false).
attr_accessor :need_tar
- # True if a gzipped tar file (tar.gz) should be produced (default is false).
+ # True if a gzipped tar file (tar.gz) should be produced (default
+ # is false).
attr_accessor :need_tar_gz
- # True if a bzip2'd tar file (tar.bz2) should be produced (default is false).
+ # True if a bzip2'd tar file (tar.bz2) should be produced (default
+ # is false).
attr_accessor :need_tar_bz2
# True if a zip file should be produced (default is false)
@@ -121,7 +124,8 @@ module Rake
].each do |(need, file, flag)|
if need
task :package => ["#{package_dir}/#{file}"]
- file "#{package_dir}/#{file}" => [package_dir_path] + package_files do
+ file "#{package_dir}/#{file}" =>
+ [package_dir_path] + package_files do
chdir(package_dir) do
sh %{#{@tar_command} #{flag}cvf #{file} #{package_name}}
end
@@ -131,7 +135,8 @@ module Rake
if need_zip
task :package => ["#{package_dir}/#{zip_file}"]
- file "#{package_dir}/#{zip_file}" => [package_dir_path] + package_files do
+ file "#{package_dir}/#{zip_file}" =>
+ [package_dir_path] + package_files do
chdir(package_dir) do
sh %{#{@zip_command} -r #{zip_file} #{package_name}}
end
@@ -145,7 +150,7 @@ module Rake
@package_files.each do |fn|
f = File.join(package_dir_path, fn)
fdir = File.dirname(f)
- mkdir_p(fdir) if !File.exist?(fdir)
+ mkdir_p(fdir) unless File.exist?(fdir)
if File.directory?(fn)
mkdir_p(f)
else