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
8
Merge Requests
8
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
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
Show 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):
# Create buildout script
ws
=
pkg_resources
.
WorkingSet
(
entries
)
ws
.
require
(
'zc.buildout'
)
zc
.
buildout
.
easy_install
.
scripts
(
[
'zc.buildout'
],
ws
,
options
[
'executable'
],
options
[
'bin-directory'
])
partsdir
=
os
.
path
.
join
(
options
[
'parts-directory'
],
'buildout'
)
os
.
mkdir
(
partsdir
)
zc
.
buildout
.
easy_install
.
sitepackage_safe_scripts
(
options
[
'bin-directory'
],
ws
,
options
[
'executable'
],
partsdir
,
reqs
=
[
'zc.buildout'
])
init
=
bootstrap
...
...
src/zc/buildout/buildout.txt
View file @
243bd1c4
...
...
@@ -56,10 +56,9 @@ The bin directory contains scripts.
- setuptools-0.6-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, 'parts')
The develop-eggs directory holds egg links for software being
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
allows larger buildouts to be set up much more quickly and saves disk
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
part data. For example, if we built a custom Python, we would
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):
return
(
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
(
sample_buildout
=
sample
,
ls
=
ls
,
...
...
@@ -397,7 +384,6 @@ def buildoutSetUp(test):
tmpdir
=
tmpdir
,
write
=
write
,
system
=
system
,
do_build
=
do_build
,
call_py
=
call_py
,
get
=
get
,
cd
=
(
lambda
*
path
:
os
.
chdir
(
os
.
path
.
join
(
*
path
))),
...
...
@@ -405,7 +391,7 @@ def buildoutSetUp(test):
sdist
=
sdist
,
bdist_egg
=
bdist_egg
,
start_server
=
start_server
,
buildout
=
buildout
,
buildout
=
os
.
path
.
join
(
sample
,
'bin'
,
'buildout'
)
,
wait_until
=
wait_until
,
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:"
indicate the eggs from site-packages that have been selected. You'll see
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'.
We have a develop egg: zc.buildout V
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.)
... eggs = demoneeded
... ''' % globals())
>>> print
do_build(python=py_path
)
>>> print
system(buildout
)
Creating directory '/sample-buildout/tmpeggs'.
Uninstalling py.
Installing eggs.
...
...
@@ -354,10 +354,11 @@ is not allowed to come from site-packages, and the buildout fails.
... allowed-eggs-from-site-packages =
... eggs = demoneeded
... ''' % globals())
>>> print
do_build(python=py_path
)
>>> print
system(buildout
)
Creating directory '/sample-buildout/tmpeggs'.
Uninstalling eggs.
Installing eggs.
Couldn't find index page for 'demoneeded' (maybe misspelled?)
Getting distribution for 'demoneeded'.
While:
Installing eggs.
...
...
@@ -458,6 +459,7 @@ Note that the parts/py directory has been cleaned up, and parts/python has
been created.
>>> ls(sample_buildout, 'parts')
d buildout
d demo
d python
...
...
z3c.recipe.scripts_/src/z3c/recipe/scripts/tests.py
View file @
243bd1c4
...
...
@@ -267,7 +267,7 @@ The eggs are not found.
... python = primed_python
... eggs = demoneeded
... ''' % globals())
>>> print
do_build(python=py_path
)
>>> print
system(buildout
)
Installing eggs.
Couldn't find index page for 'demoneeded' (maybe misspelled?)
Getting distribution for 'demoneeded'.
...
...
@@ -297,7 +297,7 @@ they are in the executable's path.
... eggs = demoneeded
... ''' % globals())
>>> print
do_build(python=py_path
)
>>> print
system(buildout
)
Installing eggs.
<BLANKLINE>
...
...
@@ -315,7 +315,7 @@ We get an error if we specify anything but true or false:
... eggs = other
... ''' % globals())
>>> print
do_build(python=py_path
)
>>> print
system(buildout
)
While:
Installing.
Getting section eggs.
...
...
@@ -357,7 +357,7 @@ correctly parse a single-line value.
... eggs = demoneeded
... ''' % globals())
>>> print
do_build(python=py_path
)
>>> print
system(buildout
)
Installing eggs.
<BLANKLINE>
...
...
@@ -383,7 +383,7 @@ parse a multi-line value.
... eggs = demoneeded
... ''' % globals())
>>> print
do_build(python=py_path
)
>>> print
system(buildout
)
Uninstalling eggs.
Installing eggs.
<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