diff --git a/tools/autoupdate_app_sources/autoupdate_app_sources.py b/tools/autoupdate_app_sources/autoupdate_app_sources.py index 34b81fb4..3a074a19 100755 --- a/tools/autoupdate_app_sources/autoupdate_app_sources.py +++ b/tools/autoupdate_app_sources/autoupdate_app_sources.py @@ -27,6 +27,7 @@ from rest_api import ( DownloadPageAPI, RefType, ) # noqa: E402,E501 pylint: disable=import-error,wrong-import-position +import appslib.get_apps_repo as get_apps_repo import appslib.logging_sender # noqa: E402 pylint: disable=import-error,wrong-import-position from appslib.utils import ( get_catalog, @@ -89,10 +90,10 @@ def get_github() -> tuple[ return None, None, None -def apps_to_run_auto_update_for() -> list[str]: +def apps_to_run_auto_update_for(apps_repo: Path) -> list[str]: apps_flagged_as_working_and_on_yunohost_apps_org = [ app - for app, infos in get_catalog().items() + for app, infos in get_catalog(apps_repo).items() if infos["state"] == "working" and "/github.com/yunohost-apps" in infos["url"].lower() ] @@ -744,6 +745,7 @@ def main() -> None: parser.add_argument( "-j", "--processes", type=int, default=multiprocessing.cpu_count() ) + get_apps_repo.add_args(parser) args = parser.parse_args() appslib.logging_sender.enable() @@ -756,10 +758,12 @@ def main() -> None: sys.exit(1) # Handle apps or no apps - apps = list(args.apps) if args.apps else apps_to_run_auto_update_for() + apps = list(args.apps) if args.apps else apps_to_run_auto_update_for(get_apps_repo.from_args(args)) apps_already = {} # for which a PR already exists apps_updated = {} apps_failed = {} + print(apps) + exit() with multiprocessing.Pool(processes=args.processes) as pool: tasks = pool.imap(