mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 06:52:39 +03:00
Fixes to makebuildserver and verify
This commit is contained in:
parent
65e708908e
commit
fc804e68d2
3 changed files with 11 additions and 15 deletions
|
@ -30,17 +30,17 @@ import magic
|
||||||
config = None
|
config = None
|
||||||
options = None
|
options = None
|
||||||
|
|
||||||
def read_config(opts):
|
def read_config(opts, config_file='config.py'):
|
||||||
"""Read the repository config
|
"""Read the repository config
|
||||||
|
|
||||||
The config is read from config.py, which is in the current directory when
|
The config is read from config_file, which is in the current directory when
|
||||||
any of the repo management commands are used.
|
any of the repo management commands are used.
|
||||||
"""
|
"""
|
||||||
global config, options
|
global config, options
|
||||||
|
|
||||||
if config is not None:
|
if config is not None:
|
||||||
return config
|
return config
|
||||||
if not os.path.isfile('config.py'):
|
if not os.path.isfile(config_file):
|
||||||
print "Missing config file - is this a repo directory?"
|
print "Missing config file - is this a repo directory?"
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
|
@ -58,8 +58,8 @@ def read_config(opts):
|
||||||
'max_icon_size': 72,
|
'max_icon_size': 72,
|
||||||
'stats_to_carbon': False
|
'stats_to_carbon': False
|
||||||
}
|
}
|
||||||
print "Reading config.py..."
|
print "Reading %s..." % config_file
|
||||||
execfile('config.py', config)
|
execfile(config_file, config)
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,6 @@ def main():
|
||||||
|
|
||||||
global options, config
|
global options, config
|
||||||
|
|
||||||
options, args = parse_commandline()
|
|
||||||
|
|
||||||
# Parse command line...
|
# Parse command line...
|
||||||
parser = OptionParser()
|
parser = OptionParser()
|
||||||
parser.add_option("-v", "--verbose", action="store_true", default=False,
|
parser.add_option("-v", "--verbose", action="store_true", default=False,
|
||||||
|
|
|
@ -5,8 +5,7 @@ import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
from fdroidserver import common
|
||||||
execfile('makebs.config.py', globals())
|
|
||||||
|
|
||||||
def vagrant(params, cwd=None, printout=False):
|
def vagrant(params, cwd=None, printout=False):
|
||||||
"""Run vagrant.
|
"""Run vagrant.
|
||||||
|
@ -43,8 +42,7 @@ parser.add_option("-c", "--clean", action="store_true", default=False,
|
||||||
help="Build from scratch, rather than attempting to update the existing server")
|
help="Build from scratch, rather than attempting to update the existing server")
|
||||||
options, args = parser.parse_args()
|
options, args = parser.parse_args()
|
||||||
|
|
||||||
|
config = common.read_config(options, 'makebs.config.py')
|
||||||
|
|
||||||
|
|
||||||
if not os.path.exists('makebuildserver.py') or not os.path.exists(serverdir):
|
if not os.path.exists('makebuildserver.py') or not os.path.exists(serverdir):
|
||||||
print 'This must be run from the correct directory!'
|
print 'This must be run from the correct directory!'
|
||||||
|
@ -67,7 +65,7 @@ cachefiles = [
|
||||||
('gradle-1.8-bin.zip',
|
('gradle-1.8-bin.zip',
|
||||||
'http://services.gradle.org/distributions/gradle-1.8-bin.zip',
|
'http://services.gradle.org/distributions/gradle-1.8-bin.zip',
|
||||||
'a342bbfa15fd18e2482287da4959588f45a41b60910970a16e6d97959aea5703')]
|
'a342bbfa15fd18e2482287da4959588f45a41b60910970a16e6d97959aea5703')]
|
||||||
if arch64:
|
if config['arch64']:
|
||||||
cachefiles.extend([
|
cachefiles.extend([
|
||||||
('android-ndk-r9-linux-x64_64.tar.bz2',
|
('android-ndk-r9-linux-x64_64.tar.bz2',
|
||||||
'http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2',
|
'http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2',
|
||||||
|
@ -114,11 +112,11 @@ Vagrant::Config.run do |config|
|
||||||
config.vm.customize ["modifyvm", :id, "--memory", "{2}"]
|
config.vm.customize ["modifyvm", :id, "--memory", "{2}"]
|
||||||
|
|
||||||
config.vm.provision :shell, :path => "fixpaths.sh"
|
config.vm.provision :shell, :path => "fixpaths.sh"
|
||||||
""".format(basebox, baseboxurl, memory)
|
""".format(config['basebox'], config['baseboxurl'], config['memory'])
|
||||||
if aptproxy:
|
if 'aptproxy' in config and config['aptproxy']:
|
||||||
vagrantfile += """
|
vagrantfile += """
|
||||||
config.vm.provision :shell, :inline => 'sudo echo "Acquire::http {{ Proxy \\"{0}\\"; }};" > /etc/apt/apt.conf.d/02proxy && sudo apt-get update'
|
config.vm.provision :shell, :inline => 'sudo echo "Acquire::http {{ Proxy \\"{0}\\"; }};" > /etc/apt/apt.conf.d/02proxy && sudo apt-get update'
|
||||||
""".format(aptproxy)
|
""".format(config['aptproxy'])
|
||||||
vagrantfile += """
|
vagrantfile += """
|
||||||
config.vm.provision :chef_solo do |chef|
|
config.vm.provision :chef_solo do |chef|
|
||||||
chef.cookbooks_path = "cookbooks"
|
chef.cookbooks_path = "cookbooks"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue