I'm trying to append data to a Debian package's description during the build process.
The required data is stored in constants declared within debian/rules file.
I've override dh_gencontrol and added @printf calls which formats the data.
The issues I'm encountering are related to whitespace-containing-strings:
printfsplits the given string, matching each word to an%sinstance. I'd like it to use the whole string instead.- How can I manipulate said string, replacing spaces with
_and add it to the same line?
Relevant sections from debian/rules:
TEXT_STRING = "string with data"
VERSION_NUM = "v11.4"
...
...
override_dh_gencontrol:
dh_gencontrol
@echo "Adding versions to debian/control file" # This one writes to console
@printf " %-30s %-20s %s\n" "${TEXT_STRING// /_}" "${VERSION_NUM}" "${TEXT_STRING}" >> "$(CURDIR)/debian/my-package/DEBIAN/control"
Expected output:
<Package description generated by dh_gencontrol>
string_with_data v11.4 string with data
Actual output:
v11.4 string
with data