BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
5908bdf3
Commit
5908bdf3
authored
Apr 28, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing a few tar issues - and using gnu tar only
parent
cec4ae55
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
command_line_util.rb
lib/gitlab/import_export/command_line_util.rb
+10
-4
importer.rb
lib/gitlab/import_export/importer.rb
+1
-1
repo_restorer.rb
lib/gitlab/import_export/repo_restorer.rb
+1
-1
No files found.
lib/gitlab/import_export/command_line_util.rb
View file @
5908bdf3
...
...
@@ -5,12 +5,12 @@ module Gitlab
tar_with_options
(
archive:
archive
,
dir:
dir
,
options:
'cf'
)
end
def
untar_
cz
f
(
archive
:,
dir
:)
tar_with_options
(
archive:
archive
,
dir:
dir
,
options:
'cz
f'
)
def
untar_
zx
f
(
archive
:,
dir
:)
untar_with_options
(
archive:
archive
,
dir:
dir
,
options:
'zx
f'
)
end
def
untar_cf
(
archive
:,
dir
:)
tar_with_options
(
archive:
archive
,
dir:
dir
,
options:
'c
f'
)
def
untar_c
z
f
(
archive
:,
dir
:)
untar_with_options
(
archive:
archive
,
dir:
dir
,
options:
'x
f'
)
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
lib/gitlab/import_export/importer.rb
View file @
5908bdf3
...
...
@@ -20,7 +20,7 @@ module Gitlab
private
def
decompress_archive
untar_
cz
f
(
archive:
@archive_file
,
dir:
@storage_path
)
untar_
zx
f
(
archive:
@archive_file
,
dir:
@storage_path
)
end
end
end
...
...
lib/gitlab/import_export/repo_restorer.rb
View file @
5908bdf3
...
...
@@ -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_c
z
f
(
archive:
@path
,
dir:
path_to_repo
)
end
private
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment