]> git.seodisparate.com - AnotherAURHelper/commitdiff
Fix get_sudo_privileges depending on global
authorStephen Seo <seo.disparate@gmail.com>
Fri, 17 Nov 2023 11:51:26 +0000 (20:51 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Fri, 17 Nov 2023 11:51:26 +0000 (20:51 +0900)
Another function that depended on "other_state" being global was fixed.

update.py

index 15c1aa5d78128859757fb937ec38332adbc6a8c9..caf4b4bfd7b9f1971095ba25087842a5b8d01b1c 100755 (executable)
--- a/update.py
+++ b/update.py
@@ -940,7 +940,7 @@ def get_pkg_current_version(pkg: str, pkg_state: dict[str, Any], repo: str):
     return "fetched", current_epoch, current_version
 
 
-def get_sudo_privileges():
+def get_sudo_privileges(other_state: dict[str, Any]):
     """Starts a bash loop that ensures sudo privileges are ready while this
     script is active."""
 
@@ -1205,7 +1205,7 @@ def update_pkg_list(
 
     atexit.register(build_print_pkg_info, pkgs, other_state)
 
-    if not get_sudo_privileges():
+    if not get_sudo_privileges(other_state):
         log_print(
             "ERROR: Failed to get sudo privileges", other_state=other_state
         )
@@ -2052,7 +2052,7 @@ def main():
             os.path.dirname(os.path.realpath(other_state["chroot"])),
             "tmpfs_chroot",
         )
-        get_sudo_privileges()
+        get_sudo_privileges(other_state)
         try:
             old_umask = os.umask(0o077)
             log_print(