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
Nicolas Wavrant
slapos.buildout
Commits
c6772294
Commit
c6772294
authored
Feb 18, 2013
by
pombredanne
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'buildout/master' into header_expressions
parents
937537a4
8c13789c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
20 deletions
+71
-20
CHANGES.rst
CHANGES.rst
+3
-1
bootstrap/bootstrap.py
bootstrap/bootstrap.py
+14
-7
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+12
-2
src/zc/buildout/easy_install.txt
src/zc/buildout/easy_install.txt
+9
-0
src/zc/buildout/repeatable.txt
src/zc/buildout/repeatable.txt
+17
-10
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+16
-0
No files found.
CHANGES.rst
View file @
c6772294
Change History
Change History
**************
**************
2.0.1 (2013-02-1
4
)
2.0.1 (2013-02-1
6
)
==================
==================
- Fixed: buildout didn't honor umask settings when creating scripts.
- Fix for distutils scripts installation on Python 3, related to
- Fix for distutils scripts installation on Python 3, related to
``__pycache__`` directories.
``__pycache__`` directories.
...
...
bootstrap/bootstrap.py
View file @
c6772294
...
@@ -18,7 +18,11 @@ The script accepts buildout command-line options, so you can
...
@@ -18,7 +18,11 @@ The script accepts buildout command-line options, so you can
use the -c option to specify an alternate configuration file.
use the -c option to specify an alternate configuration file.
"""
"""
import
os
,
shutil
,
sys
,
tempfile
import
os
import
shutil
import
sys
import
tempfile
from
optparse
import
OptionParser
from
optparse
import
OptionParser
tmpeggs
=
tempfile
.
mkdtemp
()
tmpeggs
=
tempfile
.
mkdtemp
()
...
@@ -61,7 +65,8 @@ options, args = parser.parse_args()
...
@@ -61,7 +65,8 @@ options, args = parser.parse_args()
to_reload
=
False
to_reload
=
False
try
:
try
:
import
pkg_resources
,
setuptools
import
pkg_resources
import
setuptools
if
not
hasattr
(
pkg_resources
,
'_distribute'
):
if
not
hasattr
(
pkg_resources
,
'_distribute'
):
to_reload
=
True
to_reload
=
True
raise
ImportError
raise
ImportError
...
@@ -73,7 +78,8 @@ except ImportError:
...
@@ -73,7 +78,8 @@ except ImportError:
except
ImportError
:
except
ImportError
:
from
urllib2
import
urlopen
from
urllib2
import
urlopen
exec
(
urlopen
(
'http://python-distribute.org/distribute_setup.py'
).
read
(),
ez
)
exec
(
urlopen
(
'http://python-distribute.org/distribute_setup.py'
).
read
(),
ez
)
setup_args
=
dict
(
to_dir
=
tmpeggs
,
download_delay
=
0
,
no_fake
=
True
)
setup_args
=
dict
(
to_dir
=
tmpeggs
,
download_delay
=
0
,
no_fake
=
True
)
ez
[
'use_setuptools'
](
**
setup_args
)
ez
[
'use_setuptools'
](
**
setup_args
)
...
@@ -113,6 +119,7 @@ if version is None and not options.accept_buildout_test_releases:
...
@@ -113,6 +119,7 @@ if version is None and not options.accept_buildout_test_releases:
# Figure out the most recent final version of zc.buildout.
# Figure out the most recent final version of zc.buildout.
import
setuptools.package_index
import
setuptools.package_index
_final_parts
=
'*final-'
,
'*final'
_final_parts
=
'*final-'
,
'*final'
def
_final_version
(
parsed_version
):
def
_final_version
(
parsed_version
):
for
part
in
parsed_version
:
for
part
in
parsed_version
:
if
(
part
[:
1
]
==
'*'
)
and
(
part
not
in
_final_parts
):
if
(
part
[:
1
]
==
'*'
)
and
(
part
not
in
_final_parts
):
...
...
src/zc/buildout/easy_install.py
View file @
c6772294
...
@@ -117,6 +117,16 @@ def call_subprocess(args, **kw):
...
@@ -117,6 +117,16 @@ def call_subprocess(args, **kw):
"Failed to run command:
\
n
%s"
"Failed to run command:
\
n
%s"
%
repr
(
args
)[
1
:
-
1
])
%
repr
(
args
)[
1
:
-
1
])
def
_execute_permission
():
current_umask
=
os
.
umask
(
0o022
)
# os.umask only returns the current umask if you also give it one, so we
# have to give it a dummy one and immediately set it back to the real
# value... Distribute does the same.
os
.
umask
(
current_umask
)
return
0o777
-
current_umask
_easy_install_cmd
=
'from setuptools.command.easy_install import main; main()'
_easy_install_cmd
=
'from setuptools.command.easy_install import main; main()'
class
Installer
:
class
Installer
:
...
@@ -1099,7 +1109,7 @@ def _create_script(contents, dest):
...
@@ -1099,7 +1109,7 @@ def _create_script(contents, dest):
script
.
endswith
(
'-script.py'
)
and
script
[:
-
10
]
or
script
)
script
.
endswith
(
'-script.py'
)
and
script
[:
-
10
]
or
script
)
try
:
try
:
os
.
chmod
(
dest
,
493
)
# 0755
os
.
chmod
(
dest
,
_execute_permission
())
except
(
AttributeError
,
os
.
error
):
except
(
AttributeError
,
os
.
error
):
pass
pass
...
@@ -1167,7 +1177,7 @@ def _pyscript(path, dest, rsetup, initialization=''):
...
@@ -1167,7 +1177,7 @@ def _pyscript(path, dest, rsetup, initialization=''):
if
changed
:
if
changed
:
open
(
dest
,
'w'
).
write
(
contents
)
open
(
dest
,
'w'
).
write
(
contents
)
try
:
try
:
os
.
chmod
(
dest
,
493
)
# 0755
os
.
chmod
(
dest
,
_execute_permission
())
except
(
AttributeError
,
os
.
error
):
except
(
AttributeError
,
os
.
error
):
pass
pass
logger
.
info
(
"Generated interpreter %r."
,
script
)
logger
.
info
(
"Generated interpreter %r."
,
script
)
...
...
src/zc/buildout/easy_install.txt
View file @
c6772294
...
@@ -697,6 +697,15 @@ original script names to new script names.
...
@@ -697,6 +697,15 @@ original script names to new script names.
>>> print_(system(os.path.join(bin, 'run')), end='')
>>> print_(system(os.path.join(bin, 'run')), end='')
3 1
3 1
The scripts that are generated are made executable:
>>> if sys.platform == 'win32':
... os.access(os.path.join(bin, 'run.exe'), os.X_OK)
... else:
... os.access(os.path.join(bin, 'run'), os.X_OK)
True
Including extra paths in scripts
Including extra paths in scripts
--------------------------------
--------------------------------
...
...
src/zc/buildout/repeatable.txt
View file @
c6772294
...
@@ -236,6 +236,13 @@ Since buildout 2.0, the functionality of the `buildout-versions
...
@@ -236,6 +236,13 @@ Since buildout 2.0, the functionality of the `buildout-versions
<http://packages.python.org/buildout-versions/>`_ extension is part of
<http://packages.python.org/buildout-versions/>`_ extension is part of
buildout itself. This makes reporting and managing versions easier.
buildout itself. This makes reporting and managing versions easier.
Buildout picks a version for distribute and for the tests, we need to grab the
version number:
>>> import pkg_resources
>>> req = pkg_resources.Requirement.parse('distribute')
>>> distribute_version = pkg_resources.working_set.find(req).version
If you set the ``show-picked-versions`` option, buildout will print
If you set the ``show-picked-versions`` option, buildout will print
versions it picked at the end of its run:
versions it picked at the end of its run:
...
@@ -270,12 +277,12 @@ When everything is pinned, no output is generated:
...
@@ -270,12 +277,12 @@ When everything is pinned, no output is generated:
... show-picked-versions = true
... show-picked-versions = true
...
...
... [versions]
... [versions]
... distribute =
0.6.34
... distribute =
%s
... spam = 2
... spam = 2
...
...
... [foo]
... [foo]
... recipe = spam
... recipe = spam
... ''' %
join('recipe', 'dist'
))
... ''' %
(join('recipe', 'dist'), distribute_version
))
>>> print_(system(buildout), end='') # doctest: +ELLIPSIS
>>> print_(system(buildout), end='') # doctest: +ELLIPSIS
Updating foo.
Updating foo.
recipe v2
recipe v2
...
@@ -294,12 +301,12 @@ and case differences won't impact the pinning:
...
@@ -294,12 +301,12 @@ and case differences won't impact the pinning:
... show-picked-versions = true
... show-picked-versions = true
...
...
... [versions]
... [versions]
... distriBUTE =
0.6.34
... distriBUTE =
%s
... Spam = 2
... Spam = 2
...
...
... [foo]
... [foo]
... recipe = spam
... recipe = spam
... ''' %
join('recipe', 'dist'
))
... ''' %
(join('recipe', 'dist'), distribute_version
))
>>> print_(system(buildout), end='') # doctest: +ELLIPSIS
>>> print_(system(buildout), end='') # doctest: +ELLIPSIS
Updating foo.
Updating foo.
recipe v2
recipe v2
...
@@ -311,9 +318,9 @@ extending from that versions file:
...
@@ -311,9 +318,9 @@ extending from that versions file:
>>> write('my_versions.cfg',
>>> write('my_versions.cfg',
... '''
... '''
... [versions]
... [versions]
... distribute =
0.6.34
... distribute =
%s
... spam = 2
... spam = 2
... ''')
... '''
% distribute_version
)
>>> write('buildout.cfg',
>>> write('buildout.cfg',
... '''
... '''
... [buildout]
... [buildout]
...
@@ -336,8 +343,8 @@ at the end.
...
@@ -336,8 +343,8 @@ at the end.
>>> write('my_versions.cfg',
>>> write('my_versions.cfg',
... '''
... '''
... [versions]
... [versions]
... distribute =
0.6.34
... distribute =
%s
... ''')
... '''
% distribute_version
)
>>> write('buildout.cfg',
>>> write('buildout.cfg',
... '''
... '''
... [buildout]
... [buildout]
...
@@ -377,8 +384,8 @@ printing them to the console):
...
@@ -377,8 +384,8 @@ printing them to the console):
>>> write('my_versions.cfg',
>>> write('my_versions.cfg',
... '''
... '''
... [versions]
... [versions]
... distribute =
0.6.34
... distribute =
%s
... ''')
... '''
% distribute_version
)
>>> write('buildout.cfg',
>>> write('buildout.cfg',
... '''
... '''
... [buildout]
... [buildout]
...
...
src/zc/buildout/tests.py
View file @
c6772294
...
@@ -2872,6 +2872,22 @@ def test_buildout_section_shorthand_for_command_line_assignments():
...
@@ -2872,6 +2872,22 @@ def test_buildout_section_shorthand_for_command_line_assignments():
>>> print_(system(buildout+' parts='), end='') # doctest: +ELLIPSIS
>>> print_(system(buildout+' parts='), end='') # doctest: +ELLIPSIS
"""
"""
def
buildout_honors_umask
():
"""
For setting the executable permission, the user's umask is honored:
>>> orig_umask = os.umask(0o077) # Only user gets permissions.
>>> zc.buildout.easy_install._execute_permission() == 0o700
True
>>> tmp = os.umask(0o022) # User can write, the rest not.
>>> zc.buildout.easy_install._execute_permission() == 0o755
True
>>> tmp = os.umask(orig_umask) # Reset umask to the original value.
"""
if
sys
.
platform
==
'win32'
:
del
buildout_honors_umask
# umask on dohs is academic
######################################################################
######################################################################
...
...
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