#592048 cdebconf: unable to display "${something}"

Package:
cdebconf
Source:
cdebconf
Description:
Debian Configuration Management System (C-implementation)
Submitter:
Thibaut GIRKA
Date:
2010-08-07 04:24:04 UTC
Severity:
minor
#592048#5
Date:
2010-08-07 04:20:03 UTC
From:
To:
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.