From aafe46d429c9ef5a34a5bf1f9e63f32922a4c0d2 Mon Sep 17 00:00:00 2001 From: Fredrik Eriksson Date: Sat, 1 Apr 2023 12:05:20 +0200 Subject: [PATCH] add support to clean unused dependencies on freebsd --- sau/freebsd.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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