diff options
author | Ryan Harper <ryan.harper@canonical.com> | 2020-07-24 12:59:49 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-24 13:59:49 -0400 |
commit | 456fb55744a1acc6bd2f464b7656a9c33d0b7ac5 (patch) | |
tree | 85d58b01af5d8673e12c9f96c08ce5c90118f721 /tools | |
parent | b70aec8e5ed59298e9fbd5da449350dd3d0002d2 (diff) | |
download | vyos-cloud-init-456fb55744a1acc6bd2f464b7656a9c33d0b7ac5.tar.gz vyos-cloud-init-456fb55744a1acc6bd2f464b7656a9c33d0b7ac5.zip |
fix brpm building
tools/read-dependencies:
- Add parameters --build-requires, --runtime-requires
- Sort dependency output before printing
package/brpm
- use --build-requires, --runtime-requires to separate build/vs runtime package reqs.
LP: #1886107
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/read-dependencies | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/tools/read-dependencies b/tools/read-dependencies index fd1946a5..6ad5f701 100755 --- a/tools/read-dependencies +++ b/tools/read-dependencies @@ -101,6 +101,14 @@ def get_parser(): parser.add_argument( '-d', '--distro', type=str, choices=DISTRO_PKG_TYPE_MAP.keys(), help='The name of the distro to generate package deps for.') + deptype = parser.add_mutually_exclusive_group() + deptype.add_argument( + '-R', '--runtime-requires', action='store_true', default=False, + dest='runtime_requires', + help='Print only runtime required packages') + deptype.add_argument( + '-b', '--build-requires', action='store_true', default=False, + dest='build_requires', help='Print only buildtime required packages') parser.add_argument( '--dry-run', action='store_true', default=False, dest='dry_run', help='Dry run the install, making no package changes.') @@ -222,15 +230,24 @@ def main(distro): translated_pip_names = translate_pip_to_system_pkg( pip_pkg_names, renames) all_deps = [] + select_requires = [args.build_requires, args.runtime_requires] if args.distro: - all_deps.extend( - translated_pip_names + deps_from_json['requires'] + - deps_from_json['build-requires']) + if not any(select_requires): + all_deps.extend( + translated_pip_names + deps_from_json['requires'] + + deps_from_json['build-requires']) + else: + if args.build_requires: + all_deps.extend(deps_from_json['build-requires']) + else: + all_deps.extend( + translated_pip_names + deps_from_json['requires']) else: if args.system_pkg_names: all_deps = translated_pip_names else: all_deps = pip_pkg_names + all_deps = sorted(all_deps) if args.install: pkg_install(all_deps, args.distro, args.test_distro, args.dry_run) else: |