diff options
author | James Simpson <james.simpson@canonical.com> | 2022-11-07 13:50:34 +0800 |
---|---|---|
committer | jsimpso <james.simpson@canonical.com> | 2022-11-07 14:26:49 +0800 |
commit | f4bfaa9b9782a7b255f9240270e4629711b62f86 (patch) | |
tree | b3770395d6fc10d638e3cc254fe5002a532726e6 /scripts | |
parent | 048aa40655583543b8e67313f7d57307592910cc (diff) | |
download | vyos-build-f4bfaa9b9782a7b255f9240270e4629711b62f86.tar.gz vyos-build-f4bfaa9b9782a7b255f9240270e4629711b62f86.zip |
T4796: Move and update custom_apt_entry logic
Rather than only looking at the default config, look at the merged
build_config.
Check wether additional_repositories is actually defined before trying
to reference it.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build-vyos-image | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/build-vyos-image b/scripts/build-vyos-image index a9859ee6..5242a7dd 100755 --- a/scripts/build-vyos-image +++ b/scripts/build-vyos-image @@ -206,10 +206,6 @@ if __name__ == "__main__": print("Use --build-type=release option if you want to set version number") sys.exit(1) - if not args['custom_apt_entry']: - args['custom_apt_entry'] = [] - args['custom_apt_entry'] = args['custom_apt_entry'] + build_defaults['additional_repositories'] - ## Inject some useful hardcoded options args['build_dir'] = defaults.BUILD_DIR args['pbuilder_config'] = os.path.join(defaults.BUILD_DIR, defaults.PBUILDER_CONFIG) @@ -385,6 +381,10 @@ if __name__ == "__main__": f.write(vyos_repo_entry) # Add custom APT entries + if not args['custom_apt_entry']: + args['custom_apt_entry'] = [] + if build_config['additional_repositories']: + args['custom_apt_entry'] = args['custom_apt_entry'] + build_config['additional_repositories'] if build_config['custom_apt_entry']: custom_apt_file = defaults.CUSTOM_REPO_FILE entries = "\n".join(build_config['custom_apt_entry']) |