Return a PackageData object from an APKBUILD file at ``location`` or None. If ``strict`` is True, raise ApkbuildParseFailure error if any attribute value cannot be fully resolved for shell variables.
(location, strict=False, package_only=False)
| 251 | |
| 252 | |
| 253 | def parse_apkbuild(location, strict=False, package_only=False): |
| 254 | """ |
| 255 | Return a PackageData object from an APKBUILD file at ``location`` or None. |
| 256 | |
| 257 | If ``strict`` is True, raise ApkbuildParseFailure error if any attribute |
| 258 | value cannot be fully resolved for shell variables. |
| 259 | """ |
| 260 | with open(location, 'rb') as f: |
| 261 | apkbuild = as_unicode(f.read()) |
| 262 | |
| 263 | return parse_apkbuild_text( |
| 264 | text=apkbuild, |
| 265 | datasource_id=AlpineApkbuildHandler.datasource_id, |
| 266 | package_type=AlpineApkbuildHandler.default_package_type, |
| 267 | strict=strict, |
| 268 | package_only=package_only, |
| 269 | ) |
| 270 | |
| 271 | |
| 272 | class ApkbuildParseFailure(Exception): |
no test coverage detected