Add apt cacher proxy settings temporarily

This commit is contained in:
Waqar Ahmed
2021-04-17 00:50:35 +05:00
committed by Waqar Ahmed
parent d1411a60eb
commit 940010acaa

View File

@@ -64,6 +64,12 @@ class BuildPackageMixin:
self.clean_previous_packages()
shutil.copytree(self.source_path, self.source_in_chroot, dirs_exist_ok=True)
# TODO: Remove me please
self.logger.debug('Setting up apt-cacher')
os.makedirs(os.path.join(self.dpkg_overlay, 'etc/apt/apt.conf.d'), exist_ok=True)
with open(os.path.join(self.dpkg_overlay, 'etc/apt/apt.conf.d/02proxy'), 'w') as f:
f.write('Acquire::http::Proxy "http://192.168.0.3:3142";\n')
if os.path.exists(os.path.join(self.dpkg_overlay_packages_path, 'Packages.gz')):
self.run_in_chroot('apt update')