From 4637fd6697bc225774a4395d8a891bc2f4dbecd1 Mon Sep 17 00:00:00 2001 From: Haibo Lin Date: Mon, 6 Feb 2023 16:12:37 +0800 Subject: [PATCH] Log versions of all installed packages JIRA: RHELCMP-9493 Signed-off-by: Haibo Lin (cherry picked from commit 8c06b7a3f17019e9f0ccaef75b2dac11d897c4f7) --- pungi/scripts/pungi_koji.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pungi/scripts/pungi_koji.py b/pungi/scripts/pungi_koji.py index aefbd60c..5848f0a1 100644 --- a/pungi/scripts/pungi_koji.py +++ b/pungi/scripts/pungi_koji.py @@ -382,6 +382,14 @@ def run_compose( compose.log_info("Current timezone offset: %s" % pungi.util.get_tz_offset()) compose.log_info("COMPOSE_ID=%s" % compose.compose_id) + installed_pkgs_log = compose.paths.log.log_file("global", "installed-pkgs") + compose.log_info("Logging installed packages to %s" % installed_pkgs_log) + try: + with open(installed_pkgs_log, "w") as f: + subprocess.Popen(["rpm", "-qa"], stdout=f) + except Exception as e: + compose.log_warning("Failed to log installed packages: %s" % str(e)) + compose.read_variants() # dump the config file