From 46b708295abd61f048b0bd9c68e1ecc16ac9f1de Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sat, 8 Apr 2023 02:28:10 +0200 Subject: [PATCH] pmb.config.pmaports: replace aports split msg When running a pmbootstrap command and the pmaports dir does not exist, it would print the following error: WARNING: Can't create log file in '/home/user/.local/var/pmbootstrap', path does not exist! [02:14:37] ERROR: We have split the aports repository from the pmbootstrap repository (#383). Please run 'pmbootstrap init' again to clone it. [02:14:37] See also: Run 'pmbootstrap log' for details. Alternatively you can use '--details-to-stdout' to get more output, e.g. 'pmbootstrap --details-to-stdout init'. This is long obsolete. By now the reason for the missing pmaports dir is not that we had moved it from pmbootstrap.git to a separate git repository, it's most likely that the user did not run 'pmbootstrap init'. Adjust the message, and quit without link to troubleshooting etc: [02:15:28] ERROR: pmaports dir not found: /home/user/.local/var/pmbootstrap/cache_git/pmaports [02:15:28] Did you run 'pmbootstrap init'? Reviewed-by: Luca Weiss Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230408002810.2006-1-ollieparanoid@postmarketos.org%3E --- pmb/config/pmaports.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pmb/config/pmaports.py b/pmb/config/pmaports.py index 8e676994..59da427a 100644 --- a/pmb/config/pmaports.py +++ b/pmb/config/pmaports.py @@ -3,6 +3,7 @@ import configparser import logging import os +import sys import pmb.config import pmb.helpers.git @@ -89,9 +90,9 @@ def read_config(args): # Migration message if not os.path.exists(args.aports): - raise RuntimeError("We have split the aports repository from the" - " pmbootstrap repository (#383). Please run" - " 'pmbootstrap init' again to clone it.") + logging.error(f"ERROR: pmaports dir not found: {args.aports}") + logging.error("Did you run 'pmbootstrap init'?") + sys.exit(1) # Require the config path_cfg = args.aports + "/pmaports.cfg"