Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"signed-by" option in for Debian Repositories #1556

Open
djzort opened this issue Nov 18, 2022 · 2 comments
Open

"signed-by" option in for Debian Repositories #1556

djzort opened this issue Nov 18, 2022 · 2 comments
Labels
feature request A suggested idea for the project

Comments

@djzort
Copy link

djzort commented Nov 18, 2022

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

@djzort djzort added the feature request A suggested idea for the project label Nov 18, 2022
@ferki
Copy link
Member

ferki commented Dec 7, 2022

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:

  1. Introduce a new parameter for the repository command, which accepts a hash reference with the desired options for the given APT repository:

    repository add => 'myrepo',
        url    => ...,
        distro => ...,
        options => {
            arch        => ...,
            'signed-by' => ...,
        };

    options or apt_options sounds like good candidates for this new parameter at this point.

  2. Generate the desired file contents by using an embedded template at the end of Rex::Pkg::Debian under __DATA__, passing the repository() command's parameters to it for substitution. Then write the results to the target file.

  3. 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 arch and signed-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

@djzort
Copy link
Author

djzort commented Dec 9, 2022

I dont have a preference. But it would be great to support all the options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A suggested idea for the project
Projects
None yet
Development

No branches or pull requests

2 participants