Theoretically it is possible to reference variables before they are defined. In the shell, these will simply be evaluated to an empty string. In preparation of replacing variables immediately after parsing attributes, these variables will be no longer replaced correctly. We can simplify the code further, and avoid this problem by initializing the dict with the default values, replacing them with the real values from the APKBUILD. This will also avoid a (somewhat unrelated) error in the bootimg test: File "pmb/parse/_apkbuild.py", line 46, in replace_variable apkbuild["pkgname"], match.group(0), KeyError: 'pkgname' |
||
---|---|---|
.. | ||
aportgen | ||
build | ||
chroot | ||
config | ||
data | ||
export | ||
flasher | ||
helpers | ||
install | ||
parse | ||
qemu | ||
__init__.py |