Sync portage/overlay trees and update the eix database

    CLI Example:

    .. code-block:: bash

        salt '*' eix.sync

def sync():
    '''
    Sync portage/overlay trees and update the eix database

    CLI Example:

    .. code-block:: bash

        salt '*' eix.sync
    '''
    # Funtoo patches eix to use 'ego sync'
    if __grains__['os'] == 'Funtoo':
        cmd = 'eix-sync -q'
    else:
        cmd = 'eix-sync -q -C "--ask" -C "n"'
    if 'makeconf.features_contains' in __salt__ and __salt__['makeconf.features_contains']('webrsync-gpg'):
        # GPG sign verify is supported only for "webrsync"
        if salt.utils.path.which('emerge-delta-webrsync'):  # We prefer 'delta-webrsync' to 'webrsync'
            cmd += ' -W'
        else:
            cmd += ' -w'
        return __salt__['cmd.retcode'](cmd) == 0
    else:
        if __salt__['cmd.retcode'](cmd) == 0:
            return True
        # We fall back to "webrsync" if "rsync" fails for some reason
        if salt.utils.path.which('emerge-delta-webrsync'):  # We prefer 'delta-webrsync' to 'webrsync'
            cmd += ' -W'
        else:
            cmd += ' -w'
        return __salt__['cmd.retcode'](cmd) == 0