Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
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
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
lib/gitlab/import_export/command_line_util.rb
lib/gitlab/import_export/command_line_util.rb
+10
-4
lib/gitlab/import_export/importer.rb
lib/gitlab/import_export/importer.rb
+1
-1
lib/gitlab/import_export/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
...
@@ -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_
cz
f
(
archive
:,
dir
:)
def
untar_
zx
f
(
archive
:,
dir
:)
tar_with_options
(
archive:
archive
,
dir:
dir
,
options:
'cz
f'
)
untar_with_options
(
archive:
archive
,
dir:
dir
,
options:
'zx
f'
)
end
end
def
untar_cf
(
archive
:,
dir
:)
def
untar_c
z
f
(
archive
:,
dir
:)
tar_with_options
(
archive:
archive
,
dir:
dir
,
options:
'c
f'
)
untar_with_options
(
archive:
archive
,
dir:
dir
,
options:
'x
f'
)
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
lib/gitlab/import_export/importer.rb
View file @
5908bdf3
...
@@ -20,7 +20,7 @@ module Gitlab
...
@@ -20,7 +20,7 @@ module Gitlab
private
private
def
decompress_archive
def
decompress_archive
untar_
cz
f
(
archive:
@archive_file
,
dir:
@storage_path
)
untar_
zx
f
(
archive:
@archive_file
,
dir:
@storage_path
)
end
end
end
end
end
end
...
...
lib/gitlab/import_export/repo_restorer.rb
View file @
5908bdf3
...
@@ -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_c
z
f
(
archive:
@path
,
dir:
path_to_repo
)
end
end
private
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