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
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
Xavier Thompson
slapos.rebootstrap
Commits
fc7b9c40
Commit
fc7b9c40
authored
Apr 16, 2024
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP
parent
8a706982
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
+23
-8
setup.py
setup.py
+1
-5
slapos/rebootstrap/__init__.py
slapos/rebootstrap/__init__.py
+22
-3
No files found.
setup.py
View file @
fc7b9c40
...
...
@@ -38,13 +38,9 @@ setup(
namespace_packages
=
[
'slapos'
],
packages
=
find_packages
(),
zip_safe
=
True
,
dependency_links
=
[
#'http://www.nexedi.org/static/packages/source/slapos.buildout/',
'https://softinst182198.host.vifib.net/public/'
,
],
install_requires
=
[
'setuptools'
,
'zc.buildout
==3.0.1+slapos002
'
,
'zc.buildout'
,
],
extras_require
=
extras_require
,
tests_require
=
extras_require
[
'test'
],
...
...
slapos/rebootstrap/__init__.py
View file @
fc7b9c40
...
...
@@ -17,7 +17,16 @@ import pkg_resources
from
zc.buildout
import
easy_install
,
UserError
def
get_paths
():
class
FakeSysExecutable
(
object
):
def
__init__
(
self
,
python
):
self
.
executable
=
python
def
__getattr__
(
self
,
attr
):
return
getattr
(
sys
,
attr
)
def
get_requirements
():
specs
=
[
'setuptools'
,
'zc.buildout'
,
'wheel'
,
'pip'
]
try
:
import
slapos.libnetworkcache
...
...
@@ -25,7 +34,16 @@ def get_paths():
pass
else
:
specs
.
append
(
'slapos.libnetworkcache'
)
return
[
pkg_resources
.
get_distribution
(
spec
).
location
for
spec
in
specs
]
return
specs
def
get_distributions
():
return
map
(
pkg_resources
.
get_distribution
,
get_requirements
())
def
get_paths
():
paths
=
set
(
dist
.
location
for
dist
in
get_distributions
())
return
[
path
for
path
in
sys
.
path
if
path
in
paths
]
def
setup_script
(
path
,
python
=
sys
.
executable
):
...
...
@@ -107,12 +125,13 @@ Buildout will be restarted automatically to have this change applied.
shutil
.
move
(
installed
,
installed
+
'-old'
)
try
:
paths
=
get_paths
()
args
=
[
arg
for
arg
in
sys
.
argv
if
arg
.
startswith
(
'buildout:'
)]
subprocess
.
check_call
(
[
self
.
wanted_python
,
'-c'
,
"import sys ; sys.path[0:0]=%r ; "
"import zc.buildout.buildout ; "
"sys.argv[1:1]=%r ; "
"zc.buildout.buildout.main()"
%
(
paths
,
[
'bootstrap'
])])
"zc.buildout.buildout.main()"
%
(
paths
,
args
+
[
'bootstrap'
])])
except
subprocess
.
CalledProcessError
:
shutil
.
move
(
installed
+
'-old'
,
installed
)
raise
...
...
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