'See :class:`CreateRepo`.'

@sync_performer
def _perform_create_repository(self, dispatcher, intent):

    package_type = intent.distribution.package_type()
    packages = set([f for f in intent.repository_path.listdir() if f.endswith(package_type.value)])
    if (package_type == PackageTypes.RPM):
        metadata_directory = intent.repository_path.child('repodata')
        metadata_directory.createDirectory()
        metadata_directory.child('repomod.xml').setContent('<newhash>-metadata.xml')
        metadata_directory.child('<newhash>-metadata.xml').setContent(('metadata    content    for:    ' + ','.join(sorted(packages))))
        return {'repodata/repomod.xml', 'repodata/<newhash>-metadata.xml'}
    elif (package_type == PackageTypes.DEB):
        index = intent.repository_path.child('Packages.gz')
        index.setContent(('Packages.gz    for:    ' + ','.join(sorted(packages))))
        intent.repository_path.child('Release').setContent('Origin:    ClusterHQ\n')
        return {'Packages.gz', 'Release'}
    else:
        raise NotImplementedError(('Unknown    package    type:    %s' % (package_type,)))
