Fix #839: Check pkgver after parsing APKBUILD / various small improvements (#854)

Small improvements:
* Allow to specify multiple packages to `pmbootstrap parse_apkbuild`
* Specifying no package will parse all packages (like kconfig_check)
  (also `parse_apkbuild`)
* JSON output is sorted of `parse_apkbuild`
* Make pkgver check optional, so we can disable it in the device wizard test case
* Parse_apk* -> apk*_parse
* Don't let the user mess with globs (disallow '*' in pkgname)
This commit is contained in:
Oliver Smith 2018-01-18 22:05:27 +00:00 committed by GitHub
parent 0bc60138f3
commit 0ae23afa60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 47 additions and 21 deletions

View file

@ -244,13 +244,24 @@ def kconfig_check(args):
raise RuntimeError("kconfig_check failed!")
def parse_apkbuild(args):
aport = pmb.build.other.find_aport(args, args.package)
path = aport + "/APKBUILD"
print(json.dumps(pmb.parse.apkbuild(args, path), indent=4))
def apkbuild_parse(args):
# Default to all packages
packages = args.packages
if not packages:
for apkbuild in glob.glob(args.aports + "/*/*/APKBUILD"):
packages.append(os.path.basename(os.path.dirname(apkbuild)))
# Iterate over all packages
packages.sort()
for package in packages:
print(package + ":")
aport = pmb.build.other.find_aport(args, package)
path = aport + "/APKBUILD"
print(json.dumps(pmb.parse.apkbuild(args, path), indent=4,
sort_keys=True))
def parse_apkindex(args):
def apkindex_parse(args):
result = pmb.parse.apkindex.parse(args, args.apkindex_path)
if args.package:
if args.package not in result: