Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
2fbffe9b
Commit
2fbffe9b
authored
Feb 09, 2014
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace _extractall with the canonical TarFile.extractall.
parent
790486c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
44 deletions
+2
-44
ez_setup.py
ez_setup.py
+2
-44
No files found.
ez_setup.py
View file @
2fbffe9b
...
...
@@ -48,7 +48,7 @@ def _install(tarball, install_args=()):
try
:
os
.
chdir
(
tmpdir
)
tar
=
tarfile
.
open
(
tarball
)
_extractall
(
tar
)
tar
.
extractall
(
)
tar
.
close
()
# going in the directory
...
...
@@ -76,7 +76,7 @@ def _build_egg(egg, tarball, to_dir):
try
:
os
.
chdir
(
tmpdir
)
tar
=
tarfile
.
open
(
tarball
)
_extractall
(
tar
)
tar
.
extractall
(
)
tar
.
close
()
# going in the directory
...
...
@@ -285,48 +285,6 @@ def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
downloader
(
url
,
saveto
)
return
os
.
path
.
realpath
(
saveto
)
def
_extractall
(
self
,
path
=
"."
,
members
=
None
):
"""
Extract all members from the archive to the current working
directory and set owner, modification time and permissions on
directories afterwards. `path' specifies a different directory
to extract to. `members' is optional and must be a subset of the
list returned by getmembers().
"""
import
copy
import
operator
from
tarfile
import
ExtractError
directories
=
[]
if
members
is
None
:
members
=
self
for
tarinfo
in
members
:
if
tarinfo
.
isdir
():
# Extract directories with a safe mode.
directories
.
append
(
tarinfo
)
tarinfo
=
copy
.
copy
(
tarinfo
)
tarinfo
.
mode
=
448
# decimal for oct 0700
self
.
extract
(
tarinfo
,
path
)
# Reverse sort directories.
directories
.
sort
(
key
=
operator
.
attrgetter
(
'name'
),
reverse
=
True
)
# Set correct owner, mtime and filemode on directories.
for
tarinfo
in
directories
:
dirpath
=
os
.
path
.
join
(
path
,
tarinfo
.
name
)
try
:
self
.
chown
(
tarinfo
,
dirpath
)
self
.
utime
(
tarinfo
,
dirpath
)
self
.
chmod
(
tarinfo
,
dirpath
)
except
ExtractError
as
e
:
if
self
.
errorlevel
>
1
:
raise
else
:
self
.
_dbg
(
1
,
"tarfile: %s"
%
e
)
def
_build_install_args
(
options
):
"""
Build the arguments to 'python setup.py install' on the setuptools package
...
...
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