WIP: pmbootstrap deviceinfo_parse

Quick and dirty version, that takes pkgnames as argument instead of
device names (which would make more sense, like kconfig_check).

Used this to debug #1325.
This commit is contained in:
Oliver Smith 2018-03-12 21:15:28 +01:00
parent 0aaa19a612
commit 8a0413ba93
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
2 changed files with 19 additions and 2 deletions

View File

@ -257,6 +257,22 @@ def kconfig_check(args):
raise RuntimeError("kconfig_check failed!")
def deviceinfo_parse(args):
# Default to all packages
packages = args.packages
if not packages:
for deviceinfo in glob.glob(args.aports + "/device/device-*/deviceinfo"):
packages.append(os.path.basename(os.path.dirname(deviceinfo)))
# Iterate over all packages
packages.sort()
for package in packages:
print(package + ":")
device = package[len("device-"):]
print(json.dumps(pmb.parse.deviceinfo(args, device), indent=4,
sort_keys=True))
def apkbuild_parse(args):
# Default to all packages
packages = args.packages

View File

@ -347,12 +347,13 @@ def arguments():
for action in [checksum, build, aportgen]:
action.add_argument("packages", nargs="+")
# Action: kconfig_check / apkbuild_parse
# Action: kconfig_check / deviceinfo_parse / apkbuild_parse
kconfig_check = sub.add_parser("kconfig_check", help="check, whether all"
" the necessary options are"
" enabled/disabled in the kernel config")
apkbuild_parse = sub.add_parser("apkbuild_parse")
for action in [kconfig_check, apkbuild_parse]:
deviceinfo_parse = sub.add_parser("deviceinfo_parse")
for action in [kconfig_check, apkbuild_parse, deviceinfo_parse]:
action.add_argument("packages", nargs="*")
# Action: apkindex_parse