Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.rebootstrap
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.rebootstrap
Commits
531bb6a1
Commit
531bb6a1
authored
Mar 13, 2024
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support installing setuptools from .tar.gz
In addition to already supported .zip archives
parent
74b18622
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
slapos/rebootstrap/bootstrap.py
slapos/rebootstrap/bootstrap.py
+11
-5
No files found.
slapos/rebootstrap/bootstrap.py
View file @
531bb6a1
import
os
,
sys
import
errno
,
os
,
sys
class
FakeSysExecutable
(
object
):
...
...
@@ -36,15 +36,21 @@ def setup_script(path, python=sys.executable):
easy_install
.
sys
=
sys
def
main
():
import
shutil
,
subprocess
,
tempfile
,
zipfile
import
shutil
,
subprocess
,
t
arfile
,
t
empfile
,
zipfile
eggs_dir
=
sys
.
argv
[
2
]
cache
=
sys
.
argv
[
3
]
base
=
os
.
path
.
join
(
cache
,
sys
.
argv
[
4
].
replace
(
'=='
,
'-'
))
# Install setuptools.
src
=
os
.
path
.
join
(
cache
,
sys
.
argv
[
4
].
replace
(
'=='
,
'-'
)
+
'.zip'
)
tmp
=
tempfile
.
mkdtemp
()
try
:
with
zipfile
.
ZipFile
(
src
)
as
zip_file
:
zip_file
.
extractall
(
tmp
)
try
:
with
zipfile
.
ZipFile
(
base
+
'.zip'
)
as
zip_file
:
zip_file
.
extractall
(
tmp
)
except
IOError
as
e
:
if
e
.
errno
!=
errno
.
ENOENT
:
raise
with
tarfile
.
open
(
base
+
'.tar.gz'
)
as
tar_file
:
tar_file
.
extractall
(
tmp
)
src
,
=
os
.
listdir
(
tmp
)
subprocess
.
check_call
((
sys
.
executable
,
'setup.py'
,
'-q'
,
'bdist_egg'
,
'--dist-dir'
,
tmp
),
cwd
=
os
.
path
.
join
(
tmp
,
src
))
...
...
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