pmb: Introduce support for "unmaintained" devices (MR 2018)

Unmaintained devices are device packages that:
  - Are known to be broken in some way without an active maintainer
    who can investigate how to fix it, or
  - Have not received any updates for a very long time, or
  - Are discouraged from using because they are just intended for testing.
    An example for this are ports using the downstream kernel for devices
    which have a mainline port that is working quite well.

Unmaintained devices are still built by bpo (otherwise it would not make
sense to keep them), but they do not show up in "pmbootstrap init".
However, it is possible to manually select them by entering the name.
pmbootstrap will warn in that case.

Unmaintained packages should have a # Unmaintained: <reason> comment
in the APKBUILD, this comment is displayed in "pmbootstrap init"
so that the user knows why the device should not be used unless they
know what they are doing.
This commit is contained in:
Minecrell 2021-01-30 13:21:12 +01:00 committed by Oliver Smith
parent 03b3b250a5
commit 7dc2e197d3
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
5 changed files with 35 additions and 3 deletions

View file

@ -301,7 +301,8 @@ def ask_for_device(args):
if not pmb.helpers.cli.confirm(args, default=True):
continue
else:
devices = sorted(pmb.helpers.devices.list_codenames(args, vendor))
# Unmaintained devices can be selected, but are not displayed
devices = sorted(pmb.helpers.devices.list_codenames(args, vendor, unmaintained=False))
# Remove "vendor-" prefixes from device list
codenames = [x.split('-', 1)[1] for x in devices]
logging.info("Available codenames (" + str(len(codenames)) + "): " +
@ -314,7 +315,8 @@ def ask_for_device(args):
codenames)
device = vendor + '-' + codename
device_exists = pmb.helpers.devices.find_path(args, device, 'deviceinfo') is not None
device_path = pmb.helpers.devices.find_path(args, device, 'deviceinfo')
device_exists = device_path is not None
if not device_exists:
if device == args.device:
raise RuntimeError(
@ -331,6 +333,12 @@ def ask_for_device(args):
logging.info("Generating new aports for: {}...".format(device))
pmb.aportgen.generate(args, "device-" + device)
pmb.aportgen.generate(args, "linux-" + device)
elif "/unmaintained/" in device_path:
apkbuild = device_path[:-len("deviceinfo")] + 'APKBUILD'
unmaintained = pmb.parse._apkbuild.unmaintained(apkbuild)
logging.info(f"WARNING: {device} is unmaintained: {unmaintained}")
if not pmb.helpers.cli.confirm(args):
continue
break
kernel = ask_for_device_kernel(args, device)