treewide: Rename unmaintained to archived (MR 2308)

See https://gitlab.com/postmarketOS/pmaports/-/merge_requests/5046
This commit is contained in:
Newbyte 2024-05-06 23:12:04 +02:00 committed by Pablo Correa Gómez
parent d28174bf95
commit 0df75422b4
No known key found for this signature in database
GPG Key ID: 7A342565FF635F79
5 changed files with 18 additions and 18 deletions

View File

@ -404,9 +404,9 @@ def ask_for_device(args):
if not pmb.helpers.cli.confirm(args, default=True):
continue
else:
# Unmaintained devices can be selected, but are not displayed
# Archived devices can be selected, but are not displayed
devices = sorted(pmb.helpers.devices.list_codenames(
args, vendor, unmaintained=False))
args, vendor, archived=False))
# Remove "vendor-" prefixes from device list
codenames = [x.split('-', 1)[1] for x in devices]
logging.info(f"Available codenames ({len(codenames)}): " +
@ -437,10 +437,10 @@ def ask_for_device(args):
logging.info("Generating new aports for: {}...".format(device))
pmb.aportgen.generate(args, f"device-{device}")
pmb.aportgen.generate(args, f"linux-{device}")
elif "/unmaintained/" in device_path:
elif "/archived/" in device_path:
apkbuild = f"{device_path[:-len('deviceinfo')]}APKBUILD"
unmaintained = pmb.parse._apkbuild.unmaintained(apkbuild)
logging.info(f"WARNING: {device} is unmaintained: {unmaintained}")
archived = pmb.parse._apkbuild.archived(apkbuild)
logging.info(f"WARNING: {device} is archived: {archived}")
if not pmb.helpers.cli.confirm(args):
continue
break

View File

@ -23,16 +23,16 @@ def find_path(args, codename, file=''):
return g[0]
def list_codenames(args, vendor=None, unmaintained=True):
def list_codenames(args, vendor=None, archived=True):
"""Get all devices, for which aports are available.
:param vendor: vendor name to choose devices from, or None for all vendors
:param unmaintained: include unmaintained devices
:param archived: include archived devices
:returns: ["first-device", "second-device", ...]
"""
ret = []
for path in glob.glob(args.aports + "/device/*/device-*"):
if not unmaintained and '/unmaintained/' in path:
if not archived and '/archived/' in path:
continue
device = os.path.basename(path).split("-", 1)[1]
if (vendor is None) or device.startswith(vendor + '-'):

View File

@ -436,15 +436,15 @@ def maintainers(path):
return maintainers
def unmaintained(path):
def archived(path):
"""
Return if (and why) an APKBUILD might be unmaintained. This should be
defined using a # Unmaintained: <reason> tag in the APKBUILD.
Return if (and why) an APKBUILD might be archived. This should be
defined using a # Archived: <reason> tag in the APKBUILD.
:param path: full path to the APKBUILD
:returns: reason why APKBUILD is unmaintained, or None
:returns: reason why APKBUILD is archived, or None
"""
unmaintained = _parse_comment_tags(read_file(path), 'Unmaintained')
if not unmaintained:
archived = _parse_comment_tags(read_file(path), 'Archived')
if not archived:
return None
return '\n'.join(unmaintained)
return '\n'.join(archived)

View File

@ -155,10 +155,10 @@ def test_parse_maintainers(args):
assert pmb.parse._apkbuild.maintainers(path) == maintainers
def test_parse_unmaintained(args):
def test_parse_archived(args):
path = (f"{pmb_test.const.testdata}/apkbuild"
"/APKBUILD.missing-pkgdesc-in-subpackage")
assert pmb.parse._apkbuild.unmaintained(path) == "This is broken!"
assert pmb.parse._apkbuild.archived(path) == "This is broken!"
def test_weird_pkgver(args):

View File

@ -1,5 +1,5 @@
# Reference: <https://postmarketos.org/devicepkg>
# Unmaintained: This is broken!
# Archived: This is broken!
pkgname="missing-pkgdesc-in-subpackage"
arch="noarch"
subpackages="$pkgname-subpackage invalid-function:does_not_exist"