Commit 2d3d2ad1 authored by Jim Fulton's avatar Jim Fulton

Bug fixed:

  Option incrementing and decrementing didn't work for options
  specified on the command line.
parent d3b337fd
......@@ -14,6 +14,9 @@ Bugs fixed:
didn't work in the buildout section.
https://bugs.launchpad.net/zc.buildout/+bug/420463
- Option incrementing and decrementing didn't work for options
specified on the command line.
1.4.0 (2009-08-26)
==================
......
......@@ -14,31 +14,30 @@
"""Buildout main script
"""
from rmtree import rmtree
try:
from hashlib import md5
except ImportError:
# Python 2.4 and older
from md5 import md5
import ConfigParser
import copy
import distutils.errors
import glob
import itertools
import logging
import os
import pkg_resources
import re
import shutil
import sys
import tempfile
import ConfigParser
import UserDict
import glob
import copy
import pkg_resources
import zc.buildout
import zc.buildout.download
import zc.buildout.easy_install
from rmtree import rmtree
try:
from hashlib import md5
except ImportError:
# Python 2.4 and older
from md5 import md5
realpath = zc.buildout.easy_install.realpath
......@@ -160,9 +159,14 @@ class Buildout(UserDict.DictMixin):
else:
base = None
override = dict((option, (value, 'COMMAND_LINE_VALUE'))
for section, option, value in cloptions
if section == 'buildout')
cloptions = dict(
(section, dict((option, (value, 'COMMAND_LINE_VALUE'))
for (_, option, value) in v))
for (section, v) in itertools.groupby(sorted(cloptions),
lambda v: v[0])
)
override = cloptions.get('buildout', {}).copy()
# load user defaults, which override defaults
if user_defaults:
......@@ -178,11 +182,7 @@ class Buildout(UserDict.DictMixin):
data['buildout'].copy(), override))
# apply command-line options
for (section, option, value) in cloptions:
options = data.get(section)
if options is None:
options = data[section] = {}
options[option] = value, "COMMAND_LINE_VALUE"
_update(data, cloptions)
self._annotated = copy.deepcopy(data)
self._raw = _unannotate(data)
......
......@@ -11,11 +11,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""XXX short summary goes here.
$Id$
"""
from zope.testing import doctest
from zope.testing import renormalizing
import os
......@@ -2591,7 +2586,31 @@ def increment_buildout_options():
recipe='zc.buildout:debug'
"""
def increment_on_command_line():
r"""
>>> write('buildout.cfg', '''
... [buildout]
... parts = p1
... x = 1
... y = a
... b
...
... [p1]
... recipe = zc.buildout:debug
... foo = ${buildout:x} ${buildout:y}
...
... [p2]
... <= p1
... ''')
>>> print system(buildout+' buildout:parts+=p2 p1:foo+=bar'),
Installing p1.
foo='1 a\nb\nbar'
recipe='zc.buildout:debug'
Installing p2.
foo='1 a\nb\nbar'
recipe='zc.buildout:debug'
"""
######################################################################
......
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