def _get_extensions(self):
        """
        Return a list of pairs (name, sql file) to be loaded/unloaded.

        Items are in loading order.
        """
        spec = self.get_spec()
        dist = self.get_meta(spec)

        if 'provides' not in dist:
            # No 'provides' specified: assume a single extension named
            # after the distribution. This is automatically done by PGXN,
            # but we should do ourselves to deal with local META files
            # not mangled by the PGXN upload script yet.
            name = dist['name']
            for ext in self.opts.extensions:
                if ext != name:
                    raise PgxnClientException(
                        "can't find extension '%s' in the distribution '%s'"
                            % (name, spec))

            return [ (name, None) ]

        rv = []

        if not self.opts.extensions:
            # All the extensions, in the order specified
            # (assume we got an orddict from json)
            for name, data in dist['provides'].items():
                rv.append((name, data.get('file')))
        else:
            # Only the specified extensions
            for name in self.opts.extensions:
                try:
                    data = dist['provides'][name]
                except __HOLE__:
                    raise PgxnClientException(
                        "can't find extension '%s' in the distribution '%s'"
                            % (name, spec))
                rv.append((name, data.get('file')))

        return rv
dataset/ETHPy150Open dvarrazzo/pgxnclient/pgxnclient/commands/install.py/LoadUnload._get_extensions