added more config options, among others an option to run depclean on
gentoo
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user