提交 5908bdf3 编写于 作者: J James Lopez

fixing a few tar issues - and using gnu tar only

上级 cec4ae55
......@@ -5,12 +5,12 @@ module Gitlab
tar_with_options(archive: archive, dir: dir, options: 'cf')
end
def untar_czf(archive:, dir:)
tar_with_options(archive: archive, dir: dir, options: 'czf')
def untar_zxf(archive:, dir:)
untar_with_options(archive: archive, dir: dir, options: 'zxf')
end
def untar_cf(archive:, dir:)
tar_with_options(archive: archive, dir: dir, options: 'cf')
def untar_czf(archive:, dir:)
untar_with_options(archive: archive, dir: dir, options: 'xf')
end
def tar_czf(archive:, dir:)
......@@ -28,6 +28,12 @@ module Gitlab
_output, status = Gitlab::Popen.popen(cmd)
status.zero?
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
......@@ -20,7 +20,7 @@ module Gitlab
private
def decompress_archive
untar_czf(archive: @archive_file, dir: @storage_path)
untar_zxf(archive: @archive_file, dir: @storage_path)
end
end
end
......
......@@ -14,7 +14,7 @@ module Gitlab
FileUtils.mkdir_p(repos_path)
FileUtils.mkdir_p(path_to_repo)
untar_cf(archive: @path, dir: path_to_repo)
untar_czf(archive: @path, dir: path_to_repo)
end
private
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册