Fix #349: Verify pkgname against folder name after replacing vars

This fixes a regression introduced in 7fe2bc18c3.
Sorry for the inconvenience!
This commit is contained in:
Oliver Smith 2017-08-08 15:03:17 +02:00
parent 7fe2bc18c3
commit ae64894278
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 5 additions and 3 deletions

View File

@ -128,7 +128,7 @@ def apkbuild(args, path):
value = [] value = []
ret[attribute] = value ret[attribute] = value
# Add missing entries # Add missing keys
for attribute, options in pmb.config.apkbuild_attributes.items(): for attribute, options in pmb.config.apkbuild_attributes.items():
if attribute not in ret: if attribute not in ret:
if options["array"]: if options["array"]:
@ -136,6 +136,10 @@ def apkbuild(args, path):
else: else:
ret[attribute] = "" ret[attribute] = ""
# Properly format values
ret = replace_variables(ret)
ret = cut_off_function_names(ret)
# Sanity check: pkgname # Sanity check: pkgname
suffix = "/" + ret["pkgname"] + "/APKBUILD" suffix = "/" + ret["pkgname"] + "/APKBUILD"
if not os.path.realpath(path).endswith(suffix): if not os.path.realpath(path).endswith(suffix):
@ -145,7 +149,5 @@ def apkbuild(args, path):
" the folder, that contains the APKBUILD!") " the folder, that contains the APKBUILD!")
# Fill cache # Fill cache
ret = replace_variables(ret)
ret = cut_off_function_names(ret)
args.cache["apkbuild"][path] = ret args.cache["apkbuild"][path] = ret
return ret return ret