added more config options, among others an option to run depclean on

gentoo
This commit is contained in:
2019-04-09 18:13:37 +02:00
parent 3f9103552e
commit b60d5a4e5c
3 changed files with 49 additions and 2 deletions

View File

@ -255,3 +255,25 @@ def pkg_upgrade():
for line in out.splitlines():
if line.startswith(' * '):
log.warning(line)
if conf.getboolean('default', 'do_depclean', fallback=False):
cmd = [ EMERGE_PATH, '--color', 'n', '-q', '--depclean' ]
log.debug('Executing "{}"'.format(' '.join(cmd)))
proc = subprocess.Popen(
cmd,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE)
out, err = proc.communicate()
out = out.decode('utf-8')
err = err.decode('utf-8')
if proc.returncode != 0 or err:
log.error('depclean returned {}'.format(proc.returncode))
for line in out.splitlines():
log.error('stdout: {}'.format(line))
for line in err.splitlines():
log.error('stderr: {}'.format(line))
else:
log.info('depclean complete')
for line in out.splitlines():
if line.startswith(' * '):
log.warning(line)