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

[3006.x] maintain user-defined options in apt source definitions #65627

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

s0undt3ch
Copy link
Collaborator

What does this PR do?

Port #65366 to 3006.x

Attempts to maintain all debian source options (not just arch and signed-by) from debian package repo definitions.

NOTE: Through testing it was observed that Salt was also removing options from sources list files that were not even managed by Salt (because it reads all *.list files in known apt locations and re-writes them). This PR doesn't fix the behavior of Salt re-writing all *.list files, but it should prevent Salt from blindly stripping out options in those files.

What issues does this PR fix or reference?

Fixes: #64130

Previous Behavior

A pkgrepo definition like this:

test_unsigned_repo:
  pkgrepo.managed:
    - humanname: unsigned_repo
    - name: deb [trusted=yes] http://reposerver.net/ubuntu main
    - file: /etc/apt/sources.list.d/unsigned_repo_test

Resulted in a source list file like this (missing [trustred=yes] option):

deb http://reposerver.net/ubuntu main

New Behavior

A pkgrepo definition like this:

test_unsigned_repo:
  pkgrepo.managed:
    - humanname: unsigned_repo
    - name: deb [trusted=yes] http://reposerver.net/ubuntu main
    - file: /etc/apt/sources.list.d/unsigned_repo_test

Results in a correct source list file like this ([trustred=yes] option is maintained):

deb [trusted=yes] http://reposerver.net/ubuntu main

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@s0undt3ch s0undt3ch requested a review from a team as a code owner November 28, 2023 16:03
@s0undt3ch s0undt3ch requested review from MKLeb and removed request for a team November 28, 2023 16:03
@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title maintain user-defined options in apt source definitions [3006.x] maintain user-defined options in apt source definitions Nov 28, 2023
@s0undt3ch s0undt3ch merged commit 124ade4 into saltstack:3006.x Nov 28, 2023
515 checks passed
@s0undt3ch s0undt3ch deleted the hotfix/butch-apt-fix branch November 28, 2023 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants