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
Rafael Monnerat
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
Hide 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
**************
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
``__pycache__`` directories.
...
...
bootstrap/bootstrap.py
View file @
c6772294
...
...
@@ -18,7 +18,11 @@ The script accepts buildout command-line options, so you can
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
tmpeggs
=
tempfile
.
mkdtemp
()
...
...
@@ -48,10 +52,10 @@ parser.add_option("-t", "--accept-buildout-test-releases",
"bootstrap and buildout will get the newest releases "
"even if they are alphas or betas."
))
parser
.
add_option
(
"-c"
,
"--config-file"
,
help
=
(
"Specify the path to the buildout configuration "
"file to be used."
))
help
=
(
"Specify the path to the buildout configuration "
"file to be used."
))
parser
.
add_option
(
"-f"
,
"--find-links"
,
help
=
(
"Specify a URL to search for buildout releases"
))
help
=
(
"Specify a URL to search for buildout releases"
))
options
,
args
=
parser
.
parse_args
()
...
...
@@ -61,7 +65,8 @@ options, args = parser.parse_args()
to_reload
=
False
try
:
import
pkg_resources
,
setuptools
import
pkg_resources
import
setuptools
if
not
hasattr
(
pkg_resources
,
'_distribute'
):
to_reload
=
True
raise
ImportError
...
...
@@ -73,7 +78,8 @@ except ImportError:
except
ImportError
:
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
)
ez
[
'use_setuptools'
](
**
setup_args
)
...
...
@@ -89,7 +95,7 @@ except ImportError:
######################################################################
# Install buildout
ws
=
pkg_resources
.
working_set
ws
=
pkg_resources
.
working_set
cmd
=
[
sys
.
executable
,
'-c'
,
'from setuptools.command.easy_install import main; main()'
,
...
...
@@ -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.
import
setuptools.package_index
_final_parts
=
'*final-'
,
'*final'
def
_final_version
(
parsed_version
):
for
part
in
parsed_version
:
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):
"Failed to run command:
\
n
%s"
%
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()'
class
Installer
:
...
...
@@ -1099,7 +1109,7 @@ def _create_script(contents, dest):
script
.
endswith
(
'-script.py'
)
and
script
[:
-
10
]
or
script
)
try
:
os
.
chmod
(
dest
,
493
)
# 0755
os
.
chmod
(
dest
,
_execute_permission
())
except
(
AttributeError
,
os
.
error
):
pass
...
...
@@ -1167,7 +1177,7 @@ def _pyscript(path, dest, rsetup, initialization=''):
if
changed
:
open
(
dest
,
'w'
).
write
(
contents
)
try
:
os
.
chmod
(
dest
,
493
)
# 0755
os
.
chmod
(
dest
,
_execute_permission
())
except
(
AttributeError
,
os
.
error
):
pass
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.
>>> print_(system(os.path.join(bin, 'run')), end='')
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
--------------------------------
...
...
src/zc/buildout/repeatable.txt
View file @
c6772294
...
...
@@ -236,6 +236,13 @@ Since buildout 2.0, the functionality of the `buildout-versions
<http://packages.python.org/buildout-versions/>`_ extension is part of
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
versions it picked at the end of its run:
...
...
@@ -270,12 +277,12 @@ When everything is pinned, no output is generated:
... show-picked-versions = true
...
... [versions]
... distribute =
0.6.34
... distribute =
%s
... spam = 2
...
... [foo]
... recipe = spam
... ''' %
join('recipe', 'dist'
))
... ''' %
(join('recipe', 'dist'), distribute_version
))
>>> print_(system(buildout), end='') # doctest: +ELLIPSIS
Updating foo.
recipe v2
...
...
@@ -294,12 +301,12 @@ and case differences won't impact the pinning:
... show-picked-versions = true
...
... [versions]
... distriBUTE =
0.6.34
... distriBUTE =
%s
... Spam = 2
...
... [foo]
... recipe = spam
... ''' %
join('recipe', 'dist'
))
... ''' %
(join('recipe', 'dist'), distribute_version
))
>>> print_(system(buildout), end='') # doctest: +ELLIPSIS
Updating foo.
recipe v2
...
...
@@ -311,9 +318,9 @@ extending from that versions file:
>>> write('my_versions.cfg',
... '''
... [versions]
... distribute =
0.6.34
... distribute =
%s
... spam = 2
... ''')
... '''
% distribute_version
)
>>> write('buildout.cfg',
... '''
... [buildout]
...
...
@@ -336,8 +343,8 @@ at the end.
>>> write('my_versions.cfg',
... '''
... [versions]
... distribute =
0.6.34
... ''')
... distribute =
%s
... '''
% distribute_version
)
>>> write('buildout.cfg',
... '''
... [buildout]
...
...
@@ -377,8 +384,8 @@ printing them to the console):
>>> write('my_versions.cfg',
... '''
... [versions]
... distribute =
0.6.34
... ''')
... distribute =
%s
... '''
% distribute_version
)
>>> write('buildout.cfg',
... '''
... [buildout]
...
...
src/zc/buildout/tests.py
View file @
c6772294
...
...
@@ -2872,6 +2872,22 @@ def test_buildout_section_shorthand_for_command_line_assignments():
>>> 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