[Checkins] SVN: zc.buildout/trunk/ make sure the -c option can be used over bootstrap (passed to buildout.main)
Tarek Ziade
ziade.tarek at gmail.com
Sun Nov 1 10:15:20 EST 2009
Log message for revision 105417:
make sure the -c option can be used over bootstrap (passed to buildout.main)
Changed:
U zc.buildout/trunk/bootstrap/bootstrap.py
U zc.buildout/trunk/src/zc/buildout/bootstrap.txt
-=-
Modified: zc.buildout/trunk/bootstrap/bootstrap.py
===================================================================
--- zc.buildout/trunk/bootstrap/bootstrap.py 2009-11-01 12:45:39 UTC (rev 105416)
+++ zc.buildout/trunk/bootstrap/bootstrap.py 2009-11-01 15:15:20 UTC (rev 105417)
@@ -35,8 +35,16 @@
action="store_true", dest="distribute", default=False,
help="Use Disribute rather than Setuptools.")
+parser.add_option("-c", None, action="store", dest="config_file",
+ help=("Specify the path to the buildout configuration "
+ "file to be used."))
+
options, args = parser.parse_args()
+# if -c was provided, we push it back into args for buildout' main function
+if options.config_file is not None:
+ args += ['-c', options.config_file]
+
if options.version is not None:
VERSION = '==%s' % options.version
else:
Modified: zc.buildout/trunk/src/zc/buildout/bootstrap.txt
===================================================================
--- zc.buildout/trunk/src/zc/buildout/bootstrap.txt 2009-11-01 12:45:39 UTC (rev 105416)
+++ zc.buildout/trunk/src/zc/buildout/bootstrap.txt 2009-11-01 15:15:20 UTC (rev 105417)
@@ -178,3 +178,20 @@
zc.buildout.buildout.main()
<BLANKLINE>
+Last, the -c option needs to work on bootstrap.py::
+
+ >>> conf_file = os.path.join(sample_buildout, 'other.cfg')
+ >>> f = open(conf_file, 'w')
+ >>> f.write('[buildout]\nparts=\n\n')
+ >>> f.close()
+ >>> print 'X'; print system(
+ ... zc.buildout.easy_install._safe_arg(sys.executable)+' '+
+ ... 'bootstrap.py -c %s --distribute' % conf_file); print 'X' # doctest: +ELLIPSIS
+ ...
+ X
+ ...
+ Generated script '/sample/bin/buildout'.
+ <BLANKLINE>
+ X
+
+
More information about the checkins
mailing list