From b6b102cc885d47ac98490ed9b873fe3316c55c2b Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 12 May 2024 17:59:17 +0200 Subject: [PATCH] fix: slackware --- pep600_compliance/images/package_manager.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pep600_compliance/images/package_manager.py b/pep600_compliance/images/package_manager.py index a00bef7..2581490 100644 --- a/pep600_compliance/images/package_manager.py +++ b/pep600_compliance/images/package_manager.py @@ -167,6 +167,10 @@ def _update(self, container): ["touch", "/var/lib/slackpkg/current"] ) assert exit_code == 0, output.decode("utf-8") + exit_code, output = container.exec_run( + ["sed", "-i", "s/CHECKGPG=on/CHECKGPG=off/g", "/etc/slackpkg/slackpkg.conf"] + ) + assert exit_code == 0, output.decode("utf-8") super()._update(container) def _upgrade(self, container): @@ -175,13 +179,10 @@ def _upgrade(self, container): ["slackpkg", "-default_answer=yes", "-batch=on", "install-new"] ) assert exit_code == 0, output.decode("utf-8") - exit_code, output = container.exec_run( - ["slackpkg", "-default_answer=yes", "-batch=on", "upgrade-all"] - ) - assert exit_code in {0, 20, 50}, output.decode("utf-8") - if exit_code == 50: + exit_code = 50 + while exit_code == 50: # Slackpkg itself was upgraded and you need to re-run it. exit_code, output = container.exec_run( ["slackpkg", "-default_answer=yes", "-batch=on", "upgrade-all"] ) - assert exit_code == {0, 20}, output.decode("utf-8") + assert exit_code in {0, 20, 50}, f"exit_code: {exit_code}\n" + output.decode("utf-8")