Skip to content

[aptpkg] Add deb822 repository format support #67748

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

Closed
wants to merge 3 commits into from

Conversation

m-czernek
Copy link
Contributor

@m-czernek m-czernek commented Feb 18, 2025

What does this PR do?

In this PR, we are:

  • Adding aptpkg support for repositories in the deb 822 format.
  • Improving the docs a little bit (I found the examples for aptpkg to be not very useful)

What issues does this PR fix or reference?

Fixes #66928, #67334, #67760

Forward port from: openSUSE/salt#692

Previous Behavior

Deb822 repositories are not recognized.

New Behavior

Users can use debian repositories in either the DEB822 or the old one-line format.

Merge requirements satisfied?

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

Commits signed with GPG?

Yes

Please review Salt's Contributing Guide for best practices, including the
PR Guidelines.

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

Comment on lines +62 to +71
HAS_DEB822 = False

if HAS_APT:
try:
from aptsources.sourceslist import Deb822SourceEntry, _deb822

HAS_DEB822 = True
except ImportError:
pass

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem with this approach. relenv doesn't have aptsources. which is why HAS_APT was removed in 3007.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relenv doesn't have aptsources

Correct, which I'd think is a bug with the packaging of Salt on Debian-based systems.

Does 3007 (and newer) rely only on the custom classes in aptpkg that it redefines instead of importing from the python3-apt system library?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relenv doesn't have aptsources

Correct, which I'd think is a bug with the packaging of Salt on Debian-based systems.

Or it isn't. python-apt is not easily integrated. it isn't in pypi. it isn't meant for consumption outside of the package. and since relenv isn't just a venv. it isn't something to just allow "system python".

the other issue is some people like building their own packages. and if they do it in a different manner and try installing python-apt from say a github repo. there are a number of them any of which could be compromised.

Does 3007 (and newer) rely only on the custom classes in aptpkg that it redefines instead of importing from the python3-apt system library?

those classes were moved to a utils module, and rewtitten but yes.

and this is because aptpkg was completely broken. it worked in two different manners depending on if python-apt was installed or not. some things worked only if it wasn't there and others worked only if it was. it was a mess.

that all being said. if relenv gets python-apt go for it. split the functionality again. I was just raising my concern. I am no longer a maintainer in salt and have 0 stake in its functionality.

@vzhestkov vzhestkov mentioned this pull request Apr 24, 2025
3 tasks
@m-czernek
Copy link
Contributor Author

Folks, I'm closing this PR in favor of #67956, which implements feedback from @whytewolf

Please direct your reviews to that PR.

@m-czernek m-czernek closed this May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test:full Run the full test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants