From b7d90580b3f3f6364704af78e631968ae2157fb7 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Sat, 30 Jan 2021 17:02:32 +0100 Subject: [PATCH] Introduce support for "unmaintained" devices (MR 1912) 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: 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. --- .gitlab-ci/check_devices_in_wiki.py | 8 ++++++++ .gitlab-ci/testcases/test_device.py | 11 +++++++++++ .gitlab-ci/testcases/test_directory_structure.py | 1 + 3 files changed, 20 insertions(+) diff --git a/.gitlab-ci/check_devices_in_wiki.py b/.gitlab-ci/check_devices_in_wiki.py index 3b878f792..6bf603f90 100755 --- a/.gitlab-ci/check_devices_in_wiki.py +++ b/.gitlab-ci/check_devices_in_wiki.py @@ -16,6 +16,14 @@ def get_devices(): "/.."))) for path in glob.glob(pmaports + "/device/*/device-*/"): device = os.path.dirname(path).split("device-", 1)[1] + + # -downstream suffix is used when packaging the downstream kernel for + # devices that have a working mainline kernel. Those are usually + # unmaintained and therefore might not appear in the wiki. However, + # the main device should be documented (remove the -downstream suffix). + if device.endswith('-downstream'): + device = device[:-len('-downstream')] + ret.append(device) return sorted(ret) diff --git a/.gitlab-ci/testcases/test_device.py b/.gitlab-ci/testcases/test_device.py index 4d9d5995b..5fd49b04d 100644 --- a/.gitlab-ci/testcases/test_device.py +++ b/.gitlab-ci/testcases/test_device.py @@ -115,3 +115,14 @@ def test_aports_maintained(args): continue maintainers = pmb.parse._apkbuild.maintainers(path) assert maintainers, f"{path} in community needs at least 1 Maintainer" + + +def test_aports_unmaintained(args): + """ + Ensure that aports in /device/unmaintained have an "Unmaintained:" comment + that describes why the aport is unmaintained. + """ + for path in glob.iglob(f"{args.aports}/device/unmaintained/*/APKBUILD"): + unmaintained = pmb.parse._apkbuild.unmaintained(path) + assert unmaintained, f"{path} should have an Unmaintained: " +\ + "comment that describes why the package is unmaintained" diff --git a/.gitlab-ci/testcases/test_directory_structure.py b/.gitlab-ci/testcases/test_directory_structure.py index 5566558a4..5f7af3766 100644 --- a/.gitlab-ci/testcases/test_directory_structure.py +++ b/.gitlab-ci/testcases/test_directory_structure.py @@ -10,6 +10,7 @@ expected_directories = [ "device/community", "device/main", "device/testing", + "device/unmaintained", "kde", "maemo", "main",