diff --git a/sau/freebsd.py b/sau/freebsd.py index 11530cc..bf3b713 100644 --- a/sau/freebsd.py +++ b/sau/freebsd.py @@ -132,5 +132,14 @@ def pkg_upgrade(): for line in err.splitlines(): 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