diff options
author | Daniil Baturin <daniil@baturin.org> | 2015-12-24 16:06:34 -0500 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2015-12-24 16:06:34 -0500 |
commit | c0cae8b7fec0d5e8a7c8ff9418397587e967fd15 (patch) | |
tree | 72ee5bd5a2ddcf6c5a238961cc49d2161c41139f /scripts | |
parent | daf94a4bab985b33f17d6b8474c49213bead4f84 (diff) | |
download | vyos-build-c0cae8b7fec0d5e8a7c8ff9418397587e967fd15.tar.gz vyos-build-c0cae8b7fec0d5e8a7c8ff9418397587e967fd15.zip |
Add configure script support for Debian mirror options.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build-config | 12 | ||||
-rw-r--r-- | scripts/defaults.py | 3 |
2 files changed, 13 insertions, 2 deletions
diff --git a/scripts/build-config b/scripts/build-config index 542c4665..f04dcb3f 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -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: diff --git a/scripts/defaults.py b/scripts/defaults.py index 96dfcc98..05f05973 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -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/' |