diff --git a/buildchain/buildchain/packaging.py b/buildchain/buildchain/packaging.py index 75f43b22ff..f3aff37991 100644 --- a/buildchain/buildchain/packaging.py +++ b/buildchain/buildchain/packaging.py @@ -144,7 +144,7 @@ def clean() -> None: '_build_rpm_container' ], 'clean': [clean], - 'uptodate': [config_changed(_TO_DOWNLOAD_CONFIG)], + 'uptodate': [config_changed(_TO_DOWNLOAD_RPM_CONFIG)], # Prevent Docker from polluting our output. 'verbosity': 0, } @@ -324,18 +324,27 @@ def _deb_package(name: str, sources: Path) -> targets.DEBPackage: ) +def _list_packages_to_download( + package_versions: Tuple[versions.Package, ...], + packages_to_build: List[str] +) -> Dict[str,str]: + return { + pkg.name: "{p.version}-{p.release}".format(p=pkg) + for pkg in package_versions + if pkg.name not in packages_to_build + } + # Store these versions in a dict to use with doit.tools.config_changed -_TO_DOWNLOAD_CONFIG : Dict[str, str] = { - pkg.name: "{p.version}-{p.release}".format(p=pkg) - for pkg in versions.RPM_PACKAGES - if pkg.name not in _RPM_TO_BUILD_PKG_NAMES -} +_TO_DOWNLOAD_RPM_CONFIG : Dict[str, str] = _list_packages_to_download( + versions.PACKAGES, + _RPM_TO_BUILD_PKG_NAMES +) -_TO_DOWNLOAD_DEB_CONFIG : Dict[str, str] = { - pkg.name: "{p.version}-{p.release}".format(p=pkg) - for pkg in versions.DEB_PACKAGES - if pkg.name not in _DEB_TO_BUILD_PKG_NAMES -} +# Store these versions in a dict to use with doit.tools.config_changed +_TO_DOWNLOAD_DEB_CONFIG : Dict[str, str] = _list_packages_to_download( + versions.DEB_PACKAGES, + _DEB_TO_BUILD_PKG_NAMES +) SCALITY_RPM_REPOSITORY = targets.RPMRepository(