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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.buildout
Commits
243bd1c4
Commit
243bd1c4
authored
Feb 24, 2010
by
Gary Poster
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make the buildout script itself safe for a Python with site packages.
parent
49f0fd01
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
28 deletions
+23
-28
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+5
-3
src/zc/buildout/buildout.txt
src/zc/buildout/buildout.txt
+7
-2
src/zc/buildout/testing.py
src/zc/buildout/testing.py
+1
-15
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+1
-1
z3c.recipe.scripts_/src/z3c/recipe/scripts/README.txt
z3c.recipe.scripts_/src/z3c/recipe/scripts/README.txt
+4
-2
z3c.recipe.scripts_/src/z3c/recipe/scripts/tests.py
z3c.recipe.scripts_/src/z3c/recipe/scripts/tests.py
+5
-5
No files found.
src/zc/buildout/buildout.py
View file @
243bd1c4
...
@@ -391,9 +391,11 @@ class Buildout(UserDict.DictMixin):
...
@@ -391,9 +391,11 @@ class Buildout(UserDict.DictMixin):
# Create buildout script
# Create buildout script
ws
=
pkg_resources
.
WorkingSet
(
entries
)
ws
=
pkg_resources
.
WorkingSet
(
entries
)
ws
.
require
(
'zc.buildout'
)
ws
.
require
(
'zc.buildout'
)
zc
.
buildout
.
easy_install
.
scripts
(
partsdir
=
os
.
path
.
join
(
options
[
'parts-directory'
],
'buildout'
)
[
'zc.buildout'
],
ws
,
options
[
'executable'
],
os
.
mkdir
(
partsdir
)
options
[
'bin-directory'
])
zc
.
buildout
.
easy_install
.
sitepackage_safe_scripts
(
options
[
'bin-directory'
],
ws
,
options
[
'executable'
],
partsdir
,
reqs
=
[
'zc.buildout'
])
init
=
bootstrap
init
=
bootstrap
...
...
src/zc/buildout/buildout.txt
View file @
243bd1c4
...
@@ -56,10 +56,9 @@ The bin directory contains scripts.
...
@@ -56,10 +56,9 @@ The bin directory contains scripts.
- setuptools-0.6-py2.4.egg
- setuptools-0.6-py2.4.egg
- zc.buildout-1.0-py2.4.egg
- zc.buildout-1.0-py2.4.egg
The develop-eggs
and parts directories are
initially empty:
The develop-eggs
directory is
initially empty:
>>> ls(sample_buildout, 'develop-eggs')
>>> ls(sample_buildout, 'develop-eggs')
>>> ls(sample_buildout, 'parts')
The develop-eggs directory holds egg links for software being
The develop-eggs directory holds egg links for software being
developed in the buildout. We separate develop-eggs and other eggs to
developed in the buildout. We separate develop-eggs and other eggs to
...
@@ -69,6 +68,12 @@ directory in their home that all non-develop eggs are stored in. This
...
@@ -69,6 +68,12 @@ directory in their home that all non-develop eggs are stored in. This
allows larger buildouts to be set up much more quickly and saves disk
allows larger buildouts to be set up much more quickly and saves disk
space.
space.
The parts directory just contains some helpers for the buildout script
itself.
>>> ls(sample_buildout, 'parts')
d buildout
The parts directory provides an area where recipes can install
The parts directory provides an area where recipes can install
part data. For example, if we built a custom Python, we would
part data. For example, if we built a custom Python, we would
install it in the part directory. Part data is stored in a
install it in the part directory. Part data is stored in a
...
...
src/zc/buildout/testing.py
View file @
243bd1c4
...
@@ -374,19 +374,6 @@ def buildoutSetUp(test):
...
@@ -374,19 +374,6 @@ def buildoutSetUp(test):
return
(
return
(
os
.
path
.
join
(
buildout
,
'bin'
,
'py'
),
site_packages_dir
)
os
.
path
.
join
(
buildout
,
'bin'
,
'py'
),
site_packages_dir
)
buildout
=
os
.
path
.
join
(
sample
,
'bin'
,
'buildout'
)
def
do_build
(
buildout
=
buildout
,
python
=
None
,
args
=
()):
if
python
is
None
:
return
system
(
buildout
)
if
sys
.
platform
==
'win32'
:
# We need to find the "real" script.
buildout
+=
'-script.py'
cmd
=
[
python
,
buildout
]
cmd
.
extend
(
args
)
return
system
(
zc
.
buildout
.
easy_install
.
_safe_arg
(
' '
.
join
(
zc
.
buildout
.
easy_install
.
_safe_arg
(
arg
)
for
arg
in
cmd
)))
test
.
globs
.
update
(
dict
(
test
.
globs
.
update
(
dict
(
sample_buildout
=
sample
,
sample_buildout
=
sample
,
ls
=
ls
,
ls
=
ls
,
...
@@ -397,7 +384,6 @@ def buildoutSetUp(test):
...
@@ -397,7 +384,6 @@ def buildoutSetUp(test):
tmpdir
=
tmpdir
,
tmpdir
=
tmpdir
,
write
=
write
,
write
=
write
,
system
=
system
,
system
=
system
,
do_build
=
do_build
,
call_py
=
call_py
,
call_py
=
call_py
,
get
=
get
,
get
=
get
,
cd
=
(
lambda
*
path
:
os
.
chdir
(
os
.
path
.
join
(
*
path
))),
cd
=
(
lambda
*
path
:
os
.
chdir
(
os
.
path
.
join
(
*
path
))),
...
@@ -405,7 +391,7 @@ def buildoutSetUp(test):
...
@@ -405,7 +391,7 @@ def buildoutSetUp(test):
sdist
=
sdist
,
sdist
=
sdist
,
bdist_egg
=
bdist_egg
,
bdist_egg
=
bdist_egg
,
start_server
=
start_server
,
start_server
=
start_server
,
buildout
=
buildout
,
buildout
=
os
.
path
.
join
(
sample
,
'bin'
,
'buildout'
)
,
wait_until
=
wait_until
,
wait_until
=
wait_until
,
make_py
=
make_py
make_py
=
make_py
))
))
...
...
src/zc/buildout/tests.py
View file @
243bd1c4
...
@@ -420,7 +420,7 @@ Now here is the output. The lines that begin with "Egg from site-packages:"
...
@@ -420,7 +420,7 @@ Now here is the output. The lines that begin with "Egg from site-packages:"
indicate the eggs from site-packages that have been selected. You'll see
indicate the eggs from site-packages that have been selected. You'll see
we have two: demo 0.3 and demoneeded 1.1.
we have two: demo 0.3 and demoneeded 1.1.
>>> print
do_build(python=py_path, args=['-v']
)
>>> print
system(buildout+" -v"
)
Installing 'zc.buildout', 'setuptools'.
Installing 'zc.buildout', 'setuptools'.
We have a develop egg: zc.buildout V
We have a develop egg: zc.buildout V
We have the best distribution that satisfies 'setuptools'.
We have the best distribution that satisfies 'setuptools'.
...
...
z3c.recipe.scripts_/src/z3c/recipe/scripts/README.txt
View file @
243bd1c4
...
@@ -325,7 +325,7 @@ document do not affect this example.)
...
@@ -325,7 +325,7 @@ document do not affect this example.)
... eggs = demoneeded
... eggs = demoneeded
... ''' % globals())
... ''' % globals())
>>> print
do_build(python=py_path
)
>>> print
system(buildout
)
Creating directory '/sample-buildout/tmpeggs'.
Creating directory '/sample-buildout/tmpeggs'.
Uninstalling py.
Uninstalling py.
Installing eggs.
Installing eggs.
...
@@ -354,10 +354,11 @@ is not allowed to come from site-packages, and the buildout fails.
...
@@ -354,10 +354,11 @@ is not allowed to come from site-packages, and the buildout fails.
... allowed-eggs-from-site-packages =
... allowed-eggs-from-site-packages =
... eggs = demoneeded
... eggs = demoneeded
... ''' % globals())
... ''' % globals())
>>> print
do_build(python=py_path
)
>>> print
system(buildout
)
Creating directory '/sample-buildout/tmpeggs'.
Creating directory '/sample-buildout/tmpeggs'.
Uninstalling eggs.
Uninstalling eggs.
Installing eggs.
Installing eggs.
Couldn't find index page for 'demoneeded' (maybe misspelled?)
Getting distribution for 'demoneeded'.
Getting distribution for 'demoneeded'.
While:
While:
Installing eggs.
Installing eggs.
...
@@ -458,6 +459,7 @@ Note that the parts/py directory has been cleaned up, and parts/python has
...
@@ -458,6 +459,7 @@ Note that the parts/py directory has been cleaned up, and parts/python has
been created.
been created.
>>> ls(sample_buildout, 'parts')
>>> ls(sample_buildout, 'parts')
d buildout
d demo
d demo
d python
d python
...
...
z3c.recipe.scripts_/src/z3c/recipe/scripts/tests.py
View file @
243bd1c4
...
@@ -267,7 +267,7 @@ The eggs are not found.
...
@@ -267,7 +267,7 @@ The eggs are not found.
... python = primed_python
... python = primed_python
... eggs = demoneeded
... eggs = demoneeded
... ''' % globals())
... ''' % globals())
>>> print
do_build(python=py_path
)
>>> print
system(buildout
)
Installing eggs.
Installing eggs.
Couldn't find index page for 'demoneeded' (maybe misspelled?)
Couldn't find index page for 'demoneeded' (maybe misspelled?)
Getting distribution for 'demoneeded'.
Getting distribution for 'demoneeded'.
...
@@ -297,7 +297,7 @@ they are in the executable's path.
...
@@ -297,7 +297,7 @@ they are in the executable's path.
... eggs = demoneeded
... eggs = demoneeded
... ''' % globals())
... ''' % globals())
>>> print
do_build(python=py_path
)
>>> print
system(buildout
)
Installing eggs.
Installing eggs.
<BLANKLINE>
<BLANKLINE>
...
@@ -315,7 +315,7 @@ We get an error if we specify anything but true or false:
...
@@ -315,7 +315,7 @@ We get an error if we specify anything but true or false:
... eggs = other
... eggs = other
... ''' % globals())
... ''' % globals())
>>> print
do_build(python=py_path
)
>>> print
system(buildout
)
While:
While:
Installing.
Installing.
Getting section eggs.
Getting section eggs.
...
@@ -357,7 +357,7 @@ correctly parse a single-line value.
...
@@ -357,7 +357,7 @@ correctly parse a single-line value.
... eggs = demoneeded
... eggs = demoneeded
... ''' % globals())
... ''' % globals())
>>> print
do_build(python=py_path
)
>>> print
system(buildout
)
Installing eggs.
Installing eggs.
<BLANKLINE>
<BLANKLINE>
...
@@ -383,7 +383,7 @@ parse a multi-line value.
...
@@ -383,7 +383,7 @@ parse a multi-line value.
... eggs = demoneeded
... eggs = demoneeded
... ''' % globals())
... ''' % globals())
>>> print
do_build(python=py_path
)
>>> print
system(buildout
)
Uninstalling eggs.
Uninstalling eggs.
Installing eggs.
Installing eggs.
<BLANKLINE>
<BLANKLINE>
...
...
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