Commit 8638187c authored by Simon McVittie's avatar Simon McVittie

Use dpkg -i or dpkg -i -O if apt is too old and debi isn't installed

Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
parent 84b45b1d
......@@ -552,7 +552,8 @@ class SnapshotBuilder:
install.append('--only-upgrade')
self.do_in_srcdir(install)
else:
elif self.do_in_srcdir('command -v debi >/dev/null',
shell=True, may_fail=True) == 0:
debi = ['sudo', 'debi', '--no-conf', '--with-depends',
'--debs-dir', tmpdir]
......@@ -560,6 +561,16 @@ class SnapshotBuilder:
debi.append('--upgrade')
self.do_in_srcdir(debi)
else:
install = 'sudo dpkg -i'
if not self.args.install_all:
install = install + ' -O'
self.do_in_srcdir(
'{} {}/*.deb'.format(install, shlex.quote(tmpdir)),
shell=True)
self.do_in_srcdir(['sudo', 'apt-get', '-f', 'install'])
if (os.path.exists('debian/tests/control') and
self.do_in_srcdir('command -v sadt >/dev/null',
......
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