From 8da12a98a74a34e53c8e2e0084e86851b479e01a Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Mon, 8 Jul 2024 18:02:13 +0200 Subject: [PATCH] helpers: other: drop args from migrate_work_folder() (MR 2352) Was erronesously passing args to cli.confirm. Signed-off-by: Caleb Connolly --- pmb/__init__.py | 2 +- pmb/config/init.py | 2 +- pmb/helpers/other.py | 15 +++++++-------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/pmb/__init__.py b/pmb/__init__.py index 1afeb722..c5fcbb73 100644 --- a/pmb/__init__.py +++ b/pmb/__init__.py @@ -80,7 +80,7 @@ def main() -> int: # Migrate work folder if necessary if args.action not in ["shutdown", "zap", "log"]: - other.migrate_work_folder(args) + other.migrate_work_folder() # Run the function with the action's name (in pmb/helpers/frontend.py) if args.action: diff --git a/pmb/config/init.py b/pmb/config/init.py index 9be16605..42a4a98e 100644 --- a/pmb/config/init.py +++ b/pmb/config/init.py @@ -679,7 +679,7 @@ def frontend(args: PmbArgs): pmb.config.save(args.config, config) # Migrate work dir if necessary - pmb.helpers.other.migrate_work_folder(args) + pmb.helpers.other.migrate_work_folder() # Clone pmaports pmb.config.pmaports.init() diff --git a/pmb/helpers/other.py b/pmb/helpers/other.py index 6ad18602..acb76397 100644 --- a/pmb/helpers/other.py +++ b/pmb/helpers/other.py @@ -9,7 +9,6 @@ import re import pmb.chroot import pmb.config import pmb.config.init -from pmb.types import PmbArgs import pmb.helpers.pmaports import pmb.helpers.run from typing import Any @@ -78,7 +77,7 @@ def migrate_success(work: Path, version): handle.write(str(version) + "\n") -def migrate_work_folder(args: PmbArgs): +def migrate_work_folder(): # Read current version context = get_context() current = 0 @@ -104,7 +103,7 @@ def migrate_work_folder(args: PmbArgs): logging.info("Migration will do the following:") logging.info("* Zap your chroots") logging.info(f"* Adjust '{context.config.work / 'config_abuild/abuild.conf'}'") - if not pmb.helpers.cli.confirm(args): + if not pmb.helpers.cli.confirm(): raise RuntimeError("Aborted.") # Zap and update abuild.conf @@ -123,7 +122,7 @@ def migrate_work_folder(args: PmbArgs): logging.info("* Fix: cache_distfiles was writable for everyone") logging.info("Migration will do the following:") logging.info(f"* Fix permissions of '{context.config.work / 'cache_distfiles'}'") - if not pmb.helpers.cli.confirm(args): + if not pmb.helpers.cli.confirm(): raise RuntimeError("Aborted.") # Fix permissions @@ -143,7 +142,7 @@ def migrate_work_folder(args: PmbArgs): logging.info("* Device chroots have a different user UID (#1576)") logging.info("Migration will do the following:") logging.info("* Zap your chroots") - if not pmb.helpers.cli.confirm(args): + if not pmb.helpers.cli.confirm(): raise RuntimeError("Aborted.") # Zap chroots @@ -162,7 +161,7 @@ def migrate_work_folder(args: PmbArgs): logging.info("Migration will do the following:") logging.info("* Check if 'git' is installed") logging.info(f"* Change ownership to your user: {path}") - if not pmb.helpers.cli.confirm(args): + if not pmb.helpers.cli.confirm(): raise RuntimeError("Aborted.") # Require git, set cache_git ownership @@ -184,7 +183,7 @@ def migrate_work_folder(args: PmbArgs): logging.info("Migration will do the following:") logging.info("* Move existing packages to edge subdir (if any)") logging.info("* Zap your chroots") - if not pmb.helpers.cli.confirm(args): + if not pmb.helpers.cli.confirm(): raise RuntimeError("Aborted.") # Zap chroots @@ -222,7 +221,7 @@ def migrate_work_folder(args: PmbArgs): logging.info(f" {context.config.work}/packages") logging.info(" stable => v20.05") logging.info(" stable-next => v21.03") - if not pmb.helpers.cli.confirm(args): + if not pmb.helpers.cli.confirm(): raise RuntimeError("Aborted.") # Zap chroots to avoid potential "ERROR: Chroot 'native' was created