diff --git a/pmb/helpers/other.py b/pmb/helpers/other.py index 9c1d72113505a638e148f31c1e342fd71907807a..c30aee32aaab07e808753a9e186431c5b8883aca 100644 --- a/pmb/helpers/other.py +++ b/pmb/helpers/other.py @@ -24,6 +24,14 @@ import pmb.config import pmb.helpers.run +def getpackagelist(aportsdir): + packages=set() + for dir in os.listdir(aportsdir): + for package in os.listdir('aports/'+dir): + packages.add(package) + return packages + + def folder_size(args, path): """ Run `du` to calculate the size of a folder (this is less code and diff --git a/pmb/parse/arguments.py b/pmb/parse/arguments.py index 62be77acac13508a1f870f0fddfe5086f8cc2a06..c61d1f6ced6618103505eb70f38dcc00042408cb 100644 --- a/pmb/parse/arguments.py +++ b/pmb/parse/arguments.py @@ -430,7 +430,7 @@ def arguments(): " is incompatible with how Alpine's abuild handles it.", dest="ignore_depends") for action in [checksum, build, aportgen]: - action.add_argument("packages", nargs="+") + action.add_argument("packages", nargs="+", metavar="PACKAGES", choices=pmb.helpers.other.getpackagelist("aports")) # Action: kconfig_check / apkbuild_parse kconfig_check = sub.add_parser("kconfig_check", help="check, whether all"