Rex
Rex copied to clipboard
"signed-by" option in for Debian Repositories
As
Me
I would like to
"signed-by" option in for Debian Repositories
so I can
indicate to dpkg what key should be signing packages
Additional context
No response
Describe the solution you would like
Just needs to have the "signed-by" keyword added here https://metacpan.org/release/FERKI/Rex-1.13.4/source/lib/Rex/Pkg/Debian.pm#L134
Example output https://code.visualstudio.com/docs/setup/linux#_debian-and-ubuntu-based-distributions
Describe alternatives you have considered
No response
Thanks for raising this, @djzort!
The sources.list manual has specifications for both single-line and DEB822-style formats for APT data sources.
There are 13 options listed as supported, but rex seems to handle only one so far (arch). It is even special-cased as an if-else decision, which structure does not make it easy to extend support for arbitrary combinations of all the accepted options.
Suggested approach
Based on the above, my first idea about how to address the situation is the following:
-
Introduce a new parameter for the
repositorycommand, which accepts a hash reference with the desired options for the given APT repository:repository add => 'myrepo', url => ..., distro => ..., options => { arch => ..., 'signed-by' => ..., };optionsorapt_optionssounds like good candidates for this new parameter at this point. -
Generate the desired file contents by using an embedded template at the end of Rex::Pkg::Debian under
__DATA__, passing therepository()command's parameters to it for substitution. Then write the results to the target file. -
Find a way to make this approach testable. For example add an internal private function to get the generated content from the template, so tests can call it and compare it against expectations.
This approach is:
- flexible enough to support other options than just
archandsigned-by - extensible with validation against list of supported options later if desired
- extensible with support for DEB822-style file formats later via a second embedded template
edit: indent for list numbering
I dont have a preference. But it would be great to support all the options.