'Get a dict<name -> spec> for all extensions currently
installed for this package.'

def _extension_map(self, spec):

    _check_concrete(spec)
    if (spec not in self._extension_maps):
        path = self.extension_file_path(spec)
        if (not os.path.exists(path)):
            self._extension_maps[spec] = {}
        else:
            by_hash = self.specs_by_hash()
            exts = {}
            with open(path) as ext_file:
                yaml_file = yaml.load(ext_file)
                for entry in yaml_file['extensions']:
                    name = next(iter(entry))
                    dag_hash = entry[name]['hash']
                    prefix = entry[name]['path']
                    if (dag_hash not in by_hash):
                        raise InvalidExtensionSpecError(('Spec    %s    not    found    in    %s' % (dag_hash, prefix)))
                    ext_spec = by_hash[dag_hash]
                    if (prefix != ext_spec.prefix):
                        raise InvalidExtensionSpecError(('Prefix    %s    does    not    match    spec    hash    %s:    %s' % (prefix, dag_hash, ext_spec)))
                    exts[ext_spec.name] = ext_spec
            self._extension_maps[spec] = exts
    return self._extension_maps[spec]
