BigW Consortium Gitlab

Commit 5908bdf3 by James Lopez

fixing a few tar issues - and using gnu tar only

parent cec4ae55
...@@ -5,12 +5,12 @@ module Gitlab ...@@ -5,12 +5,12 @@ module Gitlab
tar_with_options(archive: archive, dir: dir, options: 'cf') tar_with_options(archive: archive, dir: dir, options: 'cf')
end end
def untar_czf(archive:, dir:) def untar_zxf(archive:, dir:)
tar_with_options(archive: archive, dir: dir, options: 'czf') untar_with_options(archive: archive, dir: dir, options: 'zxf')
end end
def untar_cf(archive:, dir:) def untar_czf(archive:, dir:)
tar_with_options(archive: archive, dir: dir, options: 'cf') untar_with_options(archive: archive, dir: dir, options: 'xf')
end end
def tar_czf(archive:, dir:) def tar_czf(archive:, dir:)
...@@ -28,6 +28,12 @@ module Gitlab ...@@ -28,6 +28,12 @@ module Gitlab
_output, status = Gitlab::Popen.popen(cmd) _output, status = Gitlab::Popen.popen(cmd)
status.zero? status.zero?
end end
def untar_with_options(archive:, dir:, options:)
cmd = %W(tar -#{options} #{archive} -C #{dir})
_output, status = Gitlab::Popen.popen(cmd)
status.zero?
end
end end
end end
end end
...@@ -20,7 +20,7 @@ module Gitlab ...@@ -20,7 +20,7 @@ module Gitlab
private private
def decompress_archive def decompress_archive
untar_czf(archive: @archive_file, dir: @storage_path) untar_zxf(archive: @archive_file, dir: @storage_path)
end end
end end
end end
......
...@@ -14,7 +14,7 @@ module Gitlab ...@@ -14,7 +14,7 @@ module Gitlab
FileUtils.mkdir_p(repos_path) FileUtils.mkdir_p(repos_path)
FileUtils.mkdir_p(path_to_repo) FileUtils.mkdir_p(path_to_repo)
untar_cf(archive: @path, dir: path_to_repo) untar_czf(archive: @path, dir: path_to_repo)
end end
private private
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment