diff --git a/sau/gentoo.py b/sau/gentoo.py index b1ccaed..145b2ac 100644 --- a/sau/gentoo.py +++ b/sau/gentoo.py @@ -5,7 +5,7 @@ import re import sau import sau.helpers -EIX_UPDATE_PATH='/usr/bin/eix-update' +EIX_SYNC_PATH='/usr/bin/eix-sync' RC_SERVICE_PATH='/sbin/rc-service' EMERGE_PATH='/usr/bin/emerge' EQUERY_PATH='/usr/bin/equery' @@ -78,8 +78,12 @@ def system_upgrade(): def _sync_portage(): log = logging.getLogger(sau.LOGNAME) - cmd = [ EMERGE_PATH, '-q', '--sync' ] - ret, out, err = sau.helpers.exec_cmd(cmd, timeout=3600) + if os.path.exists(EIX_SYNC_PATH): + cmd = [ EIX_SYNC_PATH, '-q' ] + ret, out, err = sau.helpers.exec_cmd(cmd, timeout=3600) + else: + cmd = [ EMERGE_PATH, '-q', '--sync' ] + ret, out, err = sau.helpers.exec_cmd(cmd, timeout=3600) if ret != 0: log.warning("Portage sync failed:") @@ -88,16 +92,6 @@ def _sync_portage(): for line in err.splitlines(): log.warning("stderr: {}".format(line)) - if os.path.exists(EIX_UPDATE_PATH): - cmd = [ EIX_UPDATE_PATH, '-q' ] - ret, out, err = sau.helpers.exec_cmd(cmd, timeout=3600) - - if ret != 0: - log.warning("eix-update failed:") - for line in out.splitlines(): - log.warning("stdout: {}".format(line)) - for line in err.splitlines(): - log.warning("stderr: {}".format(line)) def pkg_upgrade():