add support to clean unused dependencies on freebsd

This commit is contained in:
Fredrik Eriksson 2023-04-01 12:05:20 +02:00
parent aae85806c1
commit aafe46d429
Signed by: feffe
GPG Key ID: CD5A131FADFA3968

View File

@ -132,5 +132,14 @@ def pkg_upgrade():
for line in err.splitlines(): for line in err.splitlines():
log.warning('stderr: {}'.format(line)) log.warning('stderr: {}'.format(line))
if conf.getboolean('default', 'do_depclean', fallback=False):
cmd = [ PKG_PATH, 'autoremove', '-yq' ]
ret, out, err = sau.helpers.exec_cmd(cmd, timeout=3600)
if ret != 0 or err:
log.warning('{} failed:'.format(' '.join(cmd)))
for line in out.splitlines():
log.warning('stdout: {}'.format(line))
for line in err.splitlines():
log.warning('stderr: {}'.format(line))
return True return True