I'm writing a tool to modify the u-boot environment on certain devices.
At a point, I'm showing the user the changes to make to his environment.
Such changes usually contains the "${mtdparts}" string, that triggers an
assertion error in cdebconf when displayed.
I have made several tests:
1°) db_subst uboot-installer/apply_changes CHANGES "$$" shows "$$",
2°) db_subst uboot-installer/apply_changes CHANGES "\${mtdparts}" aborts
3°) db_subst uboot-installer/apply_changes CHANGES "$\{mtdparts}" shows
"$\{mtdparts}", which is not what I want
Reading the source code, I finally came to the conclusion that cdebconf expands
"${...}" no matter what, and wants it to be a directive.
Reading the doc, I've found that a non-implemented directive does nothing and
is replaced by an empty string, so, here is my ugly hack that works:
db_subst uboot-installer/apply_changes CHANGES "$${!}{mtdparts}"
This feels a bit wrong, and I think there should be a better way to do that.