From 2887fdc8f02fdbba53ec171976ea5c9d9df4d659 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Tue, 5 Nov 2024 17:18:13 +0100 Subject: [PATCH] csmock: install dynamic build dependencies, too Use the `--calculate-build-dependencies` option of `mock` instead of the `--installdeps` option, which installs static build dependencies only. Fixes: https://github.com/csutils/csmock/issues/188 Closes: https://github.com/csutils/csmock/pull/189 --- make-srpm.sh | 2 +- py/csmock | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/make-srpm.sh b/make-srpm.sh index 8092c8d..75fe596 100755 --- a/make-srpm.sh +++ b/make-srpm.sh @@ -128,7 +128,7 @@ Summary: Core of csmock (a mock wrapper for Static Analysis tools) Requires: csdiff > 3.1.0 Requires: csgcca Requires: cswrap -Requires: mock +Requires: mock >= 5.7 Requires: tar Requires: xz %if 0%{?rhel} != 7 diff --git a/py/csmock b/py/csmock index 0fd54ac..13b43c3 100755 --- a/py/csmock +++ b/py/csmock @@ -351,7 +351,8 @@ echo \"$self_pid\" > \"$lock_file\"'" \ cmd = ["--install", "module-build-macros"] + cmd_add self.exec_mock_cmd(cmd, quiet=quiet) - cmd = ["--installdeps", srpm] + cmd_add + # install both static and dynamic build dependencies (replacement for --installdeps) + cmd = ["--calculate-build-dependencies", srpm] + cmd_add return (self.exec_mock_cmd(cmd, quiet=quiet) == 0) def emergency_install_pkgs(self, pkgs): @@ -385,7 +386,7 @@ echo \"$self_pid\" > \"$lock_file\"'" \ continue self.init_done = True - # run `mock --installdeps` + # run `mock --calculate-build-dependencies` srpm_deps_ok = srpm is None or self.install_deps(srpm) if not srpm_deps_ok and not try_only: srpm_base = os.path.basename(srpm)