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: <https://postmarketos.org/troubleshooting>
  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 <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230408002810.2006-1-ollieparanoid@postmarketos.org%3E
This commit is contained in:
Oliver Smith 2023-04-08 02:28:10 +02:00
parent 10fd860837
commit 46b708295a
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 4 additions and 3 deletions

View File

@ -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"