Multi apt distro support

This commit is contained in:
jpic 2020-01-31 20:32:56 +01:00
parent 6547888291
commit 8ae4687cf2

View File

@ -69,6 +69,7 @@ class Packages:
script.mount(cache, f'/var/cache/{self.mgr}') script.mount(cache, f'/var/cache/{self.mgr}')
script.run('sh -c "echo keepcache=True >> /etc/dnf/dnf.conf"') script.run('sh -c "echo keepcache=True >> /etc/dnf/dnf.conf"')
elif self.mgr == 'apt': elif self.mgr == 'apt':
cache = cache + '/$(source $mnt/etc/os-release; echo $VERSION_CODENAME)/' # noqa
script.run('sudo rm /etc/apt/apt.conf.d/docker-clean') script.run('sudo rm /etc/apt/apt.conf.d/docker-clean')
cache_archives = os.path.join(cache, 'archives') cache_archives = os.path.join(cache, 'archives')
script.mount(cache_archives, f'/var/cache/apt/archives') script.mount(cache_archives, f'/var/cache/apt/archives')