mirror of
https://github.com/vyos/vyos-build.git
synced 2025-10-01 20:28:40 +02:00
Add configure script support for Debian mirror options.
This commit is contained in:
parent
daf94a4bab
commit
c0cae8b7fe
@ -23,7 +23,9 @@ def get_default_build_by():
|
||||
|
||||
options = {
|
||||
'architecture': ('Image target architecture (amd64 or i586)', lambda: 'amd64', lambda x: x in ['amd64', 'i586']),
|
||||
'build-by': ('Builder identifier (e.g. jrandomhacker@example.net)', get_default_build_by, None)
|
||||
'build-by': ('Builder identifier (e.g. jrandomhacker@example.net)', get_default_build_by, None),
|
||||
'debian-mirror': ('Debian repository mirror for ISO build', lambda: defaults.DEBIAN_MIRROR, None),
|
||||
'pbuilder-debian-mirror': ('Debian repository mirror for pbuilder env bootstrap', lambda: defaults.DEBIAN_MIRROR, None)
|
||||
}
|
||||
|
||||
# Create the option parser
|
||||
@ -42,8 +44,14 @@ for k, v in args.items():
|
||||
print("{v} is not a valid value for --{o} option".format(o=key, v=v))
|
||||
sys.exit(1)
|
||||
|
||||
# Save to file
|
||||
# Some fixup for mirror settings.
|
||||
# The idea is: if --debian-mirror is specified but --pbuilder-debian-mirror is not,
|
||||
# use the --debian-mirror value for both lb and pbuilder bootstrap
|
||||
if (args['debian_mirror'] != defaults.DEBIAN_MIRROR) and \
|
||||
(args['pbuilder_debian_mirror'] == defaults.DEBIAN_MIRROR):
|
||||
args['pbuilder_debian_mirror'] = args['debian-mirror']
|
||||
|
||||
# Save to file
|
||||
distutils.dir_util.mkpath(defaults.BUILD_DIR)
|
||||
|
||||
with open(defaults.BUILD_CONFIG, 'w') as f:
|
||||
|
||||
@ -2,3 +2,6 @@ import os
|
||||
|
||||
BUILD_DIR = 'build'
|
||||
BUILD_CONFIG = os.path.join(BUILD_DIR, 'build-config.json')
|
||||
|
||||
# The default mirror was chosen entirely at random
|
||||
DEBIAN_MIRROR = 'http://ftp.nl.debian.org/debian/'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user