From b1c520b257e23d27a165725d02e0c9a7b46ebc6e Mon Sep 17 00:00:00 2001 From: Fredrik Eriksson Date: Sat, 21 Dec 2019 17:05:41 +0100 Subject: [PATCH] use eix-sync if it exists - running eix-update after a sync does not update cache for overlays --- sau/gentoo.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) 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():