pmbootstrap/pmb/parse
Oliver Smith 5438085e62
pmb/parse/_apkbuild: fix parsing commented lines (!1837)
Properly ignore comments at the end of lines, instead of assuming that
all lines below belong to the attribute:
	subpackages="$pkgname-dev" # $pkgname-lang

Fixes build.postmarketos.org#61, where pmbootstrap would assume that a
random package provides "make", just because the word "make" is written
somewhere below subpackages=" in the APKBUILD and it is parsed
incorrectly.

While at it, also support the ' character for quotations and detect if
a quotation for a value was started, but there is no end quotation sign
in the rest of the file.

I've added tests, and manually checked that this did not introduce any
parsing bugs for all the APKBUILDs in pmaports.git, by running
'pmbootstrap apkbuild_parse' with the old and new code, and diffing the
result.
2019-11-30 12:44:06 +01:00
..
__init__.py parser: Add function to read a function from an APKBUILD (!1747) 2019-02-15 16:21:47 +01:00
_apkbuild.py pmb/parse/_apkbuild: fix parsing commented lines (!1837) 2019-11-30 12:44:06 +01:00
apkindex.py Improve algorithm to pick package provider (!1775) 2019-04-22 20:33:03 +02:00
arch.py Update alpine_to_hostspec mappings (!1812) 2019-09-18 20:34:41 +02:00
arguments.py timeout: change default from 300 to 900 seconds 2019-09-18 21:56:34 +02:00
binfmt_info.py Fix spelling mistakes (!1794) 2019-06-25 09:20:05 +02:00
bootimg.py Detect if DTB is placed in second area of Android boot image (!1828) 2019-10-25 17:36:22 +02:00
depends.py Improve algorithm to pick package provider (!1775) 2019-04-22 20:33:03 +02:00
deviceinfo.py pmb.deviceinfo: fix sanity check when "device-" is present in codename (!1834) 2019-11-22 00:01:38 +01:00
kconfig.py kconfig check: support passing a file directly (!1802) 2019-08-24 00:10:02 +02:00
version.py Add pmb.parse.version.check_string() (!1796) 2019-06-30 16:39:56 +02:00