Skip to content
Snippets Groups Projects
Commit 8c9c0ce9 authored by Grant Miller's avatar Grant Miller Committed by Oliver Smith
Browse files

Check if device was renamed

parent d3780364
No related branches found
No related tags found
No related merge requests found
Pipeline #188598 failed
......@@ -222,6 +222,11 @@ def ask_for_device(args):
device_exists = os.path.exists(args.aports + "/device/device-" +
device + "/deviceinfo")
if not device_exists:
if device == args.device:
raise RuntimeError(
"This device does not exist anymore, check"
" <https://postmarketos.org/renamed>"
" to see if it was renamed")
logging.info("You are about to do a new device port for '" +
device + "'.")
if not pmb.helpers.cli.confirm(args, default=True):
......
......@@ -57,12 +57,10 @@ def deviceinfo(args, device=None):
aport = args.aports + "/device/device-" + device
if not os.path.exists(aport) or not os.path.exists(aport + "/deviceinfo"):
logging.fatal("You will need to create a device-specific package")
logging.fatal("before you can continue. Please create at least the")
logging.fatal("following files:")
logging.fatal(aport + "/APKBUILD")
logging.fatal(aport + "/deviceinfo")
raise RuntimeError("Incomplete device information")
raise RuntimeError(
"Device '" + device + "' not found. Run 'pmbootstrap init' to"
" start a new device port or to choose another device. It may have"
" been renamed, see <https://postmarketos.org/renamed>")
ret = {}
path = aport + "/deviceinfo"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment