'Get a dependency from the spec by its name. This call implicitly
sets a query state in the package being retrieved. The behavior of
packages may be influenced by additional query parameters that are
passed after a colon symbol.
Note that if a virtual package is queried a copy of the Spec is
returned while for non-virtual a reference is returned.'

def __getitem__(self, name):

    query_parameters = name.split(':')
    if (len(query_parameters) > 2):
        msg = "key    has    more    than    one    ':'    symbol."
        msg += '    At    most    one    is    admitted.'
        raise KeyError(msg)
    (name, query_parameters) = (query_parameters[0], query_parameters[1:])
    if query_parameters:
        csv = query_parameters.pop().strip()
        query_parameters = re.split('\\s*,\\s*', csv)
    try:
        value = next(itertools.chain((x for x in self.traverse() if (x.name == name)), (x for x in self.traverse() if ((not x.virtual) and x.package.provides(name)))))
    except StopIteration:
        raise KeyError(('No    spec    with    name    %s    in    %s' % (name, self)))
    if self._concrete:
        return SpecBuildInterface(value, name, query_parameters)
    return value
