Commit 098edfbd authored by Simon McVittie's avatar Simon McVittie

build-snapshot: Allow noninteractive downgrades with -I

This frequently happens when rebasing a branch: the commit number
at the end of the branch will stay the same, leaving it as a 50/50
chance whether the truncated sha1 looks like an upgrade or a downgrade.

I'd like to do this with --only-upgrade (build-snapshot -i) too, but
combining --only-upgrade with --allow-downgrades isn't allowed.
Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
Reviewed-by: André Magalhães's avatarAndré Magalhães <andre.magalhaes@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D6617
parent e55f9401
......@@ -528,7 +528,10 @@ class SnapshotBuilder:
install = (['sudo', 'apt', 'install'] +
list(packages.strip('\n').splitlines()))
if not self.args.install_all:
if self.args.install_all:
install.append('--allow-downgrades')
install.append('-y')
else:
install.append('--only-upgrade')
self.do_in_srcdir(install)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment