From 558074f35e4db493470992768ef7e55272f2b666 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 12 May 2024 19:02:00 +0200 Subject: [PATCH] Update package_manager.py --- pep600_compliance/images/package_manager.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pep600_compliance/images/package_manager.py b/pep600_compliance/images/package_manager.py index d14a115..2581490 100644 --- a/pep600_compliance/images/package_manager.py +++ b/pep600_compliance/images/package_manager.py @@ -179,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")