From 21ea1c1c89f8eea2090a9fe3175304bdd2117d89 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 19 Oct 2022 10:30:13 +0200 Subject: [PATCH] makebuildserver: purge apt_package_cache feature This is unmaintained, lightly used, a tangled mess, and can be replaced by things like the vagrant-cachier plugin or #418 --- buildserver/Vagrantfile | 9 +-------- examples/makebuildserver.config.py | 7 ------- jenkins-setup-build-environment | 1 - makebuildserver | 13 ------------- 4 files changed, 1 insertion(+), 29 deletions(-) diff --git a/buildserver/Vagrantfile b/buildserver/Vagrantfile index 8caa3296..2a170bdf 100644 --- a/buildserver/Vagrantfile +++ b/buildserver/Vagrantfile @@ -12,8 +12,7 @@ end Vagrant.configure("2") do |config| - # these two caching methods conflict, so only use one at a time - if Vagrant.has_plugin?("vagrant-cachier") and not configfile.has_key? "aptcachedir" + if Vagrant.has_plugin?("vagrant-cachier") config.cache.scope = :box config.cache.auto_detect = false config.cache.enable :apt @@ -77,12 +76,6 @@ Vagrant.configure("2") do |config| # necessary with 9p synced folders Dir.mkdir('cache') unless File.exists?('cache') - # cache .deb packages on the host via a mount trick - if configfile.has_key? "aptcachedir" - config.vm.synced_folder configfile["aptcachedir"], "/var/cache/apt/archives", - owner: 'root', group: 'root', create: true - end - config.vm.provision "shell", name: "setup-env-vars", path: "setup-env-vars", args: ["/opt/android-sdk"] config.vm.provision "shell", name: "apt-get-install", path: "provision-apt-get-install", diff --git a/examples/makebuildserver.config.py b/examples/makebuildserver.config.py index cb47f95f..7bba2c75 100644 --- a/examples/makebuildserver.config.py +++ b/examples/makebuildserver.config.py @@ -32,13 +32,6 @@ # # cachedir = 'buildserver/cache' -# A big part of creating a new instance is downloading packages from Debian. -# This setups up a folder in ~/.cache/fdroidserver to cache the downloaded -# packages when rebuilding the build server from scratch. This requires -# that virtualbox-guest-utils is installed. -# -# apt_package_cache = True - # The buildserver can use some local caches to speed up builds, # especially when the internet connection is slow and/or expensive. # If enabled, the buildserver setup will look for standard caches in diff --git a/jenkins-setup-build-environment b/jenkins-setup-build-environment index 489717b2..bc81530e 100755 --- a/jenkins-setup-build-environment +++ b/jenkins-setup-build-environment @@ -69,7 +69,6 @@ fi cat < $WORKSPACE/makebuildserver.config.py debian_mirror = 'http://deb.debian.org/debian/' boot_timeout = 1200 -apt_package_cache = True copy_caches_from_host = True memory = $memory cpus = $cpus diff --git a/makebuildserver b/makebuildserver index 21432a38..47928cd8 100755 --- a/makebuildserver +++ b/makebuildserver @@ -77,7 +77,6 @@ BASEBOX_CHECKSUMS = { config = { 'basebox': BASEBOX_DEFAULT, 'debian_mirror': 'https://deb.debian.org/debian/', - 'apt_package_cache': False, 'copy_caches_from_host': False, 'boot_timeout': 600, 'cachedir': os.path.join(os.getenv('HOME'), '.cache', 'fdroidserver'), @@ -121,18 +120,6 @@ if config['vm_provider'] == 'libvirt': tmp = os.path.dirname(tmp) logging.debug('cache dir %s is accessible for libvirt vm.', config['cachedir']) -if config['apt_package_cache']: - config['aptcachedir'] = config['cachedir'] + '/apt/archives' - logging.debug('aptcachedir is set to %s', config['aptcachedir']) - aptcachelock = os.path.join(config['aptcachedir'], 'lock') - if os.path.isfile(aptcachelock): - logging.info('apt cache dir is locked, removing lock') - os.remove(aptcachelock) - aptcachepartial = os.path.join(config['aptcachedir'], 'partial') - if os.path.isdir(aptcachepartial): - logging.info('removing partial downloads from apt cache dir') - shutil.rmtree(aptcachepartial) - CACHE_FILES = [ ('https://services.gradle.org/distributions/gradle-6.8.3-bin.zip', '7faa7198769f872826c8ef4f1450f839ec27f0b4d5d1e51bade63667cbccd205'),