Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
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
Thomas Leymonerie
slapos.buildout
Commits
97626984
Commit
97626984
authored
Sep 02, 2013
by
Tres Seaver
Browse files
Options
Browse Files
Download
Plain Diff
Merge toumorokoshi-master.
parents
d75ff41f
682dd5a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
24 deletions
+33
-24
bootstrap/bootstrap.py
bootstrap/bootstrap.py
+33
-24
No files found.
bootstrap/bootstrap.py
View file @
97626984
...
...
@@ -56,6 +56,9 @@ parser.add_option("-c", "--config-file",
"file to be used."
))
parser
.
add_option
(
"-f"
,
"--find-links"
,
help
=
(
"Specify a URL to search for buildout releases"
))
parser
.
add_option
(
"--allow-site-packages"
,
action
=
"store_true"
,
default
=
False
,
help
=
(
"Let bootstrap.py use existing site packages"
))
options
,
args
=
parser
.
parse_args
()
...
...
@@ -63,32 +66,38 @@ options, args = parser.parse_args()
######################################################################
# load/install setuptools
to_reload
=
False
try
:
import
pkg_resources
import
setuptools
if
options
.
allow_site_packages
:
import
setuptools
import
pkg_resources
from
urllib.request
import
urlopen
except
ImportError
:
ez
=
{}
try
:
from
urllib.request
import
urlopen
except
ImportError
:
from
urllib2
import
urlopen
exec
(
urlopen
(
'https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py'
).
read
(),
ez
)
setup_args
=
dict
(
to_dir
=
tmpeggs
,
download_delay
=
0
)
ez
[
'use_setuptools'
](
**
setup_args
)
if
to_reload
:
reload
(
pkg_resources
)
import
pkg_resources
# This does not (always?) update the default working set. We will
# do it.
for
path
in
sys
.
path
:
if
path
not
in
pkg_resources
.
working_set
.
entries
:
pkg_resources
.
working_set
.
add_entry
(
path
)
from
urllib2
import
urlopen
ez
=
{}
exec
(
urlopen
(
'https://bitbucket.org/pypa/setuptools/downloads/ez_setup.py'
).
read
(),
ez
)
if
not
options
.
allow_site_packages
:
# ez_setup imports site, which adds site packages
# this will remove them from the path to ensure that incompatible versions
# of setuptools are not in the path
import
site
# inside a virtualenv, there is no 'getsitepackages'.
# We can't remove these reliably
if
hasattr
(
site
,
'getsitepackages'
):
for
sitepackage_path
in
site
.
getsitepackages
():
sys
.
path
[:]
=
[
x
for
x
in
sys
.
path
if
sitepackage_path
not
in
x
]
setup_args
=
dict
(
to_dir
=
tmpeggs
,
download_delay
=
0
)
ez
[
'use_setuptools'
](
**
setup_args
)
import
setuptools
import
pkg_resources
# This does not (always?) update the default working set. We will
# do it.
for
path
in
sys
.
path
:
if
path
not
in
pkg_resources
.
working_set
.
entries
:
pkg_resources
.
working_set
.
add_entry
(
path
)
######################################################################
# Install buildout
...
...
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