diff options
-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 542c466..f04dcb3 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 96dfcc9..05f0597 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/' |