diff options
author | Daniil Baturin <daniil@baturin.org> | 2024-11-29 12:14:54 +0000 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2024-11-29 12:16:10 +0000 |
commit | 5de2b12d0b6655eb876a31e860164c5ffe178321 (patch) | |
tree | 5812416971dd6e5e5c45bd8ddc4ce8cc8382192c | |
parent | c62fef71fc89136d15cba695d2cbab8929892482 (diff) | |
download | vyos-build-5de2b12d0b6655eb876a31e860164c5ffe178321.tar.gz vyos-build-5de2b12d0b6655eb876a31e860164c5ffe178321.zip |
build: T6923: use the Debian mirror for security updates if it's specified explicitly
but the security mirror is not
-rwxr-xr-x | scripts/image-build/build-vyos-image | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/image-build/build-vyos-image b/scripts/image-build/build-vyos-image index dfa5dfbe..72cef78b 100755 --- a/scripts/image-build/build-vyos-image +++ b/scripts/image-build/build-vyos-image @@ -260,14 +260,18 @@ if __name__ == "__main__": pre_build_config = merge_defaults(args, defaults=pre_build_config, skip_none=True) # 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 pre_build_config['debian_mirror'] is None or pre_build_config['debian_security_mirror'] is None: - print("E: debian_mirror and debian_security_mirror cannot be empty") + # The idea is: if --debian-mirror is specified + # but --pbuilder-debian-mirror or --debian-security-mirror are not, + # use the --debian-mirror value for those + if pre_build_config['debian_mirror'] is None: + print("E: debian_mirror must be specified") sys.exit(1) if pre_build_config['pbuilder_debian_mirror'] is None: - args['pbuilder_debian_mirror'] = pre_build_config['pbuilder_debian_mirror'] = pre_build_config['debian_mirror'] + pre_build_config['pbuilder_debian_mirror'] = pre_build_config['debian_mirror'] + + if pre_build_config['debian_security_mirror'] is None: + pre_build_config['debian_security_mirror'] = pre_build_config['debian_mirror'] # Validate characters in version name if args.get('version'): @@ -299,6 +303,11 @@ if __name__ == "__main__": build_config = merge_defaults(flavor_config, defaults=build_config) build_config = merge_defaults(args, defaults=build_config, skip_none=True) + # If Debian mirror is specified explicitly but Debian security mirror is not, + # assume that the user wants to use that mirror for security updates as well. + if (args['debian_mirror'] is not None) and (args['debian_security_mirror'] is None): + build_config['debian_security_mirror'] = args['debian_mirror'] + ## Rename and merge some fields for simplicity ## E.g. --custom-packages is for the user, but internally ## it's added to the same package list as everything else |