Commit a09ec64d authored by Jim Fulton's avatar Jim Fulton

Author: Hctor Velarde <hvelarde@yahoo.com>

Date:   Tue Sep 27 21:20:50 2011 +0000
Fixed https://bugs.launchpad.net/bugs/697913 : Buildout doesn't honor exit code from scripts.

Cherry-picked from svntrunk.
parent db0d2fa3
...@@ -2,7 +2,6 @@ Change History ...@@ -2,7 +2,6 @@ Change History
************** **************
?.?.? (unreleased) ?.?.? (unreleased)
==================
New features: New features:
...@@ -40,6 +39,9 @@ Bugs fixed: ...@@ -40,6 +39,9 @@ Bugs fixed:
section which points to a non-existing URL the result is not very section which points to a non-existing URL the result is not very
user friendly. https://bugs.launchpad.net/zc.buildout/+bug/566167 user friendly. https://bugs.launchpad.net/zc.buildout/+bug/566167
- https://bugs.launchpad.net/bugs/697913 : Buildout doesn't honor exit code
from scripts. Fixed.
1.4.4 (2010-08-20) 1.4.4 (2010-08-20)
================== ==================
......
...@@ -1071,7 +1071,7 @@ sys.path[0:0] = [ ...@@ -1071,7 +1071,7 @@ sys.path[0:0] = [
import %(module_name)s import %(module_name)s
if __name__ == '__main__': if __name__ == '__main__':
%(module_name)s.%(attrs)s(%(arguments)s) sys.exit(%(module_name)s.%(attrs)s(%(arguments)s))
''' '''
distutils_script_template = script_header + '''\ distutils_script_template = script_header + '''\
......
...@@ -546,7 +546,7 @@ The demo script run the entry point defined in the demo egg: ...@@ -546,7 +546,7 @@ The demo script run the entry point defined in the demo egg:
import eggrecipedemo import eggrecipedemo
<BLANKLINE> <BLANKLINE>
if __name__ == '__main__': if __name__ == '__main__':
eggrecipedemo.main() sys.exit(eggrecipedemo.main())
Some things to note: Some things to note:
...@@ -583,7 +583,7 @@ rather than passing a requirement: ...@@ -583,7 +583,7 @@ rather than passing a requirement:
import eggrecipedemo import eggrecipedemo
<BLANKLINE> <BLANKLINE>
if __name__ == '__main__': if __name__ == '__main__':
eggrecipedemo.main() sys.exit(eggrecipedemo.main())
Passing entry-point information directly is handy when using eggs (or Passing entry-point information directly is handy when using eggs (or
distributions) that don't declare their entry points, such as distributions) that don't declare their entry points, such as
...@@ -714,7 +714,7 @@ to be included in the a generated script: ...@@ -714,7 +714,7 @@ to be included in the a generated script:
import eggrecipedemo import eggrecipedemo
<BLANKLINE> <BLANKLINE>
if __name__ == '__main__': if __name__ == '__main__':
eggrecipedemo.main() sys.exit(eggrecipedemo.main())
Providing script arguments Providing script arguments
-------------------------- --------------------------
...@@ -738,7 +738,7 @@ parentheses in the call: ...@@ -738,7 +738,7 @@ parentheses in the call:
import eggrecipedemo import eggrecipedemo
<BLANKLINE> <BLANKLINE>
if __name__ == '__main__': if __name__ == '__main__':
eggrecipedemo.main(1, 2) sys.exit(eggrecipedemo.main(1, 2))
Passing initialization code Passing initialization code
--------------------------- ---------------------------
...@@ -764,7 +764,7 @@ You can also pass script initialization code: ...@@ -764,7 +764,7 @@ You can also pass script initialization code:
import eggrecipedemo import eggrecipedemo
<BLANKLINE> <BLANKLINE>
if __name__ == '__main__': if __name__ == '__main__':
eggrecipedemo.main(1, 2) sys.exit(eggrecipedemo.main(1, 2))
Relative paths Relative paths
-------------- --------------
...@@ -810,7 +810,7 @@ to pass a common base directory of the scripts and eggs: ...@@ -810,7 +810,7 @@ to pass a common base directory of the scripts and eggs:
import eggrecipedemo import eggrecipedemo
<BLANKLINE> <BLANKLINE>
if __name__ == '__main__': if __name__ == '__main__':
eggrecipedemo.main() sys.exit(eggrecipedemo.main())
Note that the extra path we specified that was outside the directory Note that the extra path we specified that was outside the directory
passed as relative_paths wasn't converted to a relative path. passed as relative_paths wasn't converted to a relative path.
......
...@@ -89,7 +89,7 @@ Our buildout script has been updated to use the new eggs: ...@@ -89,7 +89,7 @@ Our buildout script has been updated to use the new eggs:
import zc.buildout.buildout import zc.buildout.buildout
<BLANKLINE> <BLANKLINE>
if __name__ == '__main__': if __name__ == '__main__':
zc.buildout.buildout.main() sys.exit(zc.buildout.buildout.main())
Now, let's recreate the sample buildout. If we specify constraints on Now, let's recreate the sample buildout. If we specify constraints on
the versions of zc.buildout and distribute to use, running the buildout the versions of zc.buildout and distribute to use, running the buildout
......
...@@ -381,7 +381,7 @@ Let's look at the script that was generated: ...@@ -381,7 +381,7 @@ Let's look at the script that was generated:
import eggrecipedemo import eggrecipedemo
<BLANKLINE> <BLANKLINE>
if __name__ == '__main__': if __name__ == '__main__':
eggrecipedemo.main() sys.exit(eggrecipedemo.main())
Relative egg paths Relative egg paths
------------------ ------------------
...@@ -434,7 +434,7 @@ Let's look at the script that was generated: ...@@ -434,7 +434,7 @@ Let's look at the script that was generated:
import eggrecipedemo import eggrecipedemo
<BLANKLINE> <BLANKLINE>
if __name__ == '__main__': if __name__ == '__main__':
eggrecipedemo.main() sys.exit(eggrecipedemo.main())
You can specify relative paths in the buildout section, rather than in You can specify relative paths in the buildout section, rather than in
each individual script section: each individual script section:
...@@ -481,7 +481,7 @@ each individual script section: ...@@ -481,7 +481,7 @@ each individual script section:
import eggrecipedemo import eggrecipedemo
<BLANKLINE> <BLANKLINE>
if __name__ == '__main__': if __name__ == '__main__':
eggrecipedemo.main() sys.exit(eggrecipedemo.main())
Specifying initialialization code and arguments Specifying initialialization code and arguments
----------------------------------------------- -----------------------------------------------
...@@ -531,7 +531,7 @@ to be included in generated scripts: ...@@ -531,7 +531,7 @@ to be included in generated scripts:
import eggrecipedemo import eggrecipedemo
<BLANKLINE> <BLANKLINE>
if __name__ == '__main__': if __name__ == '__main__':
eggrecipedemo.main(a, 2) sys.exit(eggrecipedemo.main(a, 2))
Here we see that the initialization code we specified was added after Here we see that the initialization code we specified was added after
setting the path. Note, as mentioned above, that leading whitespace setting the path. Note, as mentioned above, that leading whitespace
...@@ -586,7 +586,7 @@ declare entry points using the entry-points option: ...@@ -586,7 +586,7 @@ declare entry points using the entry-points option:
import foo.bar import foo.bar
<BLANKLINE> <BLANKLINE>
if __name__ == '__main__': if __name__ == '__main__':
foo.bar.a.b.c() sys.exit(foo.bar.a.b.c())
Generating all scripts Generating all scripts
---------------------- ----------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment