From 82e26cf59e69237f8d3b2b99c45f9ddb7ae13e47 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 22 Jan 2016 13:33:14 +0100 Subject: [PATCH 1/3] makebuildserver: use jessie32.box from cache, if present --- makebuildserver | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/makebuildserver b/makebuildserver index 4e575a09..ca2dc56f 100755 --- a/makebuildserver +++ b/makebuildserver @@ -46,11 +46,16 @@ parser.add_option("--debian-mirror", default="http://http.debian.net/debian/", options, args = parser.parse_args() # set up default config +cachedir = os.path.join(os.getenv('HOME'), '.cache', 'fdroidserver') config = { 'arch64': False, 'basebox': 'jessie32', - 'baseboxurl': 'https://f-droid.org/jessie32.box', - 'cachedir': os.path.join(os.getenv('HOME'), '.cache', 'fdroidserver'), + # TODO in py3, convert this to pathlib.Path(absolute_path_string).as_uri() + 'baseboxurl': [ + 'file://' + os.path.join(cachedir, 'jessie32.box'), + 'https://f-droid.org/jessie32.box', + ], + 'cachedir': cachedir, 'cpus': 1, 'memory': 3584, } From 8d66742dd7feec77aa30382bfb38da83f2b3e5a4 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 22 Jan 2016 14:33:17 +0100 Subject: [PATCH 2/3] makebuildserver: set debian mirror in config file only Setting it in the config file was not working, and right now, all of the options are in the config file and not as command line flags, so remove --debian-mirror to keep that consistent. --- makebuildserver | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/makebuildserver b/makebuildserver index ca2dc56f..20bc785f 100755 --- a/makebuildserver +++ b/makebuildserver @@ -41,8 +41,6 @@ parser.add_option("-v", "--verbose", action="store_true", default=False, help="Spew out even more information than normal") parser.add_option("-c", "--clean", action="store_true", default=False, help="Build from scratch, rather than attempting to update the existing server") -parser.add_option("--debian-mirror", default="http://http.debian.net/debian/", - help="Use the specified Debian mirror in the box's /etc/apt/sources.list.") options, args = parser.parse_args() # set up default config @@ -383,7 +381,7 @@ vagrantfile += """ chef.add_recipe "kivy" end end -""" % (options.debian_mirror) +""" % (config['debian_mirror']) # Check against the existing Vagrantfile, and if they differ, we need to # create a new box: From 980339d2f5c2677523c0a01ab89d5f17ee59c395 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 22 Jan 2016 15:30:34 +0100 Subject: [PATCH 3/3] make all apt repos in build server use the configured debian mirror --- buildserver/cookbooks/fdroidbuild-general/recipes/default.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb b/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb index ce46c6b6..e70de6fe 100644 --- a/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb +++ b/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb @@ -7,7 +7,7 @@ execute 'set_debian_mirror' do end execute "jessie_backports" do - command "echo 'deb http://http.debian.net/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list" + command "echo 'deb #{debian_mirror} jessie-backports main' > /etc/apt/sources.list.d/backports.list" only_if "grep jessie /etc/apt/sources.list" end