def generate_archive_settings(packages):
    """
    Generate an archive settings given a list of record packages

    Parameters
    ----------
    packages : list of record packages

    Yields
    ------
    str
        One line from the archiver settings file
    """
    for package in packages:
        archive_settings = package.archive_settings
        if archive_settings:
            for record in package.records:
                fields = sorted(set(archive_settings['fields'] + package.
                    archive_fields))
                for field in fields:
                    period = archive_settings['seconds']
                    update_rate = package.config['update']['seconds']
                    if period < update_rate:
                        period = update_rate
                    method = archive_settings['method']
                    yield f'{record.pvname}.{field}\t{period}\t{method}'
