use eix-sync if it exists - running eix-update after a sync does not

update cache for overlays
This commit is contained in:
Fredrik Eriksson 2019-12-21 17:05:41 +01:00
parent 712a4e986f
commit b1c520b257
Signed by: feffe
GPG Key ID: 18524638BE25530A

View File

@ -5,7 +5,7 @@ import re
import sau import sau
import sau.helpers import sau.helpers
EIX_UPDATE_PATH='/usr/bin/eix-update' EIX_SYNC_PATH='/usr/bin/eix-sync'
RC_SERVICE_PATH='/sbin/rc-service' RC_SERVICE_PATH='/sbin/rc-service'
EMERGE_PATH='/usr/bin/emerge' EMERGE_PATH='/usr/bin/emerge'
EQUERY_PATH='/usr/bin/equery' EQUERY_PATH='/usr/bin/equery'
@ -78,8 +78,12 @@ def system_upgrade():
def _sync_portage(): def _sync_portage():
log = logging.getLogger(sau.LOGNAME) log = logging.getLogger(sau.LOGNAME)
cmd = [ EMERGE_PATH, '-q', '--sync' ] if os.path.exists(EIX_SYNC_PATH):
ret, out, err = sau.helpers.exec_cmd(cmd, timeout=3600) 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: if ret != 0:
log.warning("Portage sync failed:") log.warning("Portage sync failed:")
@ -88,16 +92,6 @@ def _sync_portage():
for line in err.splitlines(): for line in err.splitlines():
log.warning("stderr: {}".format(line)) 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(): def pkg_upgrade():